/// <summary> /// Initializes a new <see cref="MasterDetailViewModel"/> instance. /// </summary> /// <param name="model">The model providing the information about the controller.</param> /// <param name="moduleName">The name of the module the controller belongs to.</param> /// <param name="controllerCommander">The controller commander to interact with the controller.</param> /// <param name="states">The states of this view providing loading-content-error states.</param> public MasterDetailViewModel( Controller model, string moduleName, ICommandControllers controllerCommander, IProvideStatesForScreenActivation states) { _controller = model; _moduleName = moduleName; _controllerCommander = controllerCommander; _states = states; _changes = new BindableCollection <KeyValueChange>(); _actualValues = new BindableCollection <KeyValueUnitViewModel>(); _childs = new BindableCollection <MasterDetailViewModel>(); _command = new ActionCommand(ExecuteCommandOnController); _configurations = new BindableCollection <KeyValueUnitViewModel>(); _inputs = new BindableCollection <ForcingKeyValueUnitViewModel>(); //TODO: Rolf, please check this _inputs.CollectionChanged += InputsChanged; _outputs = new BindableCollection <ForcingKeyValueUnitViewModel>(); //TODO: Rolf, please check this _outputs.CollectionChanged += OutputsChanged; _parameters = new BindableCollection <KeyValueUnitViewModel>(); _logger = new Log4NetLogger(); _logger.Init(typeof(MasterDetailViewModel)); }
/// <summary> /// Initializes a new <see cref="GenericPlcViewModel"/> instance. /// </summary> public GenericPlcViewModel() { _states = new ScreenActivationNullObject(); _detailStates = new ScreenActivationNullObject(); _masterTree = new BindableCollection <MasterDetailViewModel>(); _sortOrder = 0; _importResultViewModel = new ImportExportResultNullObject(); _exportResultViewModel = new ImportExportResultNullObject(); }
public TestableGenericPlcViewModel( IProvidePlcInformation informationProvider, ICommandControllers controllerCommander, IProvideStatesForScreenActivation states, IProvideStatesForScreenActivation detailStates, ISaveToFileSystem saver, ILoadFromFileSystem loader, IAskUser askUser, IModuleScreen parent, string moduleName) : base(informationProvider, controllerCommander, states, detailStates, saver, loader, askUser, parent, moduleName, new NonDispatchingDispatcher()) { }
protected ShellBaseViewModel( IProvideStatesForScreenActivation states, ILogger logger, IEventAggregator eventAggregator) { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += UnhandledExceptionHandler; CacheViewsByDefault = true; _logger = logger; _logger.Info("starting Shell now..."); _states = states; _eventAggregator = eventAggregator; }
public ShellViewModel( IProvideStatesForScreenActivation states, IProvideInitializationState provideInitializationState, IEventAggregator eventAggregator, ILogger logger) : base(states, logger, eventAggregator) { _provideInitializationState = provideInitializationState; AppDomain currentDomain = AppDomain.CurrentDomain; CacheViewsByDefault = true; currentDomain.UnhandledException += UnhandledExceptionHandler; _states = states; _logger = logger; _logger.Init(GetType()); _logger.Info("starting Shell now..."); _eventAggregator = eventAggregator; Title = DefaultTitle + " (UI-SW-Ver. " + MosaicVersion + ")"; }
/// <summary> /// Initializes a new <see cref="GenericPlcViewModel"/> instance. /// </summary> /// <param name="informationProvider"> /// The information provider is mainly used to get information about the platform /// modules plc controllers, but it also provides some interaction possibilities with those controllers. /// </param> /// <param name="controllerCommander"> /// The controller commander provides functions to interact with a certain controller. /// This view model is responsible for creating <see cref="MasterDetailViewModel"/> instances which make /// use of the controller commander. /// </param> /// <param name="states"> /// The states represent the three main view states of the generic page (Loading - Content - Error) and /// provide functions to switch between those. /// </param> /// <param name="detailStates"> /// The detail states represent the three detail view states of the generic page (Loading - Content - Error) and /// provide functions to switch between those. /// </param> /// <param name="saver"> /// The saver provides the possibility to save a string to the filesystem, used by the export /// functionality of the generic page. /// </param> /// <param name="loader"> /// The loader provides the possibility to load a file from the filesystem, used by the import /// functionality of the generic page. /// </param> /// <param name="askUser"> /// The ask user instance can get used to interact with the user. /// </param> /// <param name="parent"> /// The view model of the parent screen is used to navigate back to it. /// </param> /// <param name="moduleName"> /// The module name identifies the module this view model is responsible for. /// </param> /// <param name="dispatcher"> /// The dispatcher is used to delegate all const-intensive operation to background threads and vice versa. /// </param> public GenericPlcViewModel( IProvidePlcInformation informationProvider, ICommandControllers controllerCommander, IProvideStatesForScreenActivation states, IProvideStatesForScreenActivation detailStates, ISaveToFileSystem saver, ILoadFromFileSystem loader, IAskUser askUser, IModuleScreen parent, string moduleName, IDispatcher dispatcher) : this() { _informationProvider = informationProvider; _controllerCommander = controllerCommander; _states = states; _detailStates = detailStates; _saver = saver; _loader = loader; _askUser = askUser; _moduleName = moduleName; _parenModuleScreen = parent; DisplayName = "Detail View"; }
public LoadingScreenViewModel(IProvideStatesForScreenActivation states) { _states = states; }