Esempio n. 1
0
        public NoteContentEditorWindow(NoteContent toLoad)
        {
            InitializeComponent();
            StatusContext = new StatusControlContext();
            NoteContent   = new NoteContentEditorContext(StatusContext, toLoad);

            DataContext            = this;
            AccidentalCloserHelper = new WindowAccidentalClosureHelper(this, StatusContext, NoteContent);
        }
Esempio n. 2
0
        public NoteContentEditorWindow(NoteContent toLoad)
        {
            InitializeComponent();
            StatusContext = new StatusControlContext();

            StatusContext.RunFireAndForgetBlockingTaskWithUiMessageReturn(async() =>
            {
                NoteContent = await NoteContentEditorContext.CreateInstance(StatusContext, toLoad);

                NoteContent.RequestContentEditorWindowClose += (_, _) => { Dispatcher?.Invoke(Close); };
                AccidentalCloserHelper = new WindowAccidentalClosureHelper(this, StatusContext, NoteContent);

                await ThreadSwitcher.ResumeForegroundAsync();
                DataContext = this;
            });
        }