/// <inheritdoc /> public void Track(IContainerStatus containerStepStatus) { if (_stepStatuses.TryGetValue(containerStepStatus.Step.StepNumber, out var subStepStatuses)) { subStepStatuses.Add(containerStepStatus.Status); } else { _stepStatuses.Add(containerStepStatus.Step.StepNumber, new List <StepStatus>(new [] { containerStepStatus.Status })); } }
public MainViewModel(IContainerStatus containerStatus, IMediator mediator, SettingsManager settingsManager) { _settingsManager = settingsManager; mediator.Register(this); SettingsCommand = new DelegateCommand(ExecuteSettingsCommand); if (_settingsManager.Settings.CheckUpdatesOnLaunch) containerStatus.ContainerLoaded += () => UpdateCheck(true); ScreenChangeVisible = true; }
public ImportViewModel(IVisualStateManager visualStateManager, IContainerStatus containerStatus, IMediator mediator) { _visualStateManager = visualStateManager; _mediator = mediator; Videos = new ImportCollection(); NextCommand = new DelegateCommand(ExecuteNextCommand); TargetCommand = new DelegateCommand(ExecuteTargetCommand); AddCommand = new DelegateCommand(ExecuteAddCommand); SelectedQuality = QualityList[0]; FileImport = true; containerStatus.ContainerUnloaded += ContainerClosed; }
public void Add(string header, string id, object content, bool searchBox) { //----------------------------------------------------------------- // The new accordion section is build using an Expander // Expander expanderToAdd = new Expander(); // Set dynamic reference to style so theme can be switched. expanderToAdd.SetResourceReference(FrameworkElement.StyleProperty, "AccordionExpander"); expanderToAdd.Name = id; expanderToAdd.IsExpanded = false; expanderToAdd.Margin = new Thickness(0, 0, 0, 3); // The expander header is a Grid with 2 columns Grid expanderHeader = new Grid(); expanderHeader.Name = "MyHeader"; ColumnDefinition col1 = new ColumnDefinition(); expanderHeader.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); expanderHeader.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); //----------------------------------------------------------------- // First column contains the Title of the accordion section // TextBlock headerText = new TextBlock(); headerText.Text = header; Grid.SetColumn(headerText, 0); expanderHeader.Children.Add(headerText); //----------------------------------------------------------------- // Second column contains the "Quick-Filter" control // if (searchBox) { QuickFilterControl qf = new QuickFilterControl(); qf.FilterValueChanged += new QuickFilterControl.QuickFilterValueChanged(OnFilterValueChanged); qf.Name = nameIdOfQuickFilter; qf.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; qf.VerticalAlignment = System.Windows.VerticalAlignment.Center; Grid.SetColumn(qf, 1); expanderHeader.Children.Add(qf); qf.Visibility = System.Windows.Visibility.Collapsed; } else { IContainerStatus iCS = content as IContainerStatus; if (iCS != null) { TextBlock tb = new TextBlock(); tb.Name = nameIdOfStatusControl; tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; tb.TextAlignment = TextAlignment.Right; tb.VerticalAlignment = System.Windows.VerticalAlignment.Center; tb.Margin = new Thickness(5, 0, 0, 0); tb.Visibility = System.Windows.Visibility.Visible; Grid.SetColumn(tb, 1); expanderHeader.Children.Add(tb); iCS.SetTextBlock(tb); } } //----------------------------------------------------------------- // Set the expander header to be this new Grid we just created expanderToAdd.Header = expanderHeader; //----------------------------------------------------------------- // Now set the content of the expander // expanderToAdd.Content = content as UIElement; expanderToAdd.Expanded += new RoutedEventHandler(OnExpanderExpanded); expanderToAdd.Collapsed += new RoutedEventHandler(OnExpanderCollapsed); expanderToAdd.SizeChanged += new SizeChangedEventHandler(OnExpanderToAdd_SizeChanged); //----------------------------------------------------------------- // Add a new row to contain the new Accordion section // this.MainGrid.RowDefinitions.Count(); RowDefinition rd = new RowDefinition(); rd.Height = new GridLength(1, GridUnitType.Auto); this.MainGrid.RowDefinitions.Add(rd); // and the new Expender to the Accordion Section int lastRow = this.MainGrid.Children.Add(expanderToAdd); Grid.SetRow(expanderToAdd, lastRow); }