Beispiel #1
0
        private void InitializeApplicationControl(IApplicationInfo info)
        {
            var button = new ActionCenterApplicationButton(info);

            button.Button.Click      += (o, args) => Clicked?.Invoke();
            ApplicationName.Text      = info.Name;
            ApplicationButton.Content = button;
        }
        private void InitializeApplicationControl()
        {
            var button = new ActionCenterApplicationButton(application.Info);

            application.InstanceStarted += Application_InstanceStarted;
            button.Clicked           += (o, args) => application.Start();
            ApplicationName.Text      = application.Info.Name;
            ApplicationButton.Content = button;
        }
        private void RemoveInstance(ActionCenterApplicationButton button)
        {
            Dispatcher.InvokeAsync(() =>
            {
                InstancePanel.Children.Remove(button);

                if (InstancePanel.Children.Count == 0)
                {
                    ApplicationName.Visibility   = Visibility.Collapsed;
                    ApplicationButton.Visibility = Visibility.Visible;
                }
            });
        }
        private void Application_InstanceStarted(IApplicationInstance instance)
        {
            Dispatcher.InvokeAsync(() =>
            {
                var button = new ActionCenterApplicationButton(application.Info, instance);

                button.Clicked      += (o, args) => instance.Activate();
                instance.Terminated += (_) => RemoveInstance(button);
                InstancePanel.Children.Add(button);

                ApplicationName.Visibility   = Visibility.Visible;
                ApplicationButton.Visibility = Visibility.Collapsed;
            });
        }
Beispiel #5
0
        public void RegisterInstance(IApplicationInstance instance)
        {
            Dispatcher.Invoke(() =>
            {
                var button = new ActionCenterApplicationButton(info, instance);

                button.Clicked      += (id) => Clicked?.Invoke(id);
                instance.Terminated += (id) => Instance_OnTerminated(id, button);
                InstancePanel.Children.Add(button);

                ApplicationName.Visibility   = Visibility.Visible;
                ApplicationButton.Visibility = Visibility.Collapsed;
            });
        }