Пример #1
0
        public TransformEditDlg(Window owner, SettingsViewModel vmSettings, MDictionaryEdit itemEdit)
        {
            InitializeComponent();
            //SourceInitialized += (x, y) => this.HideMinimizeAndMaximizeButtons();
            Owner                  = owner;
            DataContext            = vm = new TransformEditViewModelWPF(vmSettings, itemEdit);
            tcTranform.DataContext = this;
            templateCtrl           = new TransformTemplateControl(vm);
            sourceCtrl             = new TransformSourceControl(vm);
            resultCtrl             = new TransformResultControl(vm);
            intermediateCtrl       = new TransformIntermediateControl(vm);
            Tabs.Add(new ActionTabItem {
                Header = "Source", Content = sourceCtrl
            });
            Tabs.Add(new ActionTabItem {
                Header = "Result", Content = resultCtrl
            });
            Tabs.Add(new ActionTabItem {
                Header = "Intermediate", Content = intermediateCtrl
            });
            Tabs.Add(new ActionTabItem {
                Header = "Template", Content = templateCtrl
            });
            Action <ReactiveCommand <Unit, Unit> > f = cmd => cmd.WhenFinishedExecuting().Subscribe(_ => tcTranform.SelectedIndex = 1);

            f(vm.ExecuteTransformCommand);
            f(vm.GetAndTransformCommand);
        }
Пример #2
0
 public TransformResultControl(TransformEditViewModelWPF vm)
 {
     InitializeComponent();
     DataContext = this.vm = vm;
 }
 public TransformTemplateControl(TransformEditViewModelWPF vm)
 {
     InitializeComponent();
     DataContext = vm;
 }
 public TransformSourceControl(TransformEditViewModelWPF vm)
 {
     InitializeComponent();
     DataContext = this.vm = vm;
     vm.WhenAnyValue(x => x.SourceUrl).Where(s => !string.IsNullOrEmpty(s)).Subscribe(_ => Load());
 }