Multiple Views

I want to have multiple views associated with a part and want to load different view in different scenarios. How I can do this?

Thanks

AllTec

[164 byte] By [AllTec] at [2008-2-21]
# 1

You can associate a view with a part by setting the attribute "ViewExtensionInfo", in the PartView.xaml.cs file set the fourth parameter to the your Part's PartViewContract:

[ViewExtensionInfo(DefaultViewTechnologies.WindowsPresentationFoundation, "PartView Title", "PartView Description", typeof(IAcropolisPart1ViewContract))]

Also, to load different view in different scenarios, you do so by setting the PartPane's PartViewType to the specified view.

For example, given a <SomePart> that has 2 views <SomePartView1> and <SomePartView2>, you can programatically set the PartPane.PartViewType to the view you want, or you can do this in XAML:

<PartPane Part="<SomePart>" PartViewType="{x:Type <SomePartView2>}/>

KathyKam at 2007-9-28 > top of Msdn Tech,.NET Development,Acropolis...

.NET Development

Site Classified