Injecting of usercontrol (based on using VisualCollection) as a documentView

Topics: Prism v2 - WPF 3.5
Sep 16, 2009 at 12:11 PM

 Hi,

yesterday I just tried to inject an auto complete combo box functionality that I came across on AskErnest.com. It’s based on using VisualCollection that contains textBox and comboBox. If TextChanged on textbox occurs, following code is executing:

//open up the dropdownlist

cbWordList.IsDropDownOpen = true;

 

My question is if it’s possible to inject user controls based on  VisualCollection as a documentView ?

In my case ComboBox element is not shown if I try to inject that user control into a region...

Sep 18, 2009 at 10:12 PM

Hi

I have tried to reproduce the situation and was able to. Are you able to see the the control you created if you add it directly in XAML? (you can try this in a separate non-Prism project to be sure). I tried using the code provided in the post (both the instructions and the download) and was not able to see the view in either case. If adding the control in XAML directly works, please provide a small repro sample with Prism so we can try to solve your issue.

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Sep 21, 2009 at 12:54 PM
Edited Sep 21, 2009 at 2:07 PM

Hi Damian,

Thank you for your answering!

It happened to me to reproduce this issue within PRISM. However if I insert a UserControl into Window all works just fine.

Please find two enclosed solutions ( all is zipped as Test.zip)

at  http://rapidshare.com/files/283020750/Test.zip.html

BTW,  I added 5 words that starts with "car" to a sample collection behind this user control , so a combo box should  

go open if you are trying to type e.g. "car"...

 

Best regards,

Boris

Sep 24, 2009 at 9:34 PM

Hi Boris,

I opened both solutions you provided and they both worked (without any changes, just removing the breakpoints and pressing F5). The one using Prism did show the control in the Shell. You can find a picture with the outcome below:

I tested under two different development environments:

  • Windows Vista/Windows Server 2008
  • Visual Studio 2008 SP1

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Sep 25, 2009 at 11:47 AM

Hi Damian,

I'm confused because it's working on my dev box now,  too.  However I have XP SP2 , .NET 3.5 SP1 and Visual Studio 2008 Version 9.0.30729. 1 SP

May be it was a vs debugger isssue ? 

BTW, thanks a lot for looking into my issue!

Cheers, 

Boris