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);
     }
 }
Ejemplo n.º 3
0
 public void Init(INotificationControl view)
 {
     _view = view;
     if (_userSession.LoggedIn)
     {
         LoadData();
     }
 }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        // 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;
        }
Ejemplo n.º 7
0
 public void Init(INotificationControl view)
 {
     _view = view;
     if (_userSession.LoggedIn)
         _view.LoadData();
 }
Ejemplo n.º 8
0
 public static void Initmsger(INotificationControl userPreferencesImpl)
 {
     App.msger = userPreferencesImpl;
 }
Ejemplo n.º 9
0
 private UiManager(CoreDispatcher dispatcher, INotificationControl notification)
 {
     _dispatcher   = dispatcher;
     _notification = notification;
     _notification.NotificationPressed += _notification_NotificationPressed;
 }