Composite ChildWindow as InteractionRequest

Topics: Prism v4 - Silverlight 4
Jul 20, 2011 at 7:31 PM

Hi there,

 

   recently ive been working on a silverlight project which was based heavily on popup ChildWindows. We've decided to use prism. Ive studied samples of interaction requests and how to separate visual and logical part of our popup child window mechanism but ive encountered a few problems. We had some main tab region and there were registered main views from each module. After some user input a popup window came out and user was able to setup some properties. My question is how can i use Microsoft.Practices.Prism.Interactivity.InteractionRequest for my custom popup ChildWindow so i can modify content of a childwindow in a runtime but this window must be closable from within content context. Next thing i need standard ValidationSummary and for example BusyIndicator as a standard predefined part of this ChildWindow UI but source of validation summary and busy indicator value must came from content assigned to a childwindow. ive made a few tweaks and its looks akward to me but they worked. ->

<telerik:RadBusyIndicator IsBusy="{Binding Content.DataContext.IsBusy, ElementName=contentControl}">

As you can see IsBusy property is bound to Content and underlying DataContext which contain IsBusy property on contentControl object within this xaml :-) As ive stated before it seems little bit weird and i am looking for a better solution since i dont like ElementName or named controls within the xaml. Is there any other way how to do this?

And another important things is if i close this popup child window and reopen it silverlight end up with error describing i am trying to add the same visual controls which exists somewhere else.

 

Thank you for any ideas and sorry for my bad english.

Jul 21, 2011 at 12:45 AM
Edited Jul 21, 2011 at 12:59 AM

One solution I have been studying child containers in unity http://www.pnpguidance.net/Post/UnityNestedContainersIUnityParentContainerCreateChildContainer.aspx

http://development-guides.silverbaylabs.org/Video/Prism-Eventing  eventing is very important part of prism

http://weblogs.asp.net/rashid/archive/2009/03/05/use-event-aggregator-to-make-your-application-more-extensible.aspx

http://compositewpf.codeplex.com/discussions/211908

http://www.dotnetcurry.com/ShowArticle.aspx?ID=699

http://csharperimage.jeremylikness.com/2009/09/decoupled-childwindow-dialogs-with.html

http://blogs.infosupport.com/blogs/alexb/archive/2011/02/21/silverlight-4-creating-useful-base-classes-for-your-views-and-viewmodels-with-prism.aspx

http://forums.silverlight.net/t/231347.aspx/2/10

 

Jul 21, 2011 at 2:56 AM
Edited Jul 21, 2011 at 3:08 AM

http://msdn.microsoft.com/en-us/library/gg405494(v=PandP.40).aspx#UserInteractionPatterns

your answer is really found under interaction requests, It mentions publish subscribe  which is event aggregator in prism   

and using behaviors in prism

http://mokosh.co.uk/?tag=/prism this is another useful tool

you could I suppose use shared services it uses mef, service locator pattern as well

service locator is registered  inside the xaml   http://blogs.msdn.com/b/bobbrum/archive/2010/11/22/prism-4-in-silverlight-with-mef-compositioninitializer.aspx  read the shared services  section

 

 

 

 

Jul 21, 2011 at 3:16 AM
Edited Jul 21, 2011 at 3:21 AM

http://www.dotnetpatterns.net/content/185-Silverlight-4.0-Prism-4.0-Telerik-Ribbon-Application-Template

I am not familar with telerik this may help...  http://www.telerik.com/community/forums/wpf/busy-indicator/radbusyindicator-not-showing-in-mvvm-app.aspx

http://weblogs.asp.net/fredriknormen/archive/2009/11/30/silverlight-4-mvvm-with-commanding-and-wcf-ria-services.aspx