Exemple #1
0
        private void OnIsVisibleChanged(object sender,
                                        DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            IsVisibleChanged -= OnIsVisibleChanged;
            // This should work from XAML, but doesn't
            var fontFamilyBinding = new Binding("EditorFontFamily")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            FontCombo.SetBinding(FontComboBox.SelectedFontFamilyProperty, fontFamilyBinding);
            var fontSizeBinding = new Binding("EditorFontSize")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            FontCombo.SetBinding(FontComboBox.SelectedFontSizeProperty, fontSizeBinding);
            var encodingBinding = new Binding("EditorEncoding")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            EncodingComboBox.SetBinding(EncodingComboBox.SelectedEncodingProperty, encodingBinding);
            MarkdownEngine.IsEnabled = string.IsNullOrWhiteSpace(App.UserSettings.CustomMarkdownConverter);
        }
Exemple #2
0
        private void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            IsVisibleChanged -= OnIsVisibleChanged;
            var fontFamilyBinding = new Binding("EditorFontFamily")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            FontCombo.SetBinding(FontComboBox.SelectedFontFamilyProperty, fontFamilyBinding);
            var fontSizeBinding = new Binding("EditorFontSize")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            FontCombo.SetBinding(FontComboBox.SelectedFontSizeProperty, fontSizeBinding);
        }
Exemple #3
0
        public DisplaySettings()
        {
            InitializeComponent();
            DataContext = App.UserSettings;

            var fontFamilyBinding = new Binding("EditorFontFamily")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            FontCombo.SetBinding(FontComboBox.SelectedFontFamilyProperty, fontFamilyBinding);

            var fontSizeBinding = new Binding("EditorFontSize")
            {
                Source = DataContext, Mode = BindingMode.TwoWay
            };

            FontCombo.SetBinding(FontComboBox.SelectedFontSizeProperty, fontSizeBinding);
        }