void Open_Executed(object sender, ExecutedRoutedEventArgs e) { if (OpenVMCommand != null && OpenVMCommand.CanExecute(null)) { FileDialog fd = new FileDialog { Owner = AssociatedObject }; if (fd.ShowDialog() == true) { if (fd.FileInfo != null) { OpenVMCommand.Execute(fd.FileInfo.FullName); } } } }
private void Open_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = OpenVMCommand != null && OpenVMCommand.CanExecute(null); }