public OpenPackViewModel(TrackerFactory trackerFactory) { CommandSave = new RealyAsyncCommand <object>(CommandSaveExecute); this.trackerFactory = trackerFactory; settings = trackerFactory.GetService <ISettings>(); InitNewPack(); }
public OpeningPackStatsWindowViewModel(TrackerFactory trackerFactory) : base(trackerFactory) { cardImageService = trackerFactory.GetService <ICardImageService>(); winDialogs = trackerFactory.GetService <IWinDialogs>(); cardsDatabase = trackerFactory.GetService <ICardsDatabase>(); CommandExportToCsv = new RealyAsyncCommand <object>(CommandExportToCsvExecute); CommandOpenCsv = new RealyAsyncCommand <object>(CommandOpenCsvExcute); packSetFilter = AllFilter; }
public DeckEditViewModel(ITrackerFactory trackerFactory) { this.trackerFactory = trackerFactory; this.messanger = trackerFactory.GetService <IMessenger>(); messanger.Register <EditDeck>(this, EditDeckStart, EditDeck.Context.StartEdit); CommandSave = new RelayCommand(CommandSaveExecute); CommandCancel = new RelayCommand(CommandCancelExecute); CommandImport = new RealyAsyncCommand <object>(CommandImportExecute); CommandStartImportWeb = new RelayCommand(CommandStartImportWebExecute, CommandStartImportWebCanExecute); CommandImportWebCancel = new RelayCommand(CommandImportWebCancelExecute); CommandImportWeb = new RealyAsyncCommand <object>(CommandImportWebExecute, CommandImportWebCanExecute); }
public SettingsFormViewModel(IOrganizationServiceContextGenerator contextGenerator, ICompilerService compilerService, IConnectionStringService connectionStringService, Dispatcher dispatcher) { CommandGenerateDll = new RealyAsyncCommand <object>(GenerateDllClicked, CanGenerateDllClicked); CommandSelectDll = new RelayCommand(SelectDllClicked); CommandSelectClass = new RealyAsyncCommand <object>(SelectClassClicked, CanSelectClassClicked); CommandConfirmSettings = new RelayCommand <System.Windows.Window>(ConfirmSettingsClicked, ConfirmSettiingsCanExecute); CommandOpenGenerateDllLog = new RelayCommand(OpenGenerateDllLogClicked); CommandOpenCompileDllLog = new RelayCommand(OpenCompileDllLog); CommandCancelSettings = new RelayCommand <System.Windows.Window>(CancelSettingsClicked); CommandLoginToCrm = new RelayCommand(CommandLoginToCrmClicked); this.contextGenerator = contextGenerator; contextGenerator.OutputDataReceived += (sender, args) => { GeneratorOutput.AppendLine(args.Data); dispatcher.Invoke(DispatcherPriority.Normal, new System.Action(() => { RaisePropertyChangedEvent(nameof(GeneratorOutput)); } )); }; contextGenerator.ErrorDataReceived += (sender, args) => { GeneratorOutput.AppendLine(args.Data); dispatcher.Invoke(DispatcherPriority.Normal, new System.Action(() => { RaisePropertyChangedEvent(nameof(GeneratorOutput)); } )); }; this.compilerService = compilerService; this.connectionStringService = connectionStringService; }