コード例 #1
0
 private void OnClearFieldExecute()
 {
     foreach (UIElement control in grid.Children)
     {
         if (control is Image img)
         {
             img.Source = ResourceDriver.GetVoidBmp();
         }
     }
 }
コード例 #2
0
 private void ChangeImage(object sender, MouseEventArgs e)
 {
     if (sender != null && sender is Image img)
     {
         if (SelectedMgElem != null && e.LeftButton == MouseButtonState.Pressed)
         {
             img.Source = SelectedMgElem.ViewModel.ImageSource;
         }
         else if (e.RightButton == MouseButtonState.Pressed)
         {
             img.Source = ResourceDriver.GetVoidBmp();
         }
     }
 }
コード例 #3
0
 private void OnFillAllVoidsExecute()
 {
     if (SelectedMgElem != null)
     {
         string voidImg = ResourceDriver.GetVoidBmp().UriSource.ToString();
         foreach (UIElement control in grid.Children)
         {
             if (control is Image img)
             {
                 if (img.Source.ToString() == voidImg)
                 {
                     img.Source = SelectedMgElem.ImgControl.Source;
                 }
             }
         }
     }
 }