public ImageContentEditorWindow(ImageContent toLoad) { InitializeComponent(); StatusContext = new StatusControlContext(); ImageEditor = new ImageContentEditorContext(StatusContext, toLoad); DataContext = this; AccidentalCloserHelper = new WindowAccidentalClosureHelper(this, StatusContext, ImageEditor); }
public ImageContentEditorWindow() { InitializeComponent(); StatusContext = new StatusControlContext(); StatusContext.RunFireAndForgetBlockingTaskWithUiMessageReturn(async() => { ImageEditor = await ImageContentEditorContext.CreateInstance(StatusContext); ImageEditor.RequestContentEditorWindowClose += (sender, args) => { Dispatcher?.Invoke(Close); }; AccidentalCloserHelper = new WindowAccidentalClosureHelper(this, StatusContext, ImageEditor); await ThreadSwitcher.ResumeForegroundAsync(); DataContext = this; }); }