public AppBusiness()
        {
            AppWindowViewModel appWindowViewModel = new AppWindowViewModel(riddles);

            AppWindow appWindow = new AppWindow();

            appWindow.DataContext = appWindowViewModel;
            appWindow.Show();
        }
Beispiel #2
0
        public async Task<bool> TryCloseAsync(AppWindowViewModel window)
        {
            window.IsBeingClosed = true;
            window.AppWindow.Close();

            while (!_isDisposed && !window.AppWindow.IsClosedOrHidden)
                await Task.Delay(CheckInterval).ConfigureAwait(false);

            return window.AppWindow.IsClosedOrHidden;
        }
Beispiel #3
0
        private void RemoveWindow(AppWindowViewModel window)
        {
            int index = _filteredWindowList.IndexOf(window);
            if (index < 0)
                return;

            if (lb.SelectedIndex == index)
            {
                if (_filteredWindowList.Count > index + 1)
                    lb.SelectedIndex++;
                else
                {
                    if (index > 0)
                        lb.SelectedIndex--;
                }
            }

            _filteredWindowList.Remove(window);
            _unfilteredWindowList.Remove(window);
        }
 public AppWindowView(AppWindowViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
 }
 public UIElement Create(AppWindowViewModel viewModel)
 {
     return(new AppWindowView(viewModel));
 }