public void PerformButtonClick(Button button)
 {
     button.Dispatcher.BeginInvoke((Action)(() =>
     {
         if (startRecord)
             button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }), System.Windows.Threading.DispatcherPriority.Normal);
 }
        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();
        }
Example #3
0
        // key press eventHandler
        private void Key_down(object sender, KeyEventArgs e)
        {
            Key k = e.Key;

            switch (k)
            {
            case Key.Q:
                indexHighlighted -= 2;
                if (indexHighlighted < 0)
                {
                    aTimer.Stop();
                    indexHighlighted += currentButtons.Count;
                    aTimer.Start();
                }
                break;

            case Key.E:
                highlightedButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
                break;
            }
        }
Example #4
0
        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));
                })
            );
        }
Example #5
0
 private void Click(Button button)
 {
     button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
 }
 private void PressButton(System.Windows.Controls.Button btn, KeyEventArgs e)
 {
     e.Handled = true;
     btn.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Button.ClickEvent));
 }
 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);
 }
 private void press_button(Button button)
 {
     if (gesture_lock == false)
     {
         button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
         gesture_lock = true;
     }
 }
Example #9
0
 public static void PerformClick(this System.Windows.Controls.Button btn)
 {
     btn.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Button.ClickEvent));
 }
Example #10
0
 public static void PerformClick(this Button btn)
 {
     btn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
 }