c# - How to set DataContext in a Dialog Window to its parent's DataContext -


itemprop = "text">

I created a new window which I call after using the following code:

  NieuwSimulatie NiewSimulatieWindow = New Investigation () {Master = this}; Bool? SimulatieAangemaakt = NiewSimulatieWindow.ShowDialog (); In the window "NieuwSimulatie" I want to do the same DataContext as in my MainWindow, or I try using RelativeSource I want to DataBind directly to Geuss DataContext, Ive tried Key:  
  & lt; Control: SplitButton X: Name = "ProjectNaam" DisplayMemberPath = "ProjectNaam" ItemsSource = "{Binding Static.Projecten, RelativeSource = {RelativeSource Mode = FindAncestor, AncestorType = Control: MetroWindow}}" />  

But it does not work.

Please help me fix my databanking or set the datacentax of my window in the data contact behind Meteindo.

I have access to your datacentech, from which you create your own window How to:

NeivaSlimatity News Simulativindo = New New Evaluation () {Owner = this, Datacontex = Your Data Constance; }; Bool? SimulatieAangemaakt = NiewSimulatieWindow.ShowDialog ();

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -