public CloudExplorer()
        {
            InitializeComponent();
            this.DataContext = new CloudExplorerViewModel();
            this.Unloaded += (s,e) => Messenger.Default.Unregister(this);

            Messenger.Default.Register<NotificationMessageAction<bool>>(this,
                message =>
                {
                    if (message.Notification.Equals(Messages.PushApp))
                    {
                        var view = new Views.Push();
                        Window parentWindow = Window.GetWindow(this);
                        view.Owner = parentWindow;
                        var result = view.ShowDialog();
                        message.Execute(result.GetValueOrDefault());
                    }
                });

            Messenger.Default.Register<NotificationMessageAction<bool>>(this,
                message =>
                {
                    if (message.Notification.Equals(Messages.UpdateApp))
                    {
                        var view = new Views.Update();
                        Window parentWindow = Window.GetWindow(this);
                        view.Owner = parentWindow;
                        var result = view.ShowDialog();
                        message.Execute(result.GetValueOrDefault());
                    }
                });

            Messenger.Default.Register<NotificationMessageAction<bool>>(this,
                message =>
                {
                    if (message.Notification.Equals(Messages.Progress))
                    {
                        var view = new Views.ProgressDialog();
                        Window parentWindow = Window.GetWindow(this);
                        view.Owner = parentWindow;
                        var result = view.ShowDialog();
                        message.Execute(result.GetValueOrDefault());
                    }
                });

            Messenger.Default.Register<NotificationMessageAction<bool>>(this,
                message =>
                {
                    if (message.Notification.Equals(Messages.Preferences))
                    {
                        var view = new ManageClouds();
                        Window parentWindow = Window.GetWindow(this);
                        view.Owner = parentWindow;
                        bool? result = view.ShowDialog();
                        message.Execute(result.GetValueOrDefault());
                    }
                });
        }
示例#2
0
        public CloudExplorer()
        {
            InitializeComponent();
            this.DataContext = new CloudExplorerViewModel();
            this.Unloaded   += (s, e) => Messenger.Default.Unregister(this);

            Messenger.Default.Register <NotificationMessageAction <bool> >(this,
                                                                           message =>
            {
                if (message.Notification.Equals(Messages.PushApp))
                {
                    var view            = new Views.Push();
                    Window parentWindow = Window.GetWindow(this);
                    view.Owner          = parentWindow;
                    var result          = view.ShowDialog();
                    message.Execute(result.GetValueOrDefault());
                }
            });

            Messenger.Default.Register <NotificationMessageAction <bool> >(this,
                                                                           message =>
            {
                if (message.Notification.Equals(Messages.UpdateApp))
                {
                    var view            = new Views.Update();
                    Window parentWindow = Window.GetWindow(this);
                    view.Owner          = parentWindow;
                    var result          = view.ShowDialog();
                    message.Execute(result.GetValueOrDefault());
                }
            });

            Messenger.Default.Register <NotificationMessageAction <bool> >(this,
                                                                           message =>
            {
                if (message.Notification.Equals(Messages.Progress))
                {
                    var view            = new Views.ProgressDialog();
                    Window parentWindow = Window.GetWindow(this);
                    view.Owner          = parentWindow;
                    var result          = view.ShowDialog();
                    message.Execute(result.GetValueOrDefault());
                }
            });

            Messenger.Default.Register <NotificationMessageAction <bool> >(this,
                                                                           message =>
            {
                if (message.Notification.Equals(Messages.Preferences))
                {
                    var view            = new ManageClouds();
                    Window parentWindow = Window.GetWindow(this);
                    view.Owner          = parentWindow;
                    bool?result         = view.ShowDialog();
                    message.Execute(result.GetValueOrDefault());
                }
            });
        }