private void SelectTexture_Click(object sender, RoutedEventArgs e) { var wnd = new ChildWindow(); wnd.Owner = this.GetWindow(); var textureSelector = new TexturePreviewSelector(); textureSelector.Canceled += (s, ea) => { wnd.Close(); }; textureSelector.TextureSelected += (s, ea) => { wnd.Close(); Texture = ea.Value; }; wnd.Content = textureSelector; wnd.Show(); }
protected override void OnClick() { var dialog = FileDialogHelper.CreateOpenImageDialog(); if (dialog.ShowDialog(this.GetWindow()) != true) { return; } Bitmap bmp; try { bmp = (Bitmap)Bitmap.FromFile(dialog.FileName); } catch (Exception ex) { ChildWindow.ShowError(ex, this.GetWindow()); return; } Bitmap = bmp; Refresh(); }