/// <summary>
        /// Occurs when the reset font button is clicked.
        /// </summary>
        /// <param name="sender">The object where the event handler is attached.</param>
        /// <param name="e">The event data.</param>
        private void ResetFontClicked(object sender, RoutedEventArgs e)
        {
            var defaultTheme = ColorThemeData.CreateDefault();

            this.customTheme.FontFamily = defaultTheme.FontFamily;
            this.customTheme.FontSize   = defaultTheme.FontSize;

            var colorThemesDataSource = App.Current.Resources["colorThemesDataSource"] as ColorThemesDataSource;

            colorThemesDataSource.AddOrUpdate(this.customTheme);

            this.FontFamilyListBox.SelectedItem = this.customTheme.FontFamily;
            this.FontSizeSlider.Value           = this.customTheme.FontSize;

            TerminalPageForceRender(fontChanged: true);
        }
        /// <summary>
        /// Occurs when the reset colors button is clicked.
        /// </summary>
        /// <param name="sender">The object where the event handler is attached.</param>
        /// <param name="e">The event data.</param>
        private void ResetColorsClicked(object sender, RoutedEventArgs e)
        {
            var defaultTheme = ColorThemeData.CreateDefault();

            for (int i = -4; i < 16; i++)
            {
                this.customTheme.ColorTable[(ScreenColor)i] = defaultTheme.ColorTable[(ScreenColor)i];
            }

            var colorThemesDataSource = App.Current.Resources["colorThemesDataSource"] as ColorThemesDataSource;

            colorThemesDataSource.AddOrUpdate(this.customTheme);

            this.ScreenColorListBox_SelectionChanged(sender, null);

            TerminalPageForceRender(fontChanged: false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScreenDisplay"/> class.
        /// </summary>
        public ScreenDisplay()
        {
            this.rectangle = new Rectangle();
            this.border    = new Border()
            {
                Child = this.rectangle
            };

            this.border.BorderBrush     = new SolidColorBrush(Colors.Black);
            this.border.BorderThickness = new Thickness(2d);
            this.border.Background      = new SolidColorBrush(Colors.Black);

            this.Content = border;

            this.IsTabStop        = true;
            this.IsTapEnabled     = true;
            this.ManipulationMode = ManipulationModes.TranslateY | ManipulationModes.TranslateInertia;

            this.ColorTheme = ColorThemeData.CreateDefault();
            this.RecalculateFontMetrics();

            this.deviceManager = new DeviceManager();
        }