Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

Created Issue: [2.0.1513] Exception in BindingHelper.cs [15686]

$
0
0
As you can see in the code below, i use 2 models with the property "Text". The DataContext outside the DockingManager is set to VMMain, inside to VMChild. In BindingHelper.cs at line 52 dependencyObject.ClearValue() clears the inner DataContext and the trys to bind to the "Text"-property of VMMain. Because this property is readonly, it can't be bound in "two way"-mode and an exception is thrown. I think, the ClearValue-Line isn't necessary, because BindingOperations.SetBinding should reset the bindings already, but i'm not sure about that.
























public class VMChild
{
public string Text { get; set; }
}
public class VMMain
{
private VMChild _child = new VMChild();

public VMChild Child
{
get { return this._child; }
}

public string Text { get; private set; }
}


public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();

this.DataContext = new VMMain();
}
}

Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>