public MainWindow() { InitializeComponent(); Title = Title.Put(LocalizedStrings.Str3200); Loaded += OnLoaded; _dataTimer = ThreadingHelper .Timer(OnDataTimer) .Interval(TimeSpan.FromMilliseconds(1)); Theme.SelectedIndex = 1; SeriesEditor.Settings = new CandleSeries { CandleType = typeof(TimeFrameCandle), Arg = TimeSpan.FromMinutes(1) }; ConfigManager.RegisterService <IMarketDataProvider>(_testMdProvider); ConfigManager.RegisterService <ISecurityProvider>(_securityProvider); Theme.ItemsSource = DXTheme.Themes.Where(t => t.ShowInThemeSelector); ThemeExtensions.ApplyDefaultTheme(); }
private void TemaToggleButton_Unchecked(object sender, RoutedEventArgs e) { Theme theme = (Theme)ResourceDictionaryExtensions.GetTheme(Application.Current.Resources); ThemeExtensions.SetBaseTheme(theme, Theme.Light); ResourceDictionaryExtensions.SetTheme(Application.Current.Resources, theme); }
public MainWindow() { string exeFolder = MainService.GetProgramFolder(); Config.Set("plugin-directory", exeFolder); Config.Set("composer-dll-directory", exeFolder); InitializeComponent(); ThemeExtensions.DefaultTheme = ThemeExtensions.DefaultLightTheme; ThemeExtensions.ApplyDefaultTheme(); }
private void DarkModeToggleButton_OnClick(object sender, RoutedEventArgs e) { PaletteHelper paletteHelper = new PaletteHelper(); ITheme theme = paletteHelper.GetTheme(); ThemeExtensions.SetBaseTheme(theme, DarkModeToggleButton.IsChecked == true ? Theme.Dark : Theme.Light); paletteHelper.SetTheme(theme); AppPref.Default.DarkTheme = DarkModeToggleButton.IsChecked ?? false; AppPref.Default.Save(); }
public LoginWindow() { InitializeComponent(); (DataContext as LoginViewModel).CloseWindow = this.Close; (DataContext as LoginViewModel).IsValidFunc = IsValid; PaletteHelper paletteHelper = new PaletteHelper(); ITheme theme = paletteHelper.GetTheme(); ThemeExtensions.SetBaseTheme(theme, AppPref.Default.DarkTheme ? Theme.Dark : Theme.Light); paletteHelper.SetTheme(theme); }
/// <summary> /// Changes the MahApps accent of this pane based on the Color Theme. /// </summary> /// <remarks> /// The Steel accent will be used on all themes, except for the DarkGray /// theme, which will use the Teal accent. /// </remarks> /// <param name="updatedColorTheme">The new color theme</param> public void OnThemeChanged(ColorTheme updatedColorTheme) { // The Steel accent doesn't look good on the DarkGray background. // The closest accent that looks okay is Teal. switch (updatedColorTheme.ThemeId) { case ColorTheme.DARK_GRAY: ThemeExtensions.ChangeMahAppsAccent(this, "Teal"); break; default: ThemeExtensions.ChangeMahAppsAccent(this, "Steel"); break; } }
public MainWindow() { this.DataContext = new MainWindowVistaModelo(); InitializeComponent(); if ((DataContext as MainWindowVistaModelo).CompruebaModoOscuro()) { Theme theme = (Theme)ResourceDictionaryExtensions.GetTheme(Application.Current.Resources); ThemeExtensions.SetBaseTheme(theme, Theme.Dark); ResourceDictionaryExtensions.SetTheme(Application.Current.Resources, theme); } else { Theme theme = (Theme)ResourceDictionaryExtensions.GetTheme(Application.Current.Resources); ThemeExtensions.SetBaseTheme(theme, Theme.Light); ResourceDictionaryExtensions.SetTheme(Application.Current.Resources, theme); } }
public MainWindow() { InitializeComponent(); Title = Title.Put(LocalizedStrings.Str3200); Loaded += OnLoaded; _dataTimer = ThreadingHelper .Timer(OnDataTimer) .Interval(TimeSpan.FromMilliseconds(1)); SeriesEditor.Settings = new CandleSeries { CandleType = typeof(TimeFrameCandle), Arg = TimeSpan.FromMinutes(1) }; ConfigManager.RegisterService <ISubscriptionProvider>(_testProvider); ConfigManager.RegisterService <ISecurityProvider>(_securityProvider); ThemeExtensions.ApplyDefaultTheme(); }
public DashboardWindow() { InitializeComponent(); MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight; MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth; (DataContext as DashboardViewModel).MoveCursorMenu = MoveCursorMenu; (DataContext as DashboardViewModel).CloseWindowAction = Close; PaletteHelper paletteHelper = new PaletteHelper(); ITheme theme = paletteHelper.GetTheme(); DarkModeToggleButton.IsChecked = AppPref.Default.DarkTheme; ThemeExtensions.SetBaseTheme(theme, DarkModeToggleButton.IsChecked == true ? Theme.Dark : Theme.Light); paletteHelper.SetTheme(theme); if (Application.Current.Resources.GetThemeManager() is { } themeManager) { themeManager.ThemeChanged += (_, e) => { DarkModeToggleButton.IsChecked = e.NewTheme?.GetBaseTheme() == BaseTheme.Dark; }; } }
private void ThemeSwitchClick(object sender, RoutedEventArgs e) { ThemeExtensions.Invert(); }
public static void LoginView(this ViewPage pg) { pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "LoginForm")); }
public static void UserSummaryView(this ViewMasterPage pg) { pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "UserSummaryDisplay")); }
public static void ProductDetailView(this ViewPage pg) { pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "ProductDetailDisplay")); }
public static void CategoryListView(this ViewPage pg) { pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "CategoryListDisplay")); }
public static void ProductListView(this ViewPage pg, IList <Product> data) { pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "ProductList"), data); }