public override async Task Show()
        {
            var toInstalls = ComponentStorage.GetInstallableComponents()
                             .Where(item => ComponentStorage.GetValue(item.Key))
                             .ToList();

            int oneBasedIndex = 1;
            int count         = toInstalls.Count;

            foreach (var toInstall in toInstalls)
            {
                control.LeftText = $"Installing {oneBasedIndex}/{count}: " + toInstall.Name + "\nPlease wait...";

                var result = await toInstall.Install();

                if (result != 0)
                {
                    MessageBox.Show("Failed to install " + toInstall.Name);
                }

                oneBasedIndex++;
            }

            // If it's finished, go to the next page:
            OnNextClicked();
        }
Ejemplo n.º 2
0
        private void CreateComponentsListBox()
        {
            var listView = CreateListView();

            ViewModels = new List <ComponentViewModel>();

            foreach (var component in ComponentStorage.GetInstallableComponents())
            {
                var viewModel = new ComponentViewModel();
                viewModel.IsSelected  = true;
                viewModel.BackingData = component;
                ViewModels.Add(viewModel);
            }

            listView.ItemsSource         = ViewModels;
            listView.HorizontalAlignment = HorizontalAlignment.Stretch;
            listView.VerticalAlignment   = VerticalAlignment.Stretch;
            base.RightPanel.Children.Add(listView);
        }