void SelectDispatcher (TActionComponent component) { Model.Select (component); if (FrameworkElementView.FindName ("DisplayControl") is TComponentDisplayControl control) { control.RefreshDesign (); } ApplyChanges (); }
void SelectDispatcher (TActionComponent component) { component.ThrowNull (); Model.Select (component); if (FrameworkElementView.FindName ("DisplayControl") is Shared.Gadget.Material.TComponentDisplayControl control) { control.RefreshDesign (); } ApplyChanges (); }
void SelectDispatcher (Tuple<TActionComponent, Dictionary<Guid, GadgetMaterial>> tuple) { if (tuple.NotNull ()) { Model.Select (tuple.Item1, tuple.Item2); } if (FrameworkElementView.FindName ("DisplayControl") is TComponentDisplayControl control) { control.RefreshDesign (); } ApplyChanges (); }
void ShowSnackbarDispatcher (bool shutdown = false) { Task.Factory.StartNew (() => { Thread.Sleep (500); }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default). ContinueWith (t => { if (FrameworkElementView.FindName ("MainSnackbar") is MaterialDesignThemes.Wpf.Snackbar bar) { bar.MessageQueue.Enqueue (Model.SnackbarContent.Message); } if (shutdown) { TDispatcher.Invoke (ShutdownDispatcher); } }, TaskScheduler.FromCurrentSynchronizationContext () ); }
void CloseSnackbarDispatcher () { if (FrameworkElementView.FindName ("SnackbarActive") is System.Windows.Controls.CheckBox box) { box.IsChecked = false; } }