/// <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); ConfigurePluginCommand = new RelayCommand <AutoExportPluginConfig>(ConfigurePlugin); AddPluginCommand = new RelayCommand <IAutoExportPlugin>(AddPlugin); 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(PhotoUtils.GetFullPath(ServiceProvider.Branding.LogoImage)); bi.EndInit(); Icon = bi; } _selectiontimer.Elapsed += _selectiontimer_Elapsed; _selectiontimer.AutoReset = false; ServiceProvider.WindowsManager.Event += WindowsManager_Event; }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(ServiceProvider.Branding.StartupScreenImage) && File.Exists(ServiceProvider.Branding.StartupScreenImage)) { BitmapImage bi = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block. bi.BeginInit(); bi.UriSource = new Uri(PhotoUtils.GetFullPath(ServiceProvider.Branding.StartupScreenImage)); bi.EndInit(); background.Source = bi; } }