public void Import() { try { ModelSetting importingSetting = _rep.Setting.SingleOrDefault(); CurrentAppTheme = importingSetting.CurrentAppTheme; CurrentAppAccent = importingSetting.CurrentAppAccent; PathToFolderFiles = importingSetting.PathToFolderFiles; AllTimeOff = importingSetting.AllTimeOff.Value.TimeOfDay; IsBackgroundImage = importingSetting.IsBackgroundImage; IsTransperentTile = importingSetting.IsTransperentTile; IsKioskMode = importingSetting.IsKioskMode; PathToLicense = importingSetting.PathToLicense; NumberLeftMonitor = importingSetting.NumberLeftMonitor; NumberRightMonitor = importingSetting.NumberRightMonitor; TimeAdvertising = importingSetting.TimeAdvertising.Value.TimeOfDay; if (IsBackgroundImage) { App.MainWnd.Background = PersonalizationHelper.BitmapFromPath(App.PathToBackgroundImage); } PersonalizationHelper.SetStyleTile(IsTransperentTile); } catch (Exception ex) { App.SendException(ex); } }
private void Btn_SaveChanges_Click(object sender, RoutedEventArgs e) { if ((bool)BackgroundImageToggle.IsChecked) { if (TB_OpenFileImage.Text != string.Empty) { ChangeBackgroundToNewImage(TB_OpenFileImage.Text); } else if (File.Exists(App.PathToBackgroundImage)) { ChangeBackgroundToOldImage(); } else { MessageBox.Show("Выберете изображение"); } } else { App.Setting.IsBackgroundImage = false; App.MainWnd.Background = App.Current.Resources["ColorBackground"] as SolidColorBrush; } App.Setting.IsTransperentTile = (bool)ThemeTile.IsChecked; PersonalizationHelper.SetStyleTile(App.Setting.IsTransperentTile); App.Setting.Export(); App.Frame.Navigate(new StartUpPage()); }