Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3395328
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:16:36+00:00 2026-05-18T04:16:36+00:00

I have a custom control with bindings like below <DataTemplate DataType={x:Type vm:EditorTabViewModel}> <me:MarkdownEditor Options={Binding

  • 0

I have a custom control with bindings like below

<DataTemplate DataType="{x:Type vm:EditorTabViewModel}">
    <me:MarkdownEditor 
        Options="{Binding Path=Options, RelativeSource={RelativeSource AncestorType=Window}}" />
</DataTemplate>

I find that binding (Window1.Options) is being set (after stepping through code in debug mode), the markdown editor options (supposed to set Fonts, Colors etc) does not get set, or at least the UI does not update. I want to bug whats happening with in the MarkdownEditor.xaml.cs but thats another (referenced) project. How can I verify that the MarkdownEditor.Options is being set at least?

I have actually tested that the MarkdownEditor side is working by the below

<Window ...>
    <Grid>
        <Button Content="Options" Click="Button_Click" Grid.Row="0" />
        <me:MarkdownEditor Options="{Binding Options, RelativeSource={RelativeSource AncestorType=Window}}" Grid.Row="1" />
    </Grid>
</Window>

So the difference is the latter is a MarkdownEditor just in a Grid in a Window. The one failing is a MarkdownEditor within a TabControl bound to a ObservableCollection<TabViewModel>

Visual Studio Solution Replicating The Problem

I am not really good at explaining things, so a simple project I made up minus all the unnecessary noise uploaded to media fire so you can take a look at whats wrong

The video showing the problem on Screenr

With just a simple usage, editor in a window/grid.

the binding works ok

Then when used in conjunction with TabControl bound to ObservableCollection<EditorTabViewModel>, the binding works as shown in the 2 TextBoxes updating its values. but the editor does not update

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:16:37+00:00Added an answer on May 18, 2026 at 4:16 am

    After reading Kent Boogaart’s answer to this question I think that the right place to change SetValue to SetCurrentValue isn’t in the CLR Property but in the constructor for MarkDownEditor.

    public MarkdownEditor()
    {
        InitializeComponent();
        //Options = new MarkdownEditorOptions();
        this.SetCurrentValue(OptionsProperty, new MarkdownEditorOptions());
        DataContext = this;
    }
    

    In fact, this will work just as good without this.SetCurrentValue also since Options will be set through the Binding.

    To verify that your Binding has in fact been overwritten by SetValue you can add this code in some event for TabUsage (e.g PreviewMouseRightButtonDown for the FontSize TextBox) and the Binding will start to work again.

    private void TextBox_PreviewMouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
    {
        MarkdownEditor.MarkdownEditor editor = VisualTreeHelpers.GetVisualChild<MarkdownEditor.MarkdownEditor>(this);
        Binding binding = new Binding();
        binding.Path = new PropertyPath("Options");
        binding.Source = this;
        binding.Mode = BindingMode.TwoWay;
        editor.SetBinding(MarkdownEditor.MarkdownEditor.OptionsProperty, binding);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom control that has the following prototype. Type.registerNamespace('Demo'); Demo.CustomTextBox = function(element)
I have a custom user control with a textbox on it and I'd like
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a custom control that inherits from WebControl and implements IValidator, but I
I have a custom control that exposes a property. When I set it using
I have a custom control that shows a value obtained from the database (the
The background is I have a custom control that is a asp:Menu that is
For example, I have a custom control called SampleControl. To simplify things for this
I have a custom user control that contains asp:ValidationSummary . It is placed on
I have a custom server control with a property of Title. When using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.