Firing 1 usercontrol used for 3 different window at page load with different data

Posted by Burledivya under VB.NET on 2/1/2010 | Views : 1103 | Status : [Member] | Replies : 1
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


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


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.


Posted by: Abhi2434 on: 2/1/2010 [Member] [Microsoft_MVP] [MVP] Silver

Do you want VirtualizationStackPanel.IsVirtualization = true?

I think using this will ensure that the page only loads control when it is visible.

Burledivya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response