/// <summary> /// Initializes a new instance of the <see cref="MainWindow" /> class. /// </summary> public MainWindow() { DisplayName = "Default"; CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (sender1, args) => this.Close())); SelectPresetCommand = new RelayCommand<CameraPreset>(SelectPreset); DeletePresetCommand = new RelayCommand<CameraPreset>(DeletePreset, (o) => ServiceProvider.Settings.CameraPresets.Count > 0); LoadInAllPresetCommand = new RelayCommand<CameraPreset>(LoadInAllPreset); VerifyPresetCommand = new RelayCommand<CameraPreset>(VerifyPreset); ExecuteExportPluginCommand = new RelayCommand<IExportPlugin>(ExecuteExportPlugin); ExecuteToolPluginCommand = new RelayCommand<IToolPlugin>(ExecuteToolPlugin); InitializeComponent(); if (!string.IsNullOrEmpty(ServiceProvider.Branding.ApplicationTitle)) { Title = ServiceProvider.Branding.ApplicationTitle; } if (!string.IsNullOrEmpty(ServiceProvider.Branding.LogoImage) && File.Exists(ServiceProvider.Branding.LogoImage)) { BitmapImage bi = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block. bi.BeginInit(); bi.UriSource = new Uri(ServiceProvider.Branding.LogoImage); bi.EndInit(); Icon = bi; } _selectiontimer.Elapsed += _selectiontimer_Elapsed; _selectiontimer.AutoReset = false; }
public LoginViewModel() { this.Header = "登录"; this.Position = Position.Right; this.IsOpen = true; this.LoginCommand = new RelayCommand(()=>this.Login()); this._username = "******"; this._password = "******"; }
public BulbWnd() { CameraDevice = ServiceProvider.DeviceManager.SelectedCameraDevice; //NoAutofocus = true; AddCommand = new RelayCommand<IScriptCommand>(AddCommandMethod); EditCommand = new RelayCommand<IScriptCommand>(EditCommandMethod); DelCommand = new RelayCommand<IScriptCommand>(DelCommandMethod); InitializeComponent(); CaptureTime = 60; NumOfPhotos = 1; WaitTime = 0; PhdType = 0; PhdWait = 5; CountDown = 0; PhotoLeft = 0; AutomaticGuiding = false; _captureTimer.Elapsed += _captureTimer_Elapsed; _waitTimer.Elapsed += _waitTimer_Elapsed; ServiceProvider.Settings.ApplyTheme(this); }
public ClientWindow() { InitializeComponent(); DataContext = this; Client = new Client(); AddClient = new RelayCommand( delegate { Client.Password = PasswordBox.Password; Client.Enabled = true; DialogResult = true; this.Close(); }, delegate { return !string.IsNullOrEmpty(Client.Login) && !string.IsNullOrEmpty(PasswordBox.Password) && !string.IsNullOrEmpty(Client.Server); }); CloseWindow = new RelayCommand(delegate { Close();}); }
public ConfigViewModel() : base("Config") { //Server = "ELMINA\\SQLEXPRESS"; TryConnectCommand = new RelayCommand(TryConnect, CanTryConnect); }
private void SetCommands() { AddNewClient = new RelayCommand(AddNewClientExecuted); RemoveClient = new RelayCommand(RemoveClientExecuted, () => SelectedClient != null); }
private void SetCommands() { AddContact = new RelayCommand(AddContactExecuted, () => !string.IsNullOrEmpty(ContactName)); CloseWindow = new RelayCommand(Close); }