示例#1
0
 public MainWindowViewModel(
     IEventAggregator eventAggregator,
     ITextLocalization textLocalization)
 {
     _eventAggregator = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator));
     TextLocalization = textLocalization ?? throw new ArgumentNullException(nameof(textLocalization));
 }
        public FunctionGraphView(ITextLocalization textLocalization)
        {
            _textLocalization = textLocalization ?? throw new ArgumentNullException(nameof(textLocalization));
            InitializeComponent();

            if (DataContext is IFunctionsContainer functionsContainer)
            {
                _functionsContainer = functionsContainer;
                _functionsContainer.FunctionsDefined += FunctionsContainerOnFunctionsDefined;
            }
        }
示例#3
0
        public MenuViewModel(
            IEventAggregator eventAggregator,
            IFileSystemService fileSystemService,
            IProjectService projectService,
            IMessageService messageService,
            ITextLocalization textLocalization)
        {
            _eventAggregator   = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator));
            _fileSystemService = fileSystemService ?? throw new ArgumentNullException(nameof(fileSystemService));
            _projectService    = projectService ?? throw new ArgumentNullException(nameof(projectService));
            _messageService    = messageService ?? throw new ArgumentNullException(nameof(messageService));
            _textLocalization  = textLocalization ?? throw new ArgumentNullException(nameof(textLocalization));

            NewCommand  = new DelegateCommand(ExecuteNewCommand);
            OpenCommand = new DelegateCommand(ExecuteOpenCommand);
            SaveCommand = new DelegateCommand(ExecuteSaveCommand, CanExecuteSaveCommand);
            ExitCommand = new DelegateCommand(ExecuteExitCommand);

            _eventAggregator.GetEvent <AnyChangeMadeEvent>().Subscribe(AnyChangeMadeMessageReceived);
            _eventAggregator.GetEvent <AppClosingEvent>().Subscribe(AppClosingEventReceived);
        }