16,019,768 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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).