本文整理汇总了C#中System.Windows.Input.CanExecuteRoutedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CanExecuteRoutedEventArgs类的具体用法?C# CanExecuteRoutedEventArgs怎么用?C# CanExecuteRoutedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CanExecuteRoutedEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了CanExecuteRoutedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationUndoCommand_CanExecute
private void ApplicationUndoCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (lstHistory == null || lstHistory.Items.Count == 0)
e.CanExecute = false;
else
e.CanExecute = true;
}
示例2: Refresh_CanExecute
private void Refresh_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (_pageLoaded)
{
e.CanExecute = true;
}
}
示例3: CanExecuteAddControlCommand
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;
}
示例4: pausethejob_CanExecute
private void pausethejob_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
var j = this.DataContext as Job;
if (j != null && j.IsProcessing) {
e.CanExecute = true;
}
}
示例5: CanExecute
private static void CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
FrameworkElement senderElement = (sender as FrameworkElement);
if (HelpProvider.GetHelpString(senderElement) != null)
e.CanExecute = true;
}
示例6: canExecute_Save
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;
}
示例7: CanExecuteSave
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;
}
示例8: CommandClearTrace_CanExecute
private void CommandClearTrace_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (!string.IsNullOrEmpty(txtTrace.Text))
{
e.CanExecute = true;
}
}
示例9: ResetDecoder_CanExecute
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: CommandBinding_CanExecute
private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (e.Command.Equals(ApplicationCommands.Find))
{
e.CanExecute = !this.IsUpdateChecking;
}
}
示例11: StartGame_CanExecute
/// <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;
}
示例12: Command_CanExecute_MoveInHistory
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;
}
}
}
示例13: gl_editCmd_CanExecute
private void gl_editCmd_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (this.xCatNameTxt.Text == "")
e.CanExecute = false;
else
e.CanExecute = true;
}
示例14: CreateLinkFromSelectionCanExecute
private void CreateLinkFromSelectionCanExecute(object sender, CanExecuteRoutedEventArgs args)
{
RichTextBox wikiEditor = sender as RichTextBox;
args.CanExecute = !wikiEditor.Selection.IsEmpty;
args.ContinueRouting = false;
args.Handled = true;
}
示例15: ClearOutputCommand_CanExecute
private void ClearOutputCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (Model == null)
return;
e.CanExecute = Model.ExecutedScripts.Any();
}