public SettingsWindow( ISettingsViewModel viewModel) { InitializeComponent(); DataContext = this.viewModel = viewModel; }
public MainViewModel(IMainModel mainModel, ISettingsViewModel settingsViewModel, IDownloadsViewModel downloadsViewModel, ILogger logger) { if (mainModel == null) { throw new ArgumentNullException("mainModel"); } if (settingsViewModel == null) { throw new ArgumentNullException("settingsViewModel"); } if (downloadsViewModel == null) { throw new ArgumentNullException("downloadsViewModel"); } if (logger == null) { throw new ArgumentNullException("logger"); } this.mainModel = mainModel; this.settingsViewModel = settingsViewModel; this.downloadsViewModel = downloadsViewModel; this.logger = logger; }
public SettingsModule(ISettingsViewModel vm) : this() { DataContext = vm; _navigationContent = (FrameworkElement)FindResource("BackButton"); _navigationContent.DataContext = vm; }
public SettingsView(ISettingsViewModel viewModel) { _viewModel = viewModel; BindingContext = _viewModel; InitializeComponent(); }
public MainWindowViewModel(IEventAggregator eventAggregator, IParticipantListViewModel participantListViewModel, ISettingsViewModel settingsViewModel) : base(eventAggregator) { ParticipantListViewModel = participantListViewModel; SettingsViewModel = settingsViewModel; }
public SettingsWindow( ISettingsViewModel viewModel) { InitializeComponent(); DataContext = viewModel; }
public MainViewModel(INavigationService navigationService , IDialogService dialogService , ISymbolService symbolService , IHistoricalPriceViewModel historicalPriceViewModel , ISettingsViewModel settings) : base(navigationService, dialogService) { PriceViewModel = historicalPriceViewModel; Settings = settings; SearchSymbols = ReactiveCommand.CreateFromTask <object, ObservableCollection <BloombergSymbol> >(async _ => { IsLoading = true; var result = await symbolService.SearchSymbol(Keyword); IsLoading = false; return(new ObservableCollection <BloombergSymbol>(result)); }, this.WhenAny(x => x.Keyword, x => !string.IsNullOrEmpty(x.Value))); SearchSymbols.ThrownExceptions.Subscribe(ex => { Debug.WriteLine(ex.Message); IsLoading = false; }); OpenPrices = ReactiveCommand.Create <Unit, Unit>(_ => { SelectedSymbols = Symbols.Where(s => s.Selected); return(Unit.Default); }); _symbols = this.WhenAnyObservable(x => x.SearchSymbols) .ToProperty(this, x => x.Symbols); }
public ShellViewModel(IPresentationService presentationService, IShellSettingsService shellSettingsService, IEventAggregator eventAggregator, IMenuViewModel menu, ISettingsViewModel settings, ICodeGenSettingsService codeGenSettingsService, ICodeGenSettings codeGenSettings, IMessageService messageService, IMappingViewModel mapping, ISchemaService schemaService, ICustomSchemaSqlViewModel customSchemaSqlViewModel, ITemplateWriterService templateWriterService) { this._shellSettingsService = shellSettingsService; this._codeGenSettingsService = codeGenSettingsService; this._codeGenSettings = codeGenSettings; this._messageService = messageService; this._templateWriterService = templateWriterService; this.Menu = menu; this.Settings = settings; this.Mapping = mapping; this._schemaService = schemaService; this.CustomSchemaSqlViewModel = customSchemaSqlViewModel; this.WindowClosing = new Command <CancelEventArgs>(OnWindowClosing); this.WindowDrop = new Command <DragEventArgs>(OnWindowDrop); this.DisplayText = "IQToolkit CodeGen"; this.SetWindowPosition(presentationService); eventAggregator.GetEvent <LoadSchemaEvent>().Subscribe(this.LoadSchemaEventHandler); eventAggregator.GetEvent <GenerateFilesEvent>().Subscribe(_ => this.GenerateFilesEventHandler()); eventAggregator.GetEvent <CustomSchemaSqlViewVisibilityChangedEvent>().Subscribe(this.CustomSchemaSqlViewVisibilityChangedEvent); }
// TODO: Swap TemplatingViewModel for a TemplatingViewModelFactory // TODO: Swap SettingsViewModel for a SettingsViewModelFactory public MainWindowViewModel( IDataController dataController, ITemplatingViewModel templatingViewModel, ISettingsViewModel settingsViewModel, ISettingsManager settingsManager, IWindowService windowService, IDispatcherHelper dispatcherHelper) { IntegrityCheck.IsNotNull(dataController); IntegrityCheck.IsNotNull(templatingViewModel); IntegrityCheck.IsNotNull(settingsViewModel); IntegrityCheck.IsNotNull(settingsManager); IntegrityCheck.IsNotNull(windowService); IntegrityCheck.IsNotNull(dispatcherHelper); // Save arguments m_DataController = dataController; m_TemplatingViewModel = templatingViewModel; m_SettingsViewModel = settingsViewModel; m_SettingsManager = settingsManager; m_WindowService = windowService; m_DispatcherHelper = dispatcherHelper; // Initialise the state machine m_StateLock = new object(); m_StateMgr = new StateManager <MainWindowState>(this, typeof(Uninitialised)); // Configure commands/event handlers InitialiseCommands(); m_DataController.InitialisationComplete += DataController_InitialisationComplete; m_DataController.GetCaptureComplete += DataController_GetCaptureComplete; m_DataController.SaveTemplateComplete += DataController_SaveTemplateComplete; m_TemplatingViewModel.UserActionRequired += TemplatingViewModel_UserActionRequired; }
public SettingsView(ISettingsViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; DataContext = viewModel; }
public SettingsOverview(ISettingsViewModel viewmodel) { InitializeComponent(); ShouldClose = false; _viewmodel = viewmodel; this.Closing += SettingsOverview_Closing; this.Loaded += SettingsOverview_Loaded; }
/// <summary> /// The constructor initializes the ViewModel (and Model for the Viewmodel) /// as well as setting the data context /// </summary> public SettingsWindow() { InitializeComponent(); ISettingsModel model = new SettingsModel(); vm = new SettingsViewModel(model); this.DataContext = vm; }
private void OnClosing(object sender, EventArgs e) { ISettingsViewModel viewModel = (ISettingsViewModel)DataContext; viewModel.Closing -= OnClosing; Close(); }
public LoginMobileService(GeneralSettings settings, ISettingsViewModel settingsViewModel, ISyncMobileService syncMobileService, IUserRepository userRepository) { this.httpClient = App.Container.ResolveNamed <HttpClient>("api"); this.settings = settings; this.settingsViewModel = settingsViewModel; this.syncMobileService = syncMobileService; this.userRepository = userRepository; }
public GithubExplorerRibbon( ITaskPaneContentHost contentHost, ISettingsViewModel settingsViewModel, Func <ICreateIssueViewModel> createIssuesViewModelFactory) { this.contentHost = contentHost; this.settingsViewModel = settingsViewModel; this.createIssuesViewModelFactory = createIssuesViewModelFactory; }
public ShellViewModel(IMainViewModel mainViewModel, ISettingsViewModel settingsViewModel) { DisplayName = Constants.AppName; _mainViewModel = mainViewModel; _settingsViewModel = settingsViewModel; ActivateItem(mainViewModel); }
public GithubExplorerRibbon( ITaskPaneContentHost contentHost, ISettingsViewModel settingsViewModel, Func<ICreateIssueViewModel> createIssuesViewModelFactory) { this.contentHost = contentHost; this.settingsViewModel = settingsViewModel; this.createIssuesViewModelFactory = createIssuesViewModelFactory; }
/// <summary> /// Initializes a new instance of the DownloadMovieViewModel class. /// </summary> /// <param name="movieService">Instance of MovieService</param> /// <param name="settingsViewModel">Instance of SettingsViewModel</param> /// <param name="movieSettingsViewModel">Instance of MovieSettingsViewModel</param> public DownloadMovieViewModel(IMovieService movieService, ISettingsViewModel settingsViewModel, IMovieSettingsViewModel movieSettingsViewModel) { _movieService = movieService; _settingsViewModel = settingsViewModel; _cancellationDownloadingMovie = new CancellationTokenSource(); MovieSettings = movieSettingsViewModel; RegisterMessages(); RegisterCommands(); }
public MediaViewer(ISettingsViewModel viewmodel, IVideoPlayerController controller) { InitializeComponent(); ShouldClose = false; this.Closing += MediaViewer_Closing; this.Loaded += MediaViewer_Loaded; this.View.Video.MediaEnded += (sender, ee) => controller.PlayQueue(); _viewmodel = viewmodel; _viewmodel.PropertyChanged += SettingsChanged; }
public SettingsPage() { using (var scope = App.Container.BeginLifetimeScope()) { this.BindingContext = vm = scope.Resolve <ISettingsViewModel>(); } InitializeComponent(); apiUrl.Unfocused += (object sender, FocusEventArgs e) => { vm.OnApiUrlChange(); }; }
public ShellViewModel(IMainViewModel mainViewModel, ISettingsViewModel settingsViewModel) { DisplayName = "YouTube Downloader"; _settingsViewModel = settingsViewModel; settingsViewModel.Closed += (sender, e) => ChangeActiveItem(mainViewModel, false); ActivateItem(mainViewModel); }
public CameraSettingsViewModel(Logger logger) { Settings = new ISettingsViewModel[] { // Camera Time new SettingViewModel<CommandCameraSetTime>("Camera Time", SettingType.Single, new string[] {}, (command, value) => command.Set(DateTime.Now), camera => null, logger), // Camera Default Mode new SettingViewModel<CommandCameraDefaultMode>("Camera Default Mode", SettingType.Multi, EnumUtils.GetEnumValues<Mode>(), (command, value) => command.Select(EnumUtils.ParseValue<Mode>(value)), camera => camera.SettingsCache().OnDefault.ToString(), logger), // Camera Mode new SettingViewModel<CommandCameraMode>("Camera Mode", SettingType.Multi, EnumUtils.GetEnumValues<Mode>(), (command, value) => command.Select(EnumUtils.ParseValue<Mode>(value)), camera => camera.SettingsCache().Mode.ToString(), logger), // Camera Photo Resolution new SettingViewModel<CommandCameraPhotoResolution>("Photo Resolution", SettingType.Multi, EnumUtils.GetEnumValues<PhotoResolution>(), (command, value) => command.Select(EnumUtils.ParseValue<PhotoResolution>(value)), camera => camera.SettingsCache().PhotoResolution.ToString(), logger), // Camera Video Resolution new SettingViewModel<CommandCameraVideoResolution>("Video Resolution", SettingType.Multi, EnumUtils.GetEnumValues<VideoResolution>(), (command, value) => command.Select(EnumUtils.ParseValue<VideoResolution>(value)), camera => camera.ExtendedSettingsCache().VideoResolution.ToString(), logger), // Camera Time Lapse new SettingViewModel<CommandCameraTimeLapse>("Time Lapse", SettingType.Multi, EnumUtils.GetEnumValues<TimeLapse>(), (command, value) => command.Select(EnumUtils.ParseValue<TimeLapse>(value)), camera => camera.SettingsCache().TimeLapse.ToString(), logger), // Camera Burst Rate new SettingViewModel<CommandCameraBurstRate>("Burst Rate", SettingType.Multi, EnumUtils.GetEnumValues<BurstRate>(), (command, value) => command.Select(EnumUtils.ParseValue<BurstRate>(value)), camera => camera.ExtendedSettingsCache().BurstRate.ToString(), logger), // Camera Video Standard new SettingViewModel<CommandCameraVideoStandard>("Video Standard", SettingType.Multi, EnumUtils.GetEnumValues<VideoStandard>(), (command, value) => command.Select(EnumUtils.ParseValue<VideoStandard>(value)), camera => camera.SettingsCache().VideoStandard.ToString(), logger), // Camera Beep Sound new SettingViewModel<CommandCameraBeepSound>("Beep Sound", SettingType.Multi, EnumUtils.GetEnumValues<BeepSound>(), (command, value) => command.Select(EnumUtils.ParseValue<BeepSound>(value)), camera => camera.SettingsCache().BeepSound.ToString(), logger), // Camera Led Blink new SettingViewModel<CommandCameraLedBlink>("Led Blink", SettingType.Multi, EnumUtils.GetEnumValues<BeepSound>(), (command, value) => command.Select(EnumUtils.ParseValue<LedBlink>(value)), camera => camera.SettingsCache().LedBlink.ToString(), logger) }; }
public InstallArgumentProcessor( IProcessManager processManager, ISettingsViewModel settingsViewModel, IMaintenanceWindow maintenanceWindow, ILogger logger) { this.processManager = processManager; this.settingsViewModel = settingsViewModel; this.maintenanceWindow = maintenanceWindow; this.logger = logger; }
public SettingsView(ISettingsViewModel viewModel) { this.viewModel = viewModel; InitializeComponent(); DataContext = viewModel; ElementHost.EnableModelessKeyboardInterop(this); Show(); }
public SettingsView() { InitializeComponent(); // Get a reference to our view model, which has been set in XAML ViewModel = this.DataContext as ISettingsViewModel; if (ViewModel == null) { throw new NullReferenceException(); } }
public MainWindowViewModel( IWebApi webApi, IWindowManager windowManager, ISettingsViewModel settingsViewModel, IEventAggregator eventAggregator) { this.webApi = webApi; this.windowManager = windowManager; this.settingsViewModel = settingsViewModel; eventAggregator.SubscribeOnUIThread(this); }
public GeneralSettingsViewModel( ISettingsViewModel languageSettingsViewModel, ISettingsViewModel themeViewModel) { LanguageSettingsViewModel = languageSettingsViewModel; ThemeViewModel = themeViewModel; _settingsViewModels = new[] { languageSettingsViewModel, themeViewModel }; }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; }
public ClientAppService(IClientDialogService dialogService, ISettingsViewModel settingsViewModel, IRepository repository, IConnectViewModel connectViewModel, ILauncherService launcherService, IPaymentsCalculationViewModel paymentsCalculationViewModel) { SetState(ClientState.Initializing); _dialogService = dialogService; _settingsViewModel = settingsViewModel; _repository = repository; _connectViewModel = connectViewModel; _launcherService = launcherService; _paymentsCalculationViewModel = paymentsCalculationViewModel; _connectViewModel.InjectAppServiceAndInit(this); ClaimItems = new ObservableCollection <ClaimItemViewModel>(); _isClient = _repository.GetSettingValue <bool>(Settings.IsClient); }
/// <summary> /// Конструктор. /// </summary> /// <param name="settingsStorage">Хранилище настроек.</param> /// <param name="synchronizedDirectoriesManager">Менеджер синхронизируемых директорий.</param> /// <param name="rowViewModelFactory">Фабрика создания моделей представлений строк.</param> /// <param name="settingsViewModel">Модель представления окна настроек.</param> /// <param name="processScreenSaver">Объект, реализующий отображение заставки процесса.</param> public MainWindowViewModel(ISettingsStorage settingsStorage, ISynchronizedDirectoriesManager synchronizedDirectoriesManager, IRowViewModelFactory rowViewModelFactory, ISettingsViewModel settingsViewModel, IProcessScreenSaver processScreenSaver) { (_dispatcher, _processScreenSaver, _settingsStorage, _synchronizedDirectoriesManager, _settingsViewModel, _rowViewModelFactory) = (Dispatcher.CurrentDispatcher, processScreenSaver, settingsStorage, synchronizedDirectoriesManager, settingsViewModel, rowViewModelFactory); _synchronizedDirectoriesManager.AddSynchronizedDirectoriesEvent += AddSynchronizedDirectories; _synchronizedDirectoriesManager.RemoveSynchronizedDirectoriesEvent += RemoveSynchronizedDirectories; _rowViewModelFactory.AddRowEvent += AddRow; _rowViewModelFactory.DeleteRowEvent += DeleteRow; foreach (var row in _synchronizedDirectoriesManager.SynchronizedDirectories.Select(d => rowViewModelFactory.CreateRowViewModel(d))) { AddRow(null, row); } }
public NavigationContentViewModel(ISettingsViewModel settingsViewModel, IMessageBus bus) { _settingsViewModel = settingsViewModel; bus.Listen<AppUpdateAvailableMessage>().SubscribeOnceUI(_ => { ShowUpdate = true; }); bus.Listen<AppUpdateProgressMessage>().SubscribeUI(msg => { ShowProgress = true; ShowUpdate = false; ProgressValue = msg.ProgressPercentage; }); StartUpdateCommand = new ReactiveCommand(); bus.RegisterMessageSource(StartUpdateCommand.Select(c => new RequestAppUpdateMessage())); }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel, IKeyboardDominanceWatcher keyboardDominanceWatcher, IThreadDelay threadDelay) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; this.keyboardDominanceWatcher = keyboardDominanceWatcher; this.threadDelay = threadDelay; }
public NavigationContentViewModel(ISettingsViewModel settingsViewModel, IMessageBus bus) { _settingsViewModel = settingsViewModel; bus.Listen <AppUpdateAvailableMessage>().SubscribeOnceUI(_ => { ShowUpdate = true; }); bus.Listen <AppUpdateProgressMessage>().SubscribeUI(msg => { ShowProgress = true; ShowUpdate = false; ProgressValue = msg.ProgressPercentage; }); StartUpdateCommand = new ReactiveCommand(); bus.RegisterMessageSource(StartUpdateCommand.Select(c => new RequestAppUpdateMessage())); }
public PasteCombinationDurationMediator( IPasteDetectionHandler pasteDetectionHandler, IConsumerThreadLoop consumerLoop, ISettingsViewModel settingsViewModel, IThreadDelay threadDelay, IMainThreadInvoker mainThreadInvoker, ILogger logger, IKeyboardPasteCombinationStateService keyboardPasteState) { this.pasteDetectionHandler = pasteDetectionHandler; this.consumerLoop = consumerLoop; this.settingsViewModel = settingsViewModel; this.threadDelay = threadDelay; this.mainThreadInvoker = mainThreadInvoker; this.logger = logger; this.keyboardPasteState = keyboardPasteState; }
/// <summary> /// Constructor /// </summary> /// <param name="model">Model.</param> /// <param name="settingsViewModel">Settings viewModel.</param> public MultiPlayerGameViewModel(IMultiPlayerGame model, ISettingsViewModel settingsViewModel) { //Set members. this.mpModel = model; this.mpModel.ConnectionLost += HandleConnecionLost; this.mpModel.ReachedDestination += HandleReachedGoal; //Set property changed delefate. model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; model.ExitCalled += HandlExitCalled; }
public SettingsDialog(ISettingsViewModel vm, CushWindow owningWindow, DialogSettings settings) : base(owningWindow, settings) { DataContext = vm; InitializeComponent(); _originalScheme = new ColorScheme(this.ColorScheme); if (vm.ConfigFileHasPassword) InitializePassword(); //Apply.IsEnabled = false; var cvs = CollectionViewSource.GetDefaultView(FontCombo.ItemsSource); cvs.SortDescriptions.Clear(); cvs.SortDescriptions.Add(new SortDescription("Source", ListSortDirection.Ascending)); cvs.Refresh(); }
/// <summary> /// Constructor. /// </summary> /// <param name="singlePlayerModel">Model.</param> /// <param name="settingsViewModel">Settings viewModel.</param> public SinglePlayerGameViewModel(ISinglePlayerGame singlePlayerModel, ISettingsViewModel settingsViewModel) { this.singlePlayerModel = singlePlayerModel; this.settingsViewModel = settingsViewModel; this.singlePlayerModel.ConnectionLost += HandleConnectionLost; //Set property changed delegate. this.singlePlayerModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; this.singlePlayerModel.EnableControls += HandleEnable; }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel, IThreadDelay threadDelay, ITrayIconManager trayIconManager) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; this.threadDelay = threadDelay; this.trayIconManager = trayIconManager; }
public MainViewModel(IMainModel mainModel, ISettingsViewModel settingsViewModel, IDownloadsViewModel downloadsViewModel, ILogger logger) { if (mainModel == null) throw new ArgumentNullException("mainModel"); if (settingsViewModel == null) throw new ArgumentNullException("settingsViewModel"); if (downloadsViewModel == null) throw new ArgumentNullException("downloadsViewModel"); if (logger == null) throw new ArgumentNullException("logger"); this.mainModel = mainModel; this.settingsViewModel = settingsViewModel; this.downloadsViewModel = downloadsViewModel; this.logger = logger; }
/// <summary> /// Creates a new instance of this command. /// </summary> /// <param name="host">The hosting Window control</param> public SaveSettings(ISettingsViewModel host) { _host = host; }
public GithubExplorerRibbon(ISettingsViewModel settingsViewModel, ICreateIssueViewModel createIssuesViewModel) { this.settingsViewModel = settingsViewModel; this.createIssuesViewModel = createIssuesViewModel; }
public async Task SaveSettings(ISettingsViewModel settings) { var newSettings = new SelfWinSettings(settings.Url, settings.Port, settings.Username, settings.Password); SaveToApplicationData(newSettings); await ValidateSettings(); }
public SettingsWindowFactory( ISettingsViewModel viewModel) { this.viewModel = viewModel; }
public UnitTestSettings(ISettingsViewModel vm) : this() { DataContext = vm; }
public InspectionSettings(ISettingsViewModel vm) : this() { DataContext = vm; }
public GeneralSettings(ISettingsViewModel vm) : this() { DataContext = vm; }
public IndenterSettings(ISettingsViewModel vm) : this() { DataContext = vm; }
public SaveCommand(ISettingsViewModel settings) { _settings = settings; _settings.PropertyChanged += SettingsPropertyChanged; }