Composite ChildWindow as InteractionRequest

Topics: Prism v4 - Silverlight 4
Jul 20, 2011 at 8: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 1:45 AM
Edited Jul 21, 2011 at 1:59 AM

One solution I have been studying child containers in unity  eventing is very important part of prism


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

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

and using behaviors in 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  read the shared services  section





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

I am not familar with telerik this may help...