private void OnClearFieldExecute() { foreach (UIElement control in grid.Children) { if (control is Image img) { img.Source = ResourceDriver.GetVoidBmp(); } } }
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(); } } }
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; } } } } }