Ejemplo n.º 1
0
        private async void MenuItem_Click_toClose(object sender, RoutedEventArgs e)
        {
            var windows = lb.SelectedItems.Cast <AppWindowViewModel>().ToList();

            foreach (var win in windows)
            {
                bool isClosed = await _windowCloser.TryCloseAsync(win);

                if (isClosed)
                {
                    RemoveWindow(win);
                }
            }

            if (lb.Items.Count == 0)
            {
                HideWindow();
            }
        }
Ejemplo n.º 2
0
        private async void CloseWindow(object sender, ExecutedRoutedEventArgs e)
        {
            if (lb.Items.Count > 0)
            {
                var win = (AppWindowViewModel)lb.SelectedItem;
                if (win != null)
                {
                    bool isClosed = await _windowCloser.TryCloseAsync(win);

                    if (isClosed)
                    {
                        RemoveWindow(win);
                    }
                }
            }
            else
            {
                HideWindow();
            }
            e.Handled = true;
        }
Ejemplo n.º 3
0
        private async void CloseWindow(object sender, ExecutedRoutedEventArgs e)
        {
            var windows = lblProgramName.SelectedItems.Cast <AppWindowViewModel>().ToList();

            foreach (var win in windows)
            {
                bool isClosed = await _windowCloser.TryCloseAsync(win);

                if (isClosed)
                {
                    RemoveWindow(win);
                }
            }

            if (lblProgramName.Items.Count == 0)
            {
                HideWindow();
            }

            e.Handled = true;
        }
Ejemplo n.º 4
0
        private async Task CloseWindow()
        {
            if (lb.Items.Count > 0)
            {
                var win = (AppWindowViewModel)lb.SelectedItem;
                if (win != null)
                {
                    bool isClosed = await _windowCloser.TryCloseAsync(win);

                    if (isClosed)
                    {
                        RemoveWindow(win);
                    }
                    else
                    {
                        win.AppWindow.SwitchToLastVisibleActivePopup();
                    }
                }
            }
            else
            {
                HideWindow();
            }
        }