本文整理汇总了C#中System.Windows.Controls.Button.RaiseEvent方法的典型用法代码示例。如果您正苦于以下问题:C# Button.RaiseEvent方法的具体用法?C# Button.RaiseEvent怎么用?C# Button.RaiseEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Button
的用法示例。
在下文中一共展示了Button.RaiseEvent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformButtonClick
public void PerformButtonClick(Button button)
{
button.Dispatcher.BeginInvoke((Action)(() =>
{
if (startRecord)
button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
}), System.Windows.Threading.DispatcherPriority.Normal);
}
示例2: UpdateHistoriques
public void UpdateHistoriques()
{
foreach (GameSimulation gm in this.simulations)
{
Button bh = new Button();
bh.Content = "En savoir plus";
bh.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
bh.Click += bh_Click;
bh.Tag = this.simulations.IndexOf(gm);
parties.Items.Add(new TemplateHistorique(gm.game.EquipeRouge.Nom, gm.game.EquipeVerte.Nom, bh));
}
this.Refresh();
}
示例3: czekaj
private void czekaj(Button button)
{
int czas = 0;
Stopwatch sw = new Stopwatch();
sw.Start();
for (; ; )
{
try
{
czas = sw.Elapsed.Seconds;
this.progressBar1.Dispatcher.Invoke(
DispatcherPriority.Normal,
new Action(
delegate()
{
this.progressBar1.Value = Convert.ToDouble(((double)czas / 3.0) * 100.0);
})
);
if (czas >= 3)
{
break;
}
}
catch
{
t1.Abort();
}
}
sw.Stop();
kinect_active = true;
button.Dispatcher.Invoke(
DispatcherPriority.Normal,
new Action(
delegate()
{
button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
})
);
}
示例4: Click
private void Click(Button button)
{
button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
}
示例5: SetEvent_RaiseEvent_CheckCommandExecuted
public void SetEvent_RaiseEvent_CheckCommandExecuted() {
bool commandExecuted = false;
EventToCommand eventToCommand = new EventToCommand() { Command = new DelegateCommand(() => {
commandExecuted = true;
})};
Button button = new Button();
eventToCommand.Event = Button.ClickEvent;
eventToCommand.Attach(button);
button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent, button));
EnqueueWindowUpdateLayout();
Assert.IsTrue(commandExecuted);
}
示例6: press_button
private void press_button(Button button)
{
if (gesture_lock == false)
{
button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
gesture_lock = true;
}
}