By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,665 Members | 1,900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,665 IT Pros & Developers. It's quick & easy.

Firing 1 user control used for 3 different windows at page load with different data

P: 2
Hi Every one,

Iam Divya working as developer. I had some issues. In my 2 years this is the first forum i saw which is very active in posting the answers. I hope you could solve this also.

Here is my app description:
We are following Model -View -View Model Pattern for WPF Window Project. I have an Window (contains only an XamData Grid) Which is complete User control.
This User Control is used in 3 windows(Male Window, Female, Child) Under 3 tabs.

These 3 windows displays different window data in the grid on Page Load . the type of data(male data, female data, Child data) in grid depends on below navigation path .

Children Window--------------->>child ID,stage ID (parameters)------>> Child tab open----->> diplay Child data

Gents Window -------------->> case ID, male ID( parameters)---------->>Male tab open----->> display Male data

Ladies Window----------------->>pass id, birth id, job id(parametsr)---------->>Female tab open ----->> display Female data.


I have one View -- that is Usercontrol with Xam data grid ( having 12 columns). All the 3 windows have the same columns but different data is displayed in page load ( depends on different navigation which passes diiferent parameters for each window to display.

I have only one view model--

#Region "Constructors"
Public Sub New(ByVal context As WInfoContext)
ContextInfo = context

' This loads data on page .

mUnitList = GetUnitList()

End Sub


#EndRegion

HomePage.VB (from here the windows are launched)
Private Sub UnitListClick(ByVal sender As Object, ByVal e As Navigation)

Dim target As New WindowLaunch()

With target

.ContentType = GetType(UnitListView)



End With

e.NewContentInfo = target

e.NewContentBehavior = ContentLoadBehavior.NewWindow

End Sub



Home.XAML:

This page contains a XAMDATAGRID and left navigation links/tabs. By selecting the stage or case(depending on the selected stage of male /female/child ,it displays that particular window through left navigation/tabs


How to display different window data on diffrent tabs page loads. I have only 1 constructor in View model. How does this works?? How to invoke my single constructor for 3 window displays. I heard that this forum is having full of dotnet experts. Please let me know if you need any more data.


Thanking you in advance.
Feb 1 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.