c# - How to set DataContext in a Dialog Window to its parent's DataContext -
I created a new window which I call after using the following code: But it does not work. Please help me fix my databanking or set the datacentax of my window in the data contact behind Meteindo.
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}}" />
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
Post a Comment