Beispiel #1
0
        private async void EditFlagMenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            var flagViewModel = ((FrameworkElement)sender).DataContext as FlagViewModel;

            if (flagViewModel == null)
            {
                return;
            }
            var win = new FlagEditorWindow()
            {
                Owner = this
            };

            Debug.Assert(FlagManager.CanReplace(flagViewModel.Source.Type));
            win.InitializeEditor(flagViewModel.Source);
            if (win.ShowDialog() == true)
            {
                this.ViewModel.Sync();
                await this.ViewModel.LoadAsync();
            }
        }