Click here to Skip to main content
15,903,012 members

Comments by Member 10558493 (Top 4 by date)

Member 10558493 23-Jul-14 19:31pm View    
anyone?

help!
Member 10558493 21-Jul-14 15:34pm View    
Pretty sure not - in any event the data from the main window is displaying in the User Control textbox (tbx1). What I cannot seem to do is access the text in that textbox from the View Model, SetupViewModel.cs. Note, the UC1 dependency property is in the user control code behind, SetupUC.cs. (All posts I have found indicate that DP's should be defined in the code behind and not the VM).
Member 10558493 15-Jul-14 19:24pm View    
Sorry guys, this isn't the solution, but I wasn't able to put all the code snippets in as a "comment"...
Member 10558493 15-Jul-14 19:15pm View    
Deleted
I have just started C# programming could you provide more details...example?

On my end, here is a little more detail:

Main Window XAML:
<uc:deliverycontrol uc1="{Binding Path=ContainerData, Mode=TwoWay}">

User Control XAML (i.e. DeliveryControl):
<textbox x:name="tbxConDat" horizontalalignment="Left" height="23" margin="641,443,0,0" textwrapping="Wrap" text="{Binding UC1, ElementName=root}" verticalalignment="Top" width="120" focusable="False" isenabled="False" textchanged="tbxConDat_TextChanged" rendertransformorigin="0.408,19.783" visibility="Hidden">

User Control Code Behind:
<pre lang="cs">public static readonly DependencyProperty UC1Property = DependencyProperty.Register("UC1", typeof(string),

typeof(DeliveryControl), new PropertyMetadata((string)""));



public string UC1

{

get { return (string)GetValue(UC1Property); }

set

{

SetValue(UC1Property, value);

}

}



public static readonly DependencyProperty UCESIProperty = DependencyProperty.Register("UCESI", typeof(string),

typeof(DeliveryControl), new PropertyMetadata((string)""));</pre>

This all works fine except that I cannot access the data/value in UC1 from the View Model of the User Control (DeliveryControl).