Click here to Skip to main content
15,894,720 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have multiple user control's in a window.Every User Control has a text box (txtGoodQty).On Double click of that text box opens a Window which has a data grid inside.I want to bind the user control's value to the data grid row.How can i achieve it using MVVM?
Can we use dependency property here, but i am not aware how to use it for binding.

What I have tried:

I did this
<TextBox.InputBindings>
               <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding DataContext.testmethod,
                                       RelativeSource={RelativeSource FindAncestor,
                                       AncestorType={x:Type UserControl}}}"/>
               <!--CommandParameter="{Binding .}"/>-->
           </TextBox.InputBindings>


and in the somemethod i called the show property of window.
But now I am stucked up with bindings of user control values to the datagrid row.
Posted
Updated 21-Mar-18 20:17pm

1 solution

I am somewhat confused about what you are trying to do, but you do have the CommandParameter with which to pass the control's value.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900