How can I make a WPF textbox cut, copy and paste restricted?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Cut, Copy and Paste are the common commands used any application,
in above textbox code we can restrict these commands in PrviewExecuted event of CommandManager Class
and in code behind add below code and your job is done
The commandName method will not work on a System with Japanese OS as the commandName=="Paste" comparision will fail. I tried the following approach and it worked for me. Also I do not need to disable the context menu manually.
In the XaML file:
In the code behind: