public void AddNotificationControl(INotificationControl control) { if (control is UIElement uiElement) { NotificationStackPanel.Children.Add(uiElement); } }
public void AddNotificationControl(INotificationControl control) { if (control is UIElement uiElement) { ControlPanel.Children.Insert(ControlPanel.Children.Count - 2, uiElement); } }
public void Init(INotificationControl view) { _view = view; if (_userSession.LoggedIn) { LoadData(); } }
private async void Clicked() { IDialogCommand response = await Model.WindowManager.ShowDialog(new DialogViewModel("You clicked me!", "Do you like what you are seeing?", DialogCommand.Yes, DialogCommand.No)); string title = response.Label == DialogCommand.Yes.Label ? "Hooray!" : "Oh well..."; string message = response.Label == DialogCommand.Yes.Label ? "I'm glad you like it." : "I wonder how I can improve?"; INotificationControl control = Model.WindowManager.Notify(new Message(title, message)); control.AutoHideAfter(TimeSpan.FromSeconds(5)); control.AutoCloseAfter(TimeSpan.FromSeconds(15)); }
// This should only be called from the UI control that owns the InAppNotification public static UiManager Create(CoreDispatcher dispatcher, INotificationControl notification) { lock (s_uiManagersLock) { if (s_uiManagers.ContainsKey(dispatcher)) { throw new InvalidOperationException("UiManager.Create should only be called once per dispatcher"); } var manager = new UiManager(dispatcher, notification); s_uiManagers[dispatcher] = manager; return(manager); } }
public void RegisterNotification(INotificationControl notification) { this.notification = notification; notification.Clicked += Notification_Clicked; }
public void Init(INotificationControl view) { _view = view; if (_userSession.LoggedIn) _view.LoadData(); }
public static void Initmsger(INotificationControl userPreferencesImpl) { App.msger = userPreferencesImpl; }
private UiManager(CoreDispatcher dispatcher, INotificationControl notification) { _dispatcher = dispatcher; _notification = notification; _notification.NotificationPressed += _notification_NotificationPressed; }