コード例 #1
0
ファイル: ViCFCFile.cs プロジェクト: GemHu/SolutionExplorer
        public override void CanExecuteCommand(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            if (e.Command == ViCommands.Link)
            {
                if (this.Parent is ViCPUInfo && !this.Linked)
                {
                    e.CanExecute = true;
                }
                return;
            }
            else if (e.Command == ViCommands.Unlink)
            {
                if (this.Parent is ViCPUInfo && this.Linked)
                {
                    e.CanExecute = true;
                }
                return;
            }
            else if (e.Command == ViCommands.Rename)
            {
                e.CanExecute = true;
                return;
            }

            base.CanExecuteCommand(sender, e);
        }
コード例 #2
0
 public void ActionCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     try
     {
         bool CanExecute = false;
         if (IsShowBankAccNo == true)
         {
             CanExecute = Validation.GetHasError(txtFirstName) ||
                Validation.GetHasError(txtMiddleName) ||
                Validation.GetHasError(txtLastName) ||
                Validation.GetHasError(txtAdd1) ||
                Validation.GetHasError(txtAdd2) ||
                Validation.GetHasError(txtPincode) ||
                Validation.GetHasError(txtBankAccNo);
         }
         else
         {
             CanExecute = Validation.GetHasError(txtFirstName) ||
                Validation.GetHasError(txtMiddleName) ||
                Validation.GetHasError(txtLastName) ||
                Validation.GetHasError(txtAdd1) ||
                Validation.GetHasError(txtAdd2) ||
                Validation.GetHasError(txtPincode);
         }
         e.CanExecute = !CanExecute;
         if(btnSearch.IsEnabled==true)
         btnSaveCustomer.IsEnabled = !CanExecute;
     }
     catch(Exception ex )
     {
         ExceptionManager.Publish(ex);                
     }
 }
コード例 #3
0
        /// <summary>
        /// Determine if the start button should be enabled
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StartGame_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            var playerSetupControls = StackPanel_Players.Children.OfType<PlayerSetup>();
            List<string> usedNames = new List<string>(5);
            foreach (var playerSetupControl in playerSetupControls)
            {
                if (playerSetupControl.IsRequired && playerSetupControl.IsEmpty)
                {
                    e.CanExecute = false;
                    e.Handled = true;
                    return;
                }
                else if (playerSetupControl.IsEmpty == false)
                {
                    if (usedNames.Contains(playerSetupControl.PlayerName.ToUpper()))
                    {
                        e.CanExecute = false;
                        e.Handled = true;
                        return;
                    }
                    usedNames.Add(playerSetupControl.PlayerName.ToUpper());
                }
            }

            e.CanExecute = true;
            e.Handled = true;
        }
コード例 #4
0
        private void Command_CanExecute_MoveInHistory(object sender, CanExecuteRoutedEventArgs args)
        {
            if (args.Parameter == null) return;

            if (int.Parse(args.Parameter.ToString()) == -1)
            {
                if (lbHistory.SelectedIndex == 0 || lbHistory.SelectedIndex == -1)
                {
                    args.CanExecute = false;
                }
                else
                {
                    args.CanExecute = true;
                }
            }
            else
            {
                if (lbHistory.SelectedIndex == lbHistory.Items.Count - 1)
                {
                    args.CanExecute = false;
                }
                else
                {
                    args.CanExecute = true;
                }
            }
        }
 private void CanExecuteOpenComponentGraphCommand(object sender, CanExecuteRoutedEventArgs e)
 {
     if (OpenComponentGraphCommand != null)
     {
         e.CanExecute = OpenComponentGraphCommand.CanExecute(e.Parameter);
     }
 }
コード例 #6
0
ファイル: TwitView.cs プロジェクト: unbearab1e/FlattyTweet
 private void CanExecutePasteHandler(object sender, CanExecuteRoutedEventArgs e)
 {
     try
       {
     if (Clipboard.ContainsFileDropList())
     {
       StringCollection fileDropList = Clipboard.GetFileDropList();
       string path = fileDropList[0];
       if (fileDropList.Count != 1 || !Enumerable.Contains<string>((IEnumerable<string>) this.supportedImageTypeExtensions, Path.GetExtension(path).ToLower()))
     return;
       e.CanExecute = true;
       e.Handled = true;
     }
     else
     {
       if (!Clipboard.ContainsImage() || Clipboard.ContainsText())
     return;
       e.CanExecute = true;
       e.Handled = true;
     }
       }
       catch
       {
     e.CanExecute = true;
     e.Handled = false;
       }
 }
コード例 #7
0
 private void EditCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     if (e.Parameter as purchase_tender_contact != null)
     {
         e.CanExecute = true;
     }
 }
コード例 #8
0
 private void CommandClearTrace_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtTrace.Text))
     {
         e.CanExecute = true;
     }
 }
コード例 #9
0
 private void ResetDecoder_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     //e.CanExecute =
     //    station != null && station.Connected && Decoder != null &&
     //    ((station.MainTrackActive && (NMRAProgramMode)cbProgramMode.SelectedValue == NMRAProgramMode.POM) || (NMRAProgramMode)cbProgramMode.SelectedValue != NMRAProgramMode.POM)
     //    ;
 }
コード例 #10
0
 private void CanEditDocument(object sender, CanExecuteRoutedEventArgs e)
 {
     if (Editor != null && Editor.TextArea != null && Editor.TextArea.Selection != null)
     {
         e.CanExecute = !Editor.TextArea.Selection.IsEmpty;
     }
 }
コード例 #11
0
		private void CanExecuteAddControlCommand(object sender, CanExecuteRoutedEventArgs e)
		{
			//var type = GetType(e.Parameter);

			//e.CanExecute = type == null || _controls.All(c => c.Control.GetType() != type.Item1);
			e.CanExecute = true;
		}
コード例 #12
0
ファイル: HelpProvider.cs プロジェクト: ppucik/DOZP
        private static void CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            FrameworkElement senderElement = (sender as FrameworkElement);

            if (HelpProvider.GetHelpString(senderElement) != null)
                e.CanExecute = true;
        }
コード例 #13
0
ファイル: MainWindow.xaml.cs プロジェクト: flawiddsouza/Marky
 private void Refresh_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (_pageLoaded)
     {
         e.CanExecute = true;
     }
 }
コード例 #14
0
        private void CommandBinding_CanExecute_Cancel(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            ManagementViewModel vm = DataContext as ManagementViewModel;

            e.CanExecute = true;
            //权限处理 e.CanExecute = vm.AccountAuthority.AllowRevocationOrder;
        }
コード例 #15
0
ファイル: OrderView.xaml.cs プロジェクト: RJPalmer/qfn_uidemo
 private void CanCancelReplaceExecuteHandler(object sender, CanExecuteRoutedEventArgs e)
 {
     // Ideally, this would check to see that the order's state is one that could be cancel/replaced
     // but right now it doesn't.
     e.CanExecute = (lvOrders.Items.Count > 0) && (lvOrders.SelectedItem != null);
     e.Handled = true;
 }
コード例 #16
0
		private void ClearOutputCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
		{
			if (Model == null)
				return;

			e.CanExecute = Model.ExecutedScripts.Any();
		}
コード例 #17
0
ファイル: MainWindow.xaml.cs プロジェクト: KuriyIO/WPF_labs
 void canExecute_Save(object sender, CanExecuteRoutedEventArgs e)
 {
     if (Surname.Text != "" && Name.Text != "" && Patronymic.Text != "" && Year.Text != "" && Male.Text != "") 
         e.CanExecute = true; 
     else 
         e.CanExecute = false;
 }
コード例 #18
0
        private void CommandBinding_AddSentence_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            var page = this.Page;
            var sentence = this.Sentence;

            e.CanExecute = page > 0 && sentence > 0 && !this._facade.ContainsSentence(page, sentence);
        }
コード例 #19
0
 private void ApplicationUndoCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (lstHistory == null || lstHistory.Items.Count == 0)
         e.CanExecute = false;
     else
         e.CanExecute = true;
 }
コード例 #20
0
 private void CanExecuteStopCommand(object sender, CanExecuteRoutedEventArgs eventArgs)
 {
     var statusViewModel = (StatusViewModel)DataContext;
     bool canExecute = statusViewModel.CancelCommand.CanExecute();
     eventArgs.CanExecute = canExecute;
     eventArgs.Handled = canExecute;
 }
コード例 #21
0
ファイル: ClassList.xaml.cs プロジェクト: GrayJumba/Onion
        void PrintCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {

            if (MySQLHandler.ClassList.Default.Dt.Rows.Count == 0)
                e.CanExecute = false;
            else e.CanExecute = true;
        }
コード例 #22
0
 private void gl_editCmd_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (this.xCatNameTxt.Text == "")
         e.CanExecute = false;
     else
         e.CanExecute = true;
 }
コード例 #23
0
 private void SwitchToIdleModeCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (VM.InputMode == Controls.Problem.InputMode.Idle)
         e.CanExecute = false;
     else
         e.CanExecute = true;
 }
コード例 #24
0
 private void OpenInBrowser_CanExecute(object sender, CanExecuteRoutedEventArgs e) {
     var url = (string)e.Parameter;
     Uri uri;
     e.CanExecute = Uri.TryCreate(url, UriKind.Absolute, out uri) &&
                    (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps);
     e.Handled = true;
 }
コード例 #25
0
ファイル: DBDataGrid.cs プロジェクト: etupper/PFM
        protected override void OnCanExecuteBeginEdit(System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            bool         hasCellValidationError = false;
            bool         hasRowValidationError  = false;
            BindingFlags bindingFlags           = BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Instance;
            //Current cell
            PropertyInfo cellErrorInfo = this.GetType().BaseType.GetProperty("HasCellValidationError", bindingFlags);
            //Grid level
            PropertyInfo rowErrorInfo = this.GetType().BaseType.GetProperty("HasRowValidationError", bindingFlags);

            if (cellErrorInfo != null)
            {
                hasCellValidationError = (bool)cellErrorInfo.GetValue(this, null);
            }
            if (rowErrorInfo != null)
            {
                hasRowValidationError = (bool)rowErrorInfo.GetValue(this, null);
            }

            base.OnCanExecuteBeginEdit(e);
            if (!e.CanExecute && !hasCellValidationError && hasRowValidationError)
            {
                e.CanExecute = true;
                e.Handled    = true;
            }
        }
コード例 #26
0
 private void CreateLinkFromSelectionCanExecute(object sender, CanExecuteRoutedEventArgs args)
 {
     RichTextBox wikiEditor = sender as RichTextBox;
     args.CanExecute = !wikiEditor.Selection.IsEmpty;
     args.ContinueRouting = false;
     args.Handled = true;
 }
コード例 #27
0
 private void Find_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     if (EditText1.IsEnabled)
     {
         e.CanExecute = true;
     }
 }
コード例 #28
0
ファイル: Example.xaml.cs プロジェクト: nukolai/xaml-sdk
 private static void CanExecuteSave(object sender, CanExecuteRoutedEventArgs e)
 {
     if (sender == null)
         throw new ArgumentNullException("sender");
     var owner = sender as Example;
     e.CanExecute = owner != null && owner.diagram != null && owner.diagram.Items.Count > 0;
 }
コード例 #29
0
ファイル: JobListTemplate.xaml.cs プロジェクト: dotob/wop
 private void pausethejob_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     var j = this.DataContext as Job;
       if (j != null && j.IsProcessing) {
     e.CanExecute = true;
       }
 }
コード例 #30
0
 //// The following 4 event handlers support the "CommandBindings" in the window.
 // These hook to the Undo and Redo commands.
 private void Undo_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     // Tell the UI whether Undo is available.
     var catalog = VM;
     if (catalog != null)
     e.CanExecute = UndoService.Current[catalog].CanUndo;
 }
コード例 #31
0
ファイル: ActionHistory.xaml.cs プロジェクト: grathad/GBlason
 /// <summary>
 /// Commands the undo can execute.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.Windows.Input.CanExecuteRoutedEventArgs"/> instance containing the event data.</param>
 private void CommandUndoCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (GlobalApplicationViewModel.GetApplicationViewModel.CurrentlyDisplayedFile != null)
         e.CanExecute = CommandHistoryDataGrid.SelectedItem == null ? GlobalApplicationViewModel.GetApplicationViewModel.CurrentlyDisplayedFile.CommandsApplied.HasUndoableCommand : ((CommandGeneric)CommandHistoryDataGrid.SelectedItem).Done;
     else
         e.CanExecute = false;
 }
コード例 #32
0
 private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (e.Command.Equals(ApplicationCommands.Find))
     {
         e.CanExecute = !this.IsUpdateChecking;
     }
 }
コード例 #33
0
 private void CanAddBookItemExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = !String.IsNullOrWhiteSpace(uxAddBookTitle.Text) &&
                    !String.IsNullOrWhiteSpace(uxAddBookAuthor.Text);
     //&& !String.IsNullOrWhiteSpace(uxAddBookISBN.Text);
     e.Handled = true;
 }
コード例 #34
0
 private void RCUCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     var serTest = this.DataContext as SerialConnTest;
     bool canex = false;
     if (serTest != null)
         canex = !serTest.Busy;
     e.CanExecute = canex;
 }
コード例 #35
0
ファイル: MainWindow.xaml.cs プロジェクト: ryanwentzel/RLib
 private void CommandBinding_CanExecuteCutOrPaste(object sender, CanExecuteRoutedEventArgs e)
 {
     if (e.Command == ApplicationCommands.Cut || e.Command == ApplicationCommands.Paste)
     {
         e.CanExecute = false;
         e.Handled = true;
     }
 }
コード例 #36
0
        private void CommandBinding_CanExecute_RecordRealWeight(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            ManagementViewModel vm            = DataContext as ManagementViewModel;
            MarketOrderData     selectedOrder = (e.OriginalSource as DataGridRow).DataContext as MarketOrderData;

            e.CanExecute = true;
            //权限处理e.CanExecute = vm.AccountAuthority.CheckManage&&(selectedOrder.OrderType==TRANSACTION_TYPE.Recovery);
        }
コード例 #37
0
ファイル: MainWindow.xaml.cs プロジェクト: yvanvds/interact
        private void StopProject_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            if (Project.Project.Current == null)
            {
                e.CanExecute = false;
                return;
            }

            e.CanExecute = Project.Project.Current.Running;
        }
コード例 #38
0
 private void ExitCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     try
     {
         e.CanExecute = true;
     }
     catch (Exception ex)
     {
         App.HandleException(ex);
     }
 }
コード例 #39
0
 private void SaveAsWithFormattingCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     try
     {
         e.CanExecute = this.GetSelectedXPathDocumentContent() != null;
     }
     catch (Exception ex)
     {
         App.HandleException(ex);
     }
 }
コード例 #40
0
 private void AddCommandHandler_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     if (DataItemModel != null)
     {
         if (Validation.GetHasError(DataItem_X) == false && Validation.GetHasError(DataItem_Y) == false && Validation.GetHasError(DataItem_Value) == false)
         {
             e.CanExecute = true;
             return;
         }
     }
     e.CanExecute = false;
 }
コード例 #41
0
        private void CommandBinding_CanExecute_Warehousing(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            ManagementViewModel vm = DataContext as ManagementViewModel;
            //e.CanExecute = vm.AccountAuthority.AllowWarehousingOrder;
            MarketOrderData selectedOrder = (e.OriginalSource as DataGridRow).DataContext as MarketOrderData;

            if (selectedOrder.AllowStore)
            {
                e.CanExecute = true;
            }
            //权限处理 e.CanExecute = vm.AccountAuthority.AllowWarehousingOrder;
            else
            {
                e.CanExecute = false;
            }
        }
コード例 #42
0
        public override void CanExecuteCommand(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            if (e.Command == ViCommands.OpenLocalFolder ||
                e.Command == ViCommands.AddNewItem)
            {
                e.CanExecute = true;
                return;
            }
            else if (e.Command == ViCommands.Build ||
                     e.Command == ViCommands.Rebuild ||
                     e.Command == ViCommands.Clean)
            {
                //e.CanExecute = this.CanBuild();
            }

            base.CanExecuteCommand(sender, e);
        }
コード例 #43
0
        private void CommandBinding_CanExecute_Password(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            ValidationResult PbNewResult = rule.Validate(PbNew.Password, new System.Globalization.CultureInfo("en-US"));

            //Validation validation
            PbNew.ToolTip = PbNewResult.ErrorContent;
            if (!PbNewResult.IsValid)
            {
                PbNew.BorderBrush = Brushes.Red;
            }
            else
            {
                PbNew.BorderBrush = cbrush.BorderBrush;
            }

            ValidationResult PbNewConfirmResult = rule.Validate(PbNewConfirm.Password, new System.Globalization.CultureInfo("en-US"));

            PbNewConfirm.ToolTip = PbNewConfirmResult.ErrorContent;
            if (!PbNewConfirmResult.IsValid)
            {
                PbNewConfirm.BorderBrush = Brushes.Red;
            }
            else
            {
                PbNewConfirm.BorderBrush = cbrush.BorderBrush;
            }

            ValidationResult PbOldResult = rule.Validate(PbOld.Password, new System.Globalization.CultureInfo("en-US"));

            PbOld.ToolTip = PbOldResult.ErrorContent;
            if (!PbOldResult.IsValid)
            {
                PbOld.BorderBrush = Brushes.Red;
            }
            else
            {
                PbOld.BorderBrush = cbrush.BorderBrush;
            }
            e.CanExecute = !string.IsNullOrEmpty(PbOld.Password) && !string.IsNullOrEmpty(PbNew.Password) && !string.IsNullOrEmpty(PbNewConfirm.Password) &&
                           PbNew.Password == PbNewConfirm.Password &&
                           PbNew.Password.Length >= 6 &&
                           PbNew.Password.Length <= 16 &&
                           PbNewConfirm.Password.Length >= 6 &&
                           PbNewConfirm.Password.Length <= 16;
        }
コード例 #44
0
        public override void CanExecuteCommand(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            if (e.Command == ViCommands.AddExistingItem)
            {
                e.CanExecute = true;
                return;
            }
            else if (e.Command == ApplicationCommands.Delete)
            {
                e.CanExecute = true;
            }
            else if (e.Command == ViCommands.Rename)
            {
            }


            base.CanExecuteCommand(sender, e);
        }
コード例 #45
0
ファイル: MainWindow.xaml.cs プロジェクト: yvanvds/interact
        private void StartProject_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            if (Project.Project.Current == null)
            {
                e.CanExecute = false;
                return;
            }

            /*Item screen = Global.ProjectManager.Current.Screens.Get(Global.ProjectManager.Current.Config.StartupScreen);
             * if (screen == null)
             * {
             *      e.CanExecute = false;
             *      return;
             * }*/

            if (Project.Project.Current.Running)
            {
                e.CanExecute = false;
                return;
            }

            e.CanExecute = true;
        }
コード例 #46
0
        public override void CanExecuteCommand(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            if (e.Command == ViCommands.AddExistingItem)
            {
                e.CanExecute = true;
                return;
            }
            else if (e.Command == ApplicationCommands.Delete)
            {
                e.CanExecute = true;
                return;
            }
            else if (e.Command == ViCommands.Rename)
            {
            }
            else if (e.Command == ViCommands.Build ||
                     e.Command == ViCommands.Rebuild ||
                     e.Command == ViCommands.Clean)
            {
                if (this.TheFactory != null)
                {
                    e.CanExecute = true;
                    return;
                }
            }
            else if (e.Command == ViCommands.GitDiff)
            {
                if (this.TheSolution.GitManager != null)
                {
                    e.CanExecute = true;
                }
                return;
            }

            base.CanExecuteCommand(sender, e);
        }
コード例 #47
0
 private void CommandSave_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = startDate.Text != "" && starttime.Text != "";
 }
コード例 #48
0
 private void SelectAll_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = true;
 }
コード例 #49
0
 private void OnRequestNavigateForward(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.Handled = true;
     NavigationHelper.RequestPageForwardAction();
 }
コード例 #50
0
 private void BackCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = _browsingHistoryManager.CanBack();
 }
コード例 #51
0
 private void CollectCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = _pageTabControl.SelectedItem != null;
 }
コード例 #52
0
 private void CollectCommand_CanExecute1(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = _helpDocTreeView.HelpDocTree.SelectedItem != null;
 }
コード例 #53
0
 private void DeleteCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = _helpDocFavorite.CollectList.SelectedItems.Count == 1;
 }
コード例 #54
0
 private void OpenCommand_CanExecute1(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = _helpDocSearch.CollectList.SelectedItems.Count == 1;
 }
コード例 #55
0
 private void SaveCommandHandler_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = Collection.ChangedAfterSaving;
 }
コード例 #56
0
 private void Ok_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = IsLoaded && TypeComboBox.SelectedIndex > 0;
 }
コード例 #57
0
 private void DeleteCommandHandler_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = listBox_Main != null && listBox_Main.SelectedIndex >= 0;
 }
コード例 #58
0
 private void AddProduct_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = _noOfErrorsOnScreen == 0;
     e.Handled    = true;
 }
コード例 #59
0
 private void OpenCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = true;
 }
コード例 #60
0
 private void SaveAsCommand_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
 {
     e.CanExecute = tabControl1.SelectedIndex != -1;
 }