Assembly reference and Independent

Jul 24, 2011 at 8:47 AM
Edited Jul 24, 2011 at 8:53 AM

Hello Michael,

first, congrats for your idea about Independent class... in fact it reminds me sort of C++ objects classes which have something similar...

Anyway I was trying those UpdateControls following your video tutorial... I installed the .msi file then I opened VS2010, entered into Add-in Manager and enabled UpdateControls.

Then I created a new WPF application (framework .NET 4.0 Client profile) and added UpdateControls.XAML.dll reference to project's references. Then I created a new folder Model and I created in there a Person class and after created first variables I executed Generate Independent Properties so it created all those properties. Then I compiled to see if it was all ok and it returned this message indeed: The type or namespace name 'Independent' could not be found (are you missing a using directive or an assembly reference?)

Shall I have missed something to do during those first steps or could be a VS2010 bug since I read somewhere there are some problems with namespaces in VS2010 (BTW, about those problems with namespaces I've read it's concerned about x64 compiling and in my project I settled to Any CPU for this purpose)?

Thanks a lot.

Cheers,

Luigi

Jul 24, 2011 at 9:56 AM

Hello Michael again,

I was playing a bit trying to change something and just, despite from your video tutorial, I tried to add in references UpdateControls.dll (not the XAML.dll one) and so VS2010 could find the Independent...

Maybe in that video tutorial it uses an old version of UpdateControls which needs for UpdateControls.XAML.dll to be added as References?... If so, that video tutorial should note about right versions and DLL to use as references I guess... like for VS2008 it's ok to add UpdateControls.XAML.dll as reference but in VS2010 it should use UpdateControls.dll...

What do you think since I could be also wrong, but at least it's what I found right now playing a bit?...

Cheers,

Luigi

Coordinator
Jul 24, 2011 at 5:17 PM

Thanks, Luigi.

Looks like you've gotten it figured out. UpdateControls.dll is the base assembly, and is required for any project. For a WPF project, you need both UpdateControls.XAML.dll and UpdateControls.dll.

Aug 13, 2011 at 10:49 AM

Hello again Michael!!

 

I was playing a bit with those Independent and I got a bit about their functionality..

Anyway I have a doubt: I am creating an application sample with different usercontrols for more clear implementation and since I figured usually it's used to implement DependencyProperty to do some binding between usercontrol and the main application, like loading some data from XML file and binding into a combobox in usercontrol and I was asking myself for this sort of binding can be used the Independent class between usercontrol and main application in two-way... What do you think, Michael?...

 

Cheers,

Luigi

Coordinator
Aug 14, 2011 at 6:54 PM

Usually a DependencyProperty is defined within a UserControl to enable binding. Even when using Update Controls, this is a good idea. It allows you to data bind that property in Blend.

You could replace this pattern with a Dependent field in the UserControl, but I wouldn't recommend it. DependencyProperty not only makes the control Blendable, but it also allows you to use the UserControl outside of an Update Controls based application. Perhaps one day, when Update Controls is built into the framework. :)