Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 Silverlight4 MVVM
Hi All,
 
I need to make a textbox control visible in one of my silverlight screens based on the selection done in 1st screen.
 
I'm using MVVM. How to make textbox control visible in 3rd screen based on the state selected in 1st screen.
For eg., the requirement is like, If I select NewYork in my first screen, based on this entry, I need to collapse the textbox visibility in 3rd screen if state is newyork.
 
Please help on this by providing your suggestions.
 
Thanks
Posted 24-Jul-12 0:08am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Quickly I have two ideas.
The first one correspond to a Silverlight page:
You can add a parameter in your querystring (on your first screen page) in your silverlight application. In the other Page you get the value of the querystring variable.
 
The second solution, if you use usercontrol, is more simple:
You need to pass the parameter (city for eg.) of the first screen, inside the constructor of the second screen.
 
public SecondScreen(int cityID)
{
   InitializeComponent();
 
   //Do something with the cityID
   ...
}
Hope it helps. Smile | :)
  Permalink  
Comments
Kranthi Boppana at 25-Jul-12 3:22am
   
Thanks for your reply
I couldn't get focus on constructors for Viewmodels or Xaml.cs files.These constructors triggers only while loading silverlight app. so I cannot access Querystring value
Christian Amado at 25-Jul-12 6:48am
   
How do you navigate on your application? Between pages or between usercontrols? Just to clarify the situation.

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

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 210
2 BillWoodruff 205
3 Jochen Arndt 180
4 DamithSL 165
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 24 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100