public override void Apply(UISettings settings) { settings.AlternateRowColor = Color.Gray; settings.BackgroundColor = Color.DarkSlateGray; settings.ForegroundColor= Color.LightGray; settings.HeaderBackColor = SystemColors.Menu; settings.HeaderForeColor= SystemColors.MenuText; settings.DockStripGradient.StartColor = Color.DarkSlateGray; settings.DockStripGradient.EndColor = Color.DarkSlateGray; settings.DockStripGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.ActiveTabGradient.StartColor = Color.LightGray; settings.ActiveTabGradient.EndColor = Color.LightGray; settings.ActiveTabGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.InactiveTabGradient.StartColor = Color.DarkSlateGray; settings.InactiveTabGradient.EndColor = Color.DarkSlateGray; settings.InactiveTabGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.ActiveCaptionGradient.StartColor = Color.LightGray; settings.ActiveCaptionGradient.EndColor = Color.LightGray; settings.ActiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.InactiveCaptionGradient.StartColor = Color.DarkSlateGray; settings.InactiveCaptionGradient.EndColor = Color.DarkSlateGray; settings.InactiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical; }
public override void Apply(UISettings settings) { settings.AlternateRowColor = SystemColors.Window; settings.BackgroundColor = SystemColors.Window; settings.ForegroundColor= SystemColors.WindowText; settings.HeaderBackColor = SystemColors.Menu; settings.HeaderForeColor= SystemColors.MenuText; settings.DockStripGradient.StartColor = SystemColors.Control; settings.DockStripGradient.EndColor = SystemColors.Control; settings.DockStripGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.ActiveTabGradient.StartColor = SystemColors.ControlLightLight; settings.ActiveTabGradient.EndColor = SystemColors.ControlLightLight; settings.ActiveTabGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.InactiveTabGradient.StartColor = SystemColors.ControlLight; settings.InactiveTabGradient.EndColor = SystemColors.ControlLight; settings.InactiveTabGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.ActiveCaptionGradient.StartColor = SystemColors.GradientActiveCaption; settings.ActiveCaptionGradient.EndColor = SystemColors.ActiveCaption; settings.ActiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical; settings.InactiveCaptionGradient.StartColor = SystemColors.GradientInactiveCaption; settings.InactiveCaptionGradient.EndColor = SystemColors.InactiveCaption; settings.InactiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical; }
public MapperSettings() { Paths = new PathSettings(); UI = new UISettings(); View = new ViewSettings(); Performance = new PerformanceSettings(); Paths.DataDirs = new List<string>(); Paths.DataFiles = new List<string>(); }
protected override void CalculateItemsSize() { if (ItemCount > 0) { List <int> sizes = new List <int>(); for (int i = 0; i < ItemCount; i++) { sizes.Add(UISettings.CalcPix(50) + _imageMargin); } CalculateItemSizeForListSize(Settings.ListItemPixSize, sizes); } else { CalculateItemSizeForListSize(Settings.ListItemPixSize, null); } }
/// <summary> /// Static constructor. /// </summary> static Settings() { SSOClientID = string.Empty; SSOClientSecret = string.Empty; UI = new UISettings(); G15 = new G15Settings(); Proxy = new ProxySettings(); Updates = new UpdateSettings(); Calendar = new CalendarSettings(); Exportation = new ExportationSettings(); MarketPricer = new MarketPricerSettings(); Notifications = new NotificationSettings(); LoadoutsProvider = new LoadoutsProviderSettings(); PortableEveInstallations = new PortableEveInstallationsSettings(); CloudStorageServiceProvider = new CloudStorageServiceProviderSettings(); EveMonClient.TimerTick += EveMonClient_TimerTick; }
// TODO: get this to reference string type private Color GetWeaponCellColor(WeaponType type) { UISettings uiSetting = GameManager.Instance.uiSettings; switch (type) { case WeaponType.Turrent: return(uiSetting.GetSpecifiedColor(CellColor.Red)); case WeaponType.Laser: return(uiSetting.GetSpecifiedColor(CellColor.Green)); case WeaponType.Launcher: return(uiSetting.GetSpecifiedColor(CellColor.Blue)); } return(Color.gray); }
internal static void Initialize() { ApplicationWindow = Window.Current; object savedTheme = ApplicationData.Current.LocalSettings.Values[SelectedAppThemeKey]; if (savedTheme != null) { if (Window.Current.Content is FrameworkElement rootElement) { rootElement.RequestedTheme = ElementThemeFromName(savedTheme.ToString()); } UpdateTitleBarButtonColors(); } uiSettings = new UISettings(); uiSettings.ColorValuesChanged += UiSettings_ColorValuesChanged; }
private static bool?GetSystemTheme() { var defaultTheme = new UISettings(); var uiTheme = defaultTheme.GetColorValue(UIColorType.Background).ToString(); switch (uiTheme) { case "#FF000000": return(false); case "#FFFFFFFF": return(true); default: return(null); } }
public SerializableSettings() { Plans = new List <SerializablePlan>(); Accounts = new List <SerializableAccount>(); Characters = new List <SerializableSettingsCharacter>(); MonitoredCharacters = new List <MonitoredCharacterSettings>(); APIProviders = new SerializableAPIProviders(); Notifications = new NotificationSettings(); Exportation = new ExportationSettings(); Scheduler = new SerializableScheduler(); Calendar = new CalendarSettings(); Updates = new UpdateSettings(); Proxy = new ProxySettings(); IGB = new IGBSettings(); G15 = new G15Settings(); UI = new UISettings(); }
public AcrylicBackdrop() { BlurAmount = 35; TintAlpha = 200; //Changes color to SystemChromeMediumColor for Light and Dark theme var DefaultTheme = new UISettings(); var uiTheme = DefaultTheme.GetColorValue(UIColorType.Background).ToString(); if (uiTheme == "#FF000000") { TintColor = Color.FromArgb(255, 31, 31, 31); } else if (uiTheme == "#FFFFFFFF") { TintColor = Color.FromArgb(255, 229, 229, 229); } }
private async void MetroWindow_Closing(object sender, CancelEventArgs e) { // allow cancelling exit to save changes if (!await _itemViewModel.ConfirmDiscardUnsavedChanges()) { e.Cancel = true; } var uiSettings = new UISettings { Width = Width, Height = Height, Left = Left, Top = Top }; UISettings.Save(uiSettings); }
private void HookListeners() { UnhookListeners(); CoreApplicationView view = CoreApplication.GetCurrentView(); _titleBar = view.TitleBar; _titleBar.LayoutMetricsChanged += TitleBar_LayoutMetricsChanged; _window = view.CoreWindow; _window.Activated += _window_Activated; _settings = new UISettings(); _settings.ColorValuesChanged += _settings_ColorValuesChanged; UpdateColors(); UpdateMetrics(_titleBar); }
/// <summary> /// Initializes a new instance of the <see cref="App"/> class. /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App(int session) { if (ApplicationSettings.Current.RequestedTheme != ElementTheme.Default) { RequestedTheme = ApplicationSettings.Current.RequestedTheme == ElementTheme.Dark ? ApplicationTheme.Dark : ApplicationTheme.Light; } #if DEBUG Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en"; #endif Locator.Configure(session); InitializeComponent(); _uiSettings = new UISettings(); m_mediaExtensionManager = new MediaExtensionManager(); m_mediaExtensionManager.RegisterByteStreamHandler("Unigram.Native.OpusByteStreamHandler", ".ogg", "audio/ogg"); InactivityHelper.Detected += Inactivity_Detected; UnhandledException += async(s, args) => { args.Handled = true; try { await new TLMessageDialog(args.Exception?.ToString() ?? string.Empty, "Unhandled exception").ShowQueuedAsync(); } catch { } }; #if !DEBUG HockeyClient.Current.Configure(Constants.HockeyAppId, new TelemetryConfiguration() { EnableDiagnostics = true, Collectors = WindowsCollectors.Metadata | WindowsCollectors.Session | WindowsCollectors.UnhandledException }); #endif }
private async void Window_Loaded(object sender, RoutedEventArgs e) { var uiSettings = UISettings.Load(); if (uiSettings != null) { Width = uiSettings.Width ?? Width; Height = uiSettings.Height ?? Height; Top = uiSettings.Top ?? Top; // only apply saved left pos if it's not off-screen double virtScreenWidth = System.Windows.SystemParameters.VirtualScreenWidth; if (uiSettings.Left < virtScreenWidth) { Left = uiSettings.Left ?? Left; } // set theme based on pref if (uiSettings.UITheme != null) { ((Certify.UI.App)App.Current).ToggleTheme(uiSettings.UITheme); } else { // default theme ((Certify.UI.App)App.Current).ToggleTheme(_appViewModel.DefaultUITheme); } if (uiSettings.Scaling > 0.5 && uiSettings.Scaling < 2) { _appViewModel.UIScaleFactor = uiSettings.Scaling ?? 1; } _appViewModel.UISettings = uiSettings; } else { // default theme ((Certify.UI.App)App.Current).ToggleTheme(_appViewModel.DefaultUITheme); } await PerformAppStartupChecks(); }
internal void Initialize() { UISettings.InitSettings(); try { DialogControl.InitializeDialogs(this); StatusDialogControl.InitializeDialogs(this); LoadingControl.InitializeDialogs(this); UpdateInfoDialogControl.InitializeDialogs(this); DebugHelper.WriteLogEntry("ScreenDPI = " + UISettings.ScreenDPI); try { if (UISettings.ScreenDPI <= 128) { _skinManager = new SkinManager(SystemConfiguration.AppInstallPath + "\\Skins", 96); _skinManager.LoadSkin("VKSkin96"); } else { _skinManager = new SkinManager(SystemConfiguration.AppInstallPath + "\\Skins", 192); _skinManager.LoadSkin("VKSkin192"); } } catch { MessageBox.Show(Resources.MasterForm_Initialize_SkinManagerLoadingException); DebugHelper.WriteLogEntry(Resources.MasterForm_Initialize_SkinManagerLoadingException); } if (!_skinManager.Initialized) { _skinManager.LoadSkin("Default"); } } catch (Exception) { MessageBox.Show(Resources.MasterForm_Initialize_SkinManagerDefaultLoadingException); DebugHelper.WriteLogEntry(Resources.MasterForm_Initialize_SkinManagerDefaultLoadingException); Application.Exit(); } }
private void Form1_Load(object sender, EventArgs e) { this.settings = UISettings.CreateSettings(); Order_Manager = new OrderManager(); Order_Manager.Poll(); foreach (Order O in Order_Manager.GetOrderList()) { Orders_ListBox.Items.Add(O); } DateTime now = DateTime.Now; SearchStart_Date.Value = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); SearchStart_Time.Value = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); SearchEnd_Date.Value = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); SearchEnd_Time.Value = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59); }
private void FormResize(object sender, EventArgs e) { loginLogo.Location = new Point((Width - loginLogo.Width) / 2, UISettings.CalcPix(23)); var bmp = new Bitmap(Width, Height); using (Graphics g = Graphics.FromImage(bmp)) { IntPtr hdc = g.GetHdc(); using (Gdi loginGdi = Gdi.FromHdc(hdc, new Rectangle(0, 0, Width, Height))) { loginGdi.GradientFill(ClientRectangle, Color.FromArgb(21, 70, 114), Color.FromArgb(78, 121, 161), FillDirection.TopToBottom); } g.ReleaseHdc(hdc); } BackgroundImage = bmp; //bmp.Dispose(); }
private void ShowMainPage(bool isWelcome) { ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.BackgroundColor = Colors.Transparent; titleBar.ButtonBackgroundColor = Colors.Transparent; titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; Frame rootFrame = Window.Current.Content as Frame; if (rootFrame == null) { rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { if (isWelcome) { ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(500, 400)); // min 192x48 max 500x500 ApplicationView.PreferredLaunchViewSize = new Size(500, 400); //min 500x320 ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; rootFrame.Navigate(typeof(WelcomePage)); } else { ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(530, 500)); ApplicationView.PreferredLaunchViewSize = new Size(530, 660); ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; rootFrame.Navigate(typeof(WhatsNewPage)); } } Window.Current.Activate(); UISettings uiSettings = new UISettings(); uiSettings.ColorValuesChanged += UiSettings_ColorValuesChanged; UiSettings_ColorValuesChanged(uiSettings, null); }
protected override void OnConnected() { base.OnConnected(); if (DesignMode.DesignModeEnabled) { return; } if (_settings == null) { _settings = new UISettings(); } if (_accessibilitySettings == null) { _accessibilitySettings = new AccessibilitySettings(); } if (_fastEffects == null) { _fastEffects = CompositionCapabilities.GetForCurrentView().AreEffectsFast(); } if (_energySaver == null) { _energySaver = PowerManager.EnergySaverStatus == EnergySaverStatus.On; } UpdateBrush(); // Trigger event on color changes (themes). Is also triggered for advanced effects changes. _settings.ColorValuesChanged -= ColorValuesChanged; _settings.ColorValuesChanged += ColorValuesChanged; _accessibilitySettings.HighContrastChanged -= AccessibilitySettings_HighContrastChanged; _accessibilitySettings.HighContrastChanged += AccessibilitySettings_HighContrastChanged; PowerManager.EnergySaverStatusChanged -= PowerManager_EnergySaverStatusChanged; PowerManager.EnergySaverStatusChanged += PowerManager_EnergySaverStatusChanged; CompositionCapabilities.GetForCurrentView().Changed -= CompositionCapabilities_Changed; CompositionCapabilities.GetForCurrentView().Changed += CompositionCapabilities_Changed; }
void OpenHeightToWidth(UISettings uiSettings, AnimationSettings animSettings) { if (!animSettings.heightOpen) { OpenHeight(uiSettings, animSettings); } else { OpenWidth(uiSettings, animSettings); } if (!animSettings2.heightOpen) { OpenHeight(uiSettings, animSettings); } else { OpenWidth(uiSettings, animSettings); } }
public IronworksSettings() { UI = new UISettings(); UI.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("UI", sender, name, value); }; Translator = new TranslatorSettings(); Translator.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Translator", sender, name, value); }; Chat = new ChatSettings(); Chat.Emote.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Emote@Chat", sender, name, value); }; Chat.Tell.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Tell@Chat", sender, name, value); }; Chat.Say.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Say@Chat", sender, name, value); }; Chat.Yell.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Yell@Chat", sender, name, value); }; Chat.Shout.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Shout@Chat", sender, name, value); }; Chat.Party.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Party@Chat", sender, name, value); }; Chat.Alliance.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Alliance@Chat", sender, name, value); }; Chat.LinkShell1.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell1@Chat", sender, name, value); }; Chat.LinkShell2.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell2@Chat", sender, name, value); }; Chat.LinkShell3.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell3@Chat", sender, name, value); }; Chat.LinkShell4.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell4@Chat", sender, name, value); }; Chat.LinkShell5.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell5@Chat", sender, name, value); }; Chat.LinkShell6.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell6@Chat", sender, name, value); }; Chat.LinkShell7.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell7@Chat", sender, name, value); }; Chat.LinkShell8.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("LinkShell8@Chat", sender, name, value); }; Chat.CWLinkShell1.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell1@Chat", sender, name, value); }; Chat.CWLinkShell2.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell2@Chat", sender, name, value); }; Chat.CWLinkShell3.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell3@Chat", sender, name, value); }; Chat.CWLinkShell4.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell4@Chat", sender, name, value); }; Chat.CWLinkShell5.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell5@Chat", sender, name, value); }; Chat.CWLinkShell6.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell6@Chat", sender, name, value); }; Chat.CWLinkShell7.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell7@Chat", sender, name, value); }; Chat.CWLinkShell8.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("CWLinkShell8@Chat", sender, name, value); }; Chat.FreeCompany.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("FreeCompany@Chat", sender, name, value); }; Chat.Novice.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Novice@Chat", sender, name, value); }; Chat.Echo.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Echo@Chat", sender, name, value); }; Chat.Notice.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Notice@Chat", sender, name, value); }; Chat.System.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("System@Chat", sender, name, value); }; Chat.Error.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Error@Chat", sender, name, value); }; Chat.NPCDialog.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("NPCDialog@Chat", sender, name, value); }; Chat.NPCAnnounce.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("NPCAnnounce@Chat", sender, name, value); }; Chat.MarketSold.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("MarketSold@Chat", sender, name, value); }; Chat.Recruitment.OnSettingsChanged += (sender, name, value) => { onSettingsChanged("Recruitment@Chat", sender, name, value); }; }
void OpenWidthToHeight(UISettings uiSettings, AnimationSettings animSettings) { if (!animSettings.widthOpen) { OpenWidth(uiSettings, animSettings); } else { OpenHeight(uiSettings, animSettings); } if (!animSettings2.widthOpen) { OpenWidth(uiSettings, animSettings); } else { OpenHeight(uiSettings, animSettings); } }
void OpenHeightAndWidth(UISettings uiSettings, AnimationSettings animSettings) { if (!animSettings.widthOpen) { OpenWidth(uiSettings, animSettings); } if (!animSettings.heightOpen) { OpenHeight(uiSettings, animSettings); } if (!animSettings2.widthOpen) { OpenWidth(uiSettings, animSettings); } if (!animSettings2.heightOpen) { OpenHeight(uiSettings, animSettings); } }
// 构造 /// <summary> /// 创建 UISettings 类的新默认实例。 /// </summary> public UISettingsWF() { UISettings = new UISettings(); UISettings.AdvancedEffectsEnabledChanged += (sender, args) => { UISettings = sender; AdvancedEffectsEnabledChanged?.Invoke(this, new EventArgs()); }; UISettings.ColorValuesChanged += (sender, args) => { UISettings = sender; ColorValuesChanged?.Invoke(this, new EventArgs()); }; UISettings.TextScaleFactorChanged += (sender, agrs) => { UISettings = sender; TextScaleFactorChanged?.Invoke(this, new EventArgs()); }; }
private void savedsettings() { try { UISettings uiColor = new UISettings(); gdRectfillColor.Background = new SolidColorBrush(uiColor.GetColorValue(UIColorType.AccentDark2)); MainGrid.Background = new SolidColorBrush(uiColor.GetColorValue(UIColorType.AccentDark3)); } catch (Exception) { gdRectfillColor.Background = UtilityData.ScrollBrush; } var titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBarColor = (Color)titleBar.BackgroundColor; UtilityClass.titlebar(scbBrush: (SolidColorBrush)gdRectfillColor.Background); _ucInAppPurchase.btIAPFixLicense.Background = gdRectfillColor.Background; if (UtilityData.isFluentDesign) { HeaderBrush = new AcrylicBrush { FallbackColor = ((SolidColorBrush)gdRectfillColor.Background).Color, TintColor = ((SolidColorBrush)gdRectfillColor.Background).Color, TintOpacity = 0.5, BackgroundSource = AcrylicBackgroundSource.Backdrop }; //SetAcrylicBackground(rpMain, 0.8); SetAcrylicBackground(gdRectfillColor, 0.7); SetAcrylicBackground(MainGrid, 0.6); _ucInAppPurchase.btIAPFixLicense.Background = gdRectfillColor.Background; } else { HeaderBrush = gdRectfillColor.Background; } if (vsgMain.CurrentState != null && vsgMain.CurrentState.Name == vsMobile.Name) { gdHeader.Background = HeaderBrush; } }
private void FormResize(object sender, EventArgs e) { Controller controllerUploadPhotoController; if (!NavigationService.Controllers.TryGetValue("UploadPhotoController", out controllerUploadPhotoController)) { return; } else { if (!NavigationService.Current().Equals(controllerUploadPhotoController)) { return; } } upcUploadPhotoMobile.Left = UISettings.CalcPix(5); upcUploadPhotoMain.Left = UISettings.CalcPix(5) + this.ClientRectangle.Width / 2; upcUploadPhotoMain.Width = upcUploadPhotoMobile.Width = this.ClientRectangle.Width / 2 - UISettings.CalcPix(10); if (this.ClientRectangle.Width > this.ClientRectangle.Height) { cmcPhotoDescription.Visible = false; lblVoidPhoto.Height = upcUploadPhotoMobile.Top - UISettings.CalcPix(10) - UISettings.CalcPix(45); } else { cmcPhotoDescription.Visible = true; lblVoidPhoto.Height = cmcPhotoDescription.Top - UISettings.CalcPix(10) - UISettings.CalcPix(45); } btnRotareImageClockwise.Top = btnRotareImageCounterclockwise.Top = lblVoidPhoto.Height / 2 + UISettings.CalcPix(45) - UISettings.CalcPix(32) / 2; ViewData["DisplayAreaWidth"] = lblVoidPhoto.Width; ViewData["DisplayAreaHeight"] = lblVoidPhoto.Height; ViewData["DisplayAreaLeft"] = lblVoidPhoto.Left; ViewData["DisplayAreaTop"] = lblVoidPhoto.Top; OnViewStateChanged("ActivateForm"); }
public void VerifyVisualStates() { UISettings settings = new UISettings(); if (!settings.AnimationsEnabled) { Log.Warning("Test is disabled when animations are turned off."); return; } VerifyVisualStates(ScrollBarVisibility.Auto, autoHideScrollControllers: true); VerifyVisualStates(ScrollBarVisibility.Visible, autoHideScrollControllers: true); // Non-auto-hiding ScrollControllers are only supported starting with RS4. if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone4)) { VerifyVisualStates(ScrollBarVisibility.Auto, autoHideScrollControllers: false); VerifyVisualStates(ScrollBarVisibility.Visible, autoHideScrollControllers: false); } }
private void UnhookListeners() { if (_settings != null) { _settings.ColorValuesChanged -= _settings_ColorValuesChanged; } _settings = null; if (_titleBar != null) { _titleBar.LayoutMetricsChanged -= TitleBar_LayoutMetricsChanged; } _titleBar = null; if (_window != null) { _window.Activated -= _window_Activated; } _window = null; }
public object Convert(object value, Type targetType, object parameter, string language) { ListViewItem item = (ListViewItem)value; ListView listView = ItemsControl.ItemsControlFromItemContainer(item) as ListView; // Get the index of a ListViewItem int index = listView.ItemContainerGenerator.IndexFromContainer(item); if (index % 2 == 0) { var color = new UISettings().GetColorValue(UIColorType.Accent); return(color); } else { var color = new UISettings().GetColorValue(UIColorType.AccentDark2); return(color); } }
private void HookListeners() { UnhookListeners(); CoreApplicationView view = CoreApplication.GetCurrentView(); _titleBar = view.TitleBar; _titleBar.LayoutMetricsChanged += TitleBar_LayoutMetricsChanged; _window = view.CoreWindow; _window.Activated += _window_Activated; _settings = new UISettings(); _settings.ColorValuesChanged += _settings_ColorValuesChanged; TemplateSettings.Messenger.Register <AppSettingsChangedMessage>(this, (o, m) => OnAppSettingsChanged(m)); UpdateColors(); UpdateMetrics(_titleBar); }
public static void UpdateTitleBar(bool isLeftMode) { CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = isLeftMode; ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; if (isLeftMode) { NavigationRootPage.Current.NavigationView.PaneDisplayMode = Microsoft.UI.Xaml.Controls.NavigationViewPaneDisplayMode.Auto; titleBar.ButtonBackgroundColor = Colors.Transparent; titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; } else { NavigationRootPage.Current.NavigationView.PaneDisplayMode = Microsoft.UI.Xaml.Controls.NavigationViewPaneDisplayMode.Top; var userSettings = new UISettings(); titleBar.ButtonBackgroundColor = userSettings.GetColorValue(UIColorType.Accent); titleBar.ButtonInactiveBackgroundColor = userSettings.GetColorValue(UIColorType.Accent); } }
AppWindow(IThemeManager themeManager, IImageManager imageManager, IAppSettings appSettings, ISettingsManager settingsManager, IFileTabManager fileTabManager, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandManager wpfCommandManager, IDecompilerManager decompilerManager) { this.assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly); this.uiSettings = new UISettings(settingsManager); this.uiSettings.Read(); this.appSettings = appSettings; this.stackedContent = new StackedContent <IStackedContentChild>(margin: new Thickness(6)); this.themeManager = themeManager; themeManager.ThemeChanged += ThemeManager_ThemeChanged; this.imageManager = imageManager; this.fileTabManager = fileTabManager; this.statusBar = new AppStatusBar(); this.appToolBar = appToolBar; this.mainWindowControl = mainWindowControl; this.wpfCommandManager = wpfCommandManager; this.decompilerManager = decompilerManager; this.mainWindowCommands = wpfCommandManager.GetCommands(ControlConstants.GUID_MAINWINDOW); this.mainWindowClosing = new WeakEventList <CancelEventArgs>(); this.mainWindowClosed = new WeakEventList <EventArgs>(); }
private async void UiSettings_ColorValuesChanged(UISettings sender, object args) { var backgroundColor = sender.GetColorValue(UIColorType.Background); var isDarkMode = backgroundColor == Colors.Black; await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; if (isDarkMode) { titleBar.ButtonForegroundColor = Colors.White; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(51, 255, 255, 255); } else { titleBar.ButtonForegroundColor = Colors.Black; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(51, 0, 0, 0); } }); }
void Start() { settings=GameObject.Find("GameController").GetComponent<UISettings>(); }
public abstract void Apply(UISettings settings);
AppWindow(IThemeManager themeManager, IImageManager imageManager, IAppSettings appSettings, ISettingsManager settingsManager, IFileTabManager fileTabManager, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandManager wpfCommandManager, ILanguageManager languageManager) { this.assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly); this.uiSettings = new UISettings(settingsManager); this.uiSettings.Read(); this.appSettings = appSettings; this.stackedContent = new StackedContent<IStackedContentChild>(margin: new Thickness(6)); this.themeManager = themeManager; themeManager.ThemeChanged += ThemeManager_ThemeChanged; this.imageManager = imageManager; this.fileTabManager = fileTabManager; this.statusBar = new AppStatusBar(); this.appToolBar = appToolBar; this.mainWindowControl = mainWindowControl; this.wpfCommandManager = wpfCommandManager; this.languageManager = languageManager; this.mainWindowCommands = wpfCommandManager.GetCommands(CommandConstants.GUID_MAINWINDOW); this.mainWindowClosing = new WeakEventList<CancelEventArgs>(); this.mainWindowClosed = new WeakEventList<EventArgs>(); this.appSettings.PropertyChanged += AppSettings_PropertyChanged; InitializeTextFormatterProvider(); }
AppWindow(ISettingsService settingsService, IDocumentTabService documentTabService, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandService wpfCommandService) { assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly); uiSettings = new UISettings(settingsService); uiSettings.Read(); stackedContent = new StackedContent<IStackedContentChild>(margin: new Thickness(6)); this.documentTabService = documentTabService; statusBar = new AppStatusBar(); this.appToolBar = appToolBar; this.mainWindowControl = mainWindowControl; this.wpfCommandService = wpfCommandService; mainWindowCommands = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); mainWindowClosing = new WeakEventList<CancelEventArgs>(); mainWindowClosed = new WeakEventList<EventArgs>(); }
public AppSettings() { uiSettings = new UISettings(); httpServerSettings = new HttpServerSettings(); }