Пример #1
0
        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();
        }
Пример #2
0
        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);
        }
Пример #3
0
        public MainWindow()
        {
            string exeFolder = MainService.GetProgramFolder();

            Config.Set("plugin-directory", exeFolder);
            Config.Set("composer-dll-directory", exeFolder);

            InitializeComponent();
            ThemeExtensions.DefaultTheme = ThemeExtensions.DefaultLightTheme;
            ThemeExtensions.ApplyDefaultTheme();
        }
Пример #4
0
        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();
        }
Пример #5
0
        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);
        }
Пример #6
0
        /// <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;
            }
        }
Пример #7
0
 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);
     }
 }
Пример #8
0
        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();
        }
Пример #9
0
        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;
                };
            }
        }
Пример #10
0
 private void ThemeSwitchClick(object sender, RoutedEventArgs e)
 {
     ThemeExtensions.Invert();
 }
Пример #11
0
 public static void LoginView(this ViewPage pg)
 {
     pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "LoginForm"));
 }
Пример #12
0
 public static void UserSummaryView(this ViewMasterPage pg)
 {
     pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "UserSummaryDisplay"));
 }
Пример #13
0
 public static void ProductDetailView(this ViewPage pg)
 {
     pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "ProductDetailDisplay"));
 }
Пример #14
0
 public static void CategoryListView(this ViewPage pg)
 {
     pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "CategoryListDisplay"));
 }
Пример #15
0
 public static void ProductListView(this ViewPage pg, IList <Product> data)
 {
     pg.Html.RenderPartial(ThemeExtensions.TemplatedLink(pg.ViewContext, "ProductList"), data);
 }