I have copy paste button in my application. Initially both button has to be disabled, If I select any text from any textbox, then only copy button needs to be enabled. And once I copied something, Paste button needs to be enabled. I use this code in App.xaml.cs file:
My question is, how would I know that when do i have to enable this button, How to find out in CanCmdCopy function, if I selected any text or not ?
#region CopyCommand
private void CmdCopy(object sender, ExecutedRoutedEventArgs args)
{
// code///
}
private void CanCmdCopy(object sender, CanExecuteRoutedEventArgs args)
{
args.CanExecute = ?????
}
#endregion
Thanks
Dee