public GraphWindow()
        {
            RedrawFull         = TelmaCommandAssistant.CreateFromTask("RedrawFull", RedrawFullImpl).DisposeWith(disposer);
            RedrawSelected     = TelmaCommandAssistant.CreateFromTask("RedrawSelected", RedrawSelectedImpl).DisposeWith(disposer);
            RedrawWithNewScale = TelmaCommandAssistant.Create("RedrawWithNewScale", () => renderer.Invalidate()).DisposeWith(disposer);

            OnGMFull = TelmaCommandAssistant.Create("OnGMFull", () => { if (Canvas != null)
                                                                        {
                                                                            Canvas.GridMode = GraphicCanvas.GridModes.Full;
                                                                        }
                                                    }).DisposeWith(disposer);
            OnGMMain = TelmaCommandAssistant.Create("OnGMMain", () => { if (Canvas != null)
                                                                        {
                                                                            Canvas.GridMode = GraphicCanvas.GridModes.Main;
                                                                        }
                                                    }).DisposeWith(disposer);
            OnGMNone = TelmaCommandAssistant.Create("OnGMNone", () => { if (Canvas != null)
                                                                        {
                                                                            Canvas.GridMode = GraphicCanvas.GridModes.None;
                                                                        }
                                                    }).DisposeWith(disposer);
            OnGMZero = TelmaCommandAssistant.Create("OnGMZero", () => { if (Canvas != null)
                                                                        {
                                                                            Canvas.GridMode = GraphicCanvas.GridModes.Zero;
                                                                        }
                                                    }).DisposeWith(disposer);

            OnGMFull.Command.Subscribe(_ => { renderer.Invalidate(); });
            OnGMMain.Command.Subscribe(_ => { renderer.Invalidate(); });
            OnGMNone.Command.Subscribe(_ => { renderer.Invalidate(); });
            OnGMZero.Command.Subscribe(_ => { renderer.Invalidate(); });
        }
Ejemplo n.º 2
0
 public ProblemItem()
 {
     RunPostprocessor = TelmaCommandAssistant.Create(
         "Run Postprocessor",
         () => RunPostprocessorImpl(),
         canExecute: this.WhenAnyValue(t => t.ViewModel.ProblemItem !.Problem !.IsSolved));
 }
Ejemplo n.º 3
0
        protected override void OnParametersSet()
        {
            base.OnParametersSet();

            AddTitlesView = TelmaCommandAssistant.CreateFromTask("AddTitlesView", async() =>
            {
                var name = "";
                await ViewModel.OnAddTitlesView.Command.Execute(name);
            });
        }
Ejemplo n.º 4
0
 public SelectionPanel()
 {
     OnSetSingleMode     = TelmaCommandAssistant.Create("OnSetSingleMode", () => { Aggregator.SelectionMethod = SelectionMethods.Single; });
     OnSetGroupMode      = TelmaCommandAssistant.Create("OnSetGroupMode", () => { Aggregator.SelectionMethod = lastmethod; });
     OnSetPointSelector  = TelmaCommandAssistant.Create("OnSetPointSelector", () => { Aggregator.SelectorType = SelectorTypes.stPoint; });
     OnSetRectSelector   = TelmaCommandAssistant.Create("OnSetRectSelector", () => { Aggregator.SelectorType = SelectorTypes.stRectangle; });
     OnSetCircleSelector = TelmaCommandAssistant.Create("OnSetCircleSelector", () => { Aggregator.SelectorType = SelectorTypes.stCircle; });
     OnSetSelMethod      = TelmaCommandAssistant.Create("OnSetSelMethod", () => { lastmethod = Aggregator.SelectionMethod = SelectionMethods.Select; });
     OnSetUnselMethod    = TelmaCommandAssistant.Create("OnSetUnselMethod", () => { lastmethod = Aggregator.SelectionMethod = SelectionMethods.Unselect; });
     OnSetInvMethod      = TelmaCommandAssistant.Create("OnSetInvMethod", () => { lastmethod = Aggregator.SelectionMethod = SelectionMethods.Inverse; });
 }
        public FilePanel()
        {
            Save = TelmaCommandAssistant.Create("Save", async() =>
            {
                FileService.Component = ViewModel;
                await JSInterop.InvokeVoidAsync("Popup", "save-name");
            });

            Open = TelmaCommandAssistant.Create("Open", async() =>
            {
                FileService.Component = ViewModel;
                await JSInterop.InvokeVoidAsync("Popup", "load-name");
            });
        }
 public SelectionMethodSection()
 {
     OnSetSelMethod   = TelmaCommandAssistant.Create("OnSetSelMethod", () => { lastmethod = Aggregator.SelectionMethod = SelectionMethods.Select; });
     OnSetUnselMethod = TelmaCommandAssistant.Create("OnSetUnselMethod", () => { lastmethod = Aggregator.SelectionMethod = SelectionMethods.Unselect; });
     OnSetInvMethod   = TelmaCommandAssistant.Create("OnSetInvMethod", () => { lastmethod = Aggregator.SelectionMethod = SelectionMethods.Inverse; });
 }
 public WorkModeSection()
 {
     OnSetSingleMode = TelmaCommandAssistant.Create("OnSetSingleMode", () => { Aggregator.SelectionMethod = SelectionMethods.Single; });
     OnSetGroupMode  = TelmaCommandAssistant.Create("OnSetGroupMode", () => { Aggregator.SelectionMethod = lastmethod; });
 }
 public SelectorSection()
 {
     OnSetPointSelector  = TelmaCommandAssistant.Create("OnSetPointSelector", () => { Aggregator.SelectorType = SelectorTypes.stPoint; });
     OnSetRectSelector   = TelmaCommandAssistant.Create("OnSetRectSelector", () => { Aggregator.SelectorType = SelectorTypes.stRectangle; });
     OnSetCircleSelector = TelmaCommandAssistant.Create("OnSetCircleSelector", () => { Aggregator.SelectorType = SelectorTypes.stCircle; });
 }