예제 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;

            // MessageBox.Show(button.Name);
            OpenDoor?.Invoke(sender, new OpenDoorEventArgs {
                Door = button.DataContext as DoorItem
            });
        }
예제 #2
0
        private void All_Click(object sender, MouseButtonEventArgs e)
        {
            TextBlock button = (TextBlock)sender;
            DoorItem  door   = button.DataContext as DoorItem;

            OpenDoor?.Invoke(sender, new OpenDoorEventArgs
            {
                ButtonName = "count",
                Door       = button.DataContext as DoorItem
            });

            e.Handled = true;
        }
예제 #3
0
        private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            TextBlock textblock = (TextBlock)sender;
            DoorItem  door      = textblock.DataContext as DoorItem;

            OpenDoor?.Invoke(sender, new OpenDoorEventArgs
            {
                ButtonName = textblock.Name,
                Door       = textblock.DataContext as DoorItem
            });

            e.Handled = true;

            /*
             * Button button = textblock.TemplatedParent as Button;
             * DoorItem door = button.DataContext as DoorItem;
             */
        }
예제 #4
0
 /// <summary>
 ///     Raise the open door event.
 /// </summary>
 private static void RaiseOpenDoor()
 {
     OpenDoor?.Invoke(null, EventArgs.Empty);
 }