private void DisplayStripBackgroundContainer() { _stripBackgroundContainer = new StripBackgroundContainer(_firstImageFilePath, _invalidColor, _backgroundStrippingParams); _stripBackgroundContainer.StripBackgroundEvent += StripBackgroundHandler; BaseGrid.Children.Add(_stripBackgroundContainer); Grid.SetRow(_stripBackgroundContainer, 1); CancelButton.Content = "Cancel"; CancelButton.Visibility = Visibility.Visible; HelpButton.Visibility = Visibility.Visible; ScreenTypeStatusHelper.CurrentScreenTypesEnum = ScreenTypesEnum.BackgroundScreen; }
private void SetStripBackgroundParams(BackgroundStrippingParams @params) { _backgroundStrippingParams = @params; if (_stripBackgroundContainer != null) { BaseGrid.Children.Remove(_stripBackgroundContainer); _stripBackgroundContainer = null; } //check if click inputs can be deserialized from file var filePath = GetClickInputsFilePath(_folderPath); var deserialized = XmlSerializerHelper.Deserialize <ClickInputs>(filePath); if (deserialized != null) { SetClickInputs(deserialized); } else { DisplayClickCanvasContainer(_clickInputs); } }
private void Cancel(object sender, RoutedEventArgs e) { if (!ConfirmExit()) { return; } if (_stripBackgroundContainer != null) { //remove existing display BaseGrid.Children.Remove(_stripBackgroundContainer); _stripBackgroundContainer = null; if (_backgroundStrippingParams != null) { DisplayModelSettingsContainer(); } else { DisplaySelectFolderContainer(); } return; } if (_processContainer != null) { _processContainer.Cancel(); return; } if (_clickCanvasContainer != null) { //remove existing display BaseGrid.Children.Remove(_clickCanvasContainer); _clickCanvasContainer = null; if (_clickInputs != null) { DisplayModelSettingsContainer(); } else { DisplaySelectFolderContainer(); } return; } if (_modelSettingsContainer != null) { //remove existing display BaseGrid.Children.Remove(_modelSettingsContainer); _modelSettingsContainer = null; DisplaySelectFolderContainer(); return; } if (_modelContainer != null) { BaseGrid.Children.Remove(_modelContainer); _modelContainer = null; DisplaySelectFolderContainer(); return; } if (_autoConfigureSettingsContainer != null) { BaseGrid.Children.Remove(_autoConfigureSettingsContainer); _autoConfigureSettingsContainer = null; DisplayClickCanvasContainer(_clickInputs); return; } }