Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Bind Parent dialog to a Command

$
0
0

Hello all,

I need help on the following matter :

My View contains a simple tree and a button. The user selects a node in the tree and clicks the button.

The call is forwarded to the ViewModel class via a Command. The command uses the selected node, makes some computations and then has to close the dialog. 

I want to be able to pass also the parent dialog as parameter to the ViewModel in order to be able to close the dialog, but i don't know how to do a multi binding in the XAML code :

This is button code :

<Button Content="Select signal" 
Command="{Binding SelectSignalCommand}"                     
CommandParameter="{Binding SelectedItem, ElementName=treeViewSignals}" /> 

Can you help me please ? 

I want to mention that i tried different approaches for closing the dialog (with Action Delegates, external commands and events), but because my code is running as a plug-in that code is not working so i am trying to use a brute force approach.



Viewing all articles
Browse latest Browse all 18858

Trending Articles



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