Nitriq is a product by
Home
|
Console Edition
|
Features
|
Getting Started
|
Documentation
|
Support
|
Blog
|
About
WPF and XAML 4.0 Wishlist
Microsoft: Please Please Please add the following two things two the next WPF/XAML version.
Addition 1
Move
ObservableCollection<T>
and
INotifyCollectionChanged
to the system.dll instead of WindowsBase.dll. It is
insanely
annoying that I can't reuse my model objects in a web application without referencing WindowsBase.dll. It just feels dirty, plus it typically leads to hosting problems.
Addition 2
I understand that you'd want two different Color structures - one for WinForms and one for WPF. But it would make my life a lot easier if you created an
IColor
interface that simply had the byte properties A, R, G and B.
Having some native methods on the color objects to convert from HSL would be greatly appreciated too.
I'd be willing to pay a couple of dozen dollars for these two features, just let me know ;)
Wednesday, June 3, 2009 - 1:21 PM CST -
Permalink
-
Comments [3]
Tags:
Wishlist
|
XAML
Thursday, June 04, 2009 3:36:03 AM (Central Standard Time, UTC-06:00)
I can see where you are coming from, but there are big implications to what moving such highly used types.
Personally I do not use INPC or OC on my data models (biz objects). I do use them on my ViewModels, but my VMs are coupled with WPF anyways. My data models are generally wrapped by my VM, so my data models are portable.
I agree with the IColor, but that also has large implications also. I think that's going to be a design limitation we have to live with! At this moment, I think we should consider ourselves lucky there isn't a new color structure!
Jeremiah Morrill
Thursday, June 04, 2009 9:31:25 AM (Central Standard Time, UTC-06:00)
Holy Crap. I didn't realize anyone read my blog ;)
I wonder what the implications really are though - would there be a performance decrease? I can't really see why? I could imagine there might be some problems with moving OC<T>, although I can't think what they'd be, but I definitely can't see how moving an interface could hurt all that much. Especially if you leave everything in the same namespace as before.
I do use MVVM, but I'd say at least 80% of the time, my model objects are well positioned to be bound to directly. I don't need to attach any new view specific behavior or properties to my models. This problem becomes more significant when you've got a hierarchy of objects that you want bound to all at once.
For instance - if I wanted to display in a tree a hierarchy of People to Pets to Toys. What happens when a different thread on a different screen adds a new toy to one of the pets. If you're using stripped model classes, you have to write all sorts of code so that your view model is made aware that something has changed. But if the hierarchy of objects is created using OC<T> - all the plumbing is already done for you.
Do you just end up writing all that extra code? Is there a trick that I don't know about?
Jon von Gillern
Thursday, June 04, 2009 3:29:45 PM (Central Standard Time, UTC-06:00)
Well consider how many programs you could potentially break by moving that interface, even if it remains in the same namespace. For instance, your new code would compile, but what about programs already compiled and out in the wild. When you use a type in an external assembly, the external assembly filename is also taken into account when resolving a type, not just the namespace. Older applications would be looking for the type in another assembly. This would break backwards compatibility.
On MVVM...It's my opinion (and it's really just that!), that the purist approach to the pattern is that your view should always bind to a view model. Your business objects/model should have mechanisms to notify your VM (or any subscriber) if something has changed on another thread.
That being said, I am not a purist! I have done what your are describing quite a bit. I usually do this with the proxy types generated from service references (INCC and OC are used by default in the generator). But service references, with their generated nature, negate any concerns of having a portable model. If my business objects are not generated, keeping them portable is usually taken into account when they are being designed.
I agree that the "purist" approach will take more code, but if the project is quite complex, that is a good way to keep maintainability. For me, the size of the application determines how much scaffolding is needed. It's pretty easy to take a 1k LoC application to 5k LoC, just by abstracting everything to non-existence!
Cheers,
-Jer
BTW, I found your blog via Dotnetkicks!
Jeremiah Morrill
Comments are closed.
Click
Download Nitriq Now
for download options on the
NimblePros download page.
RSS
Tags
Atomiq
Blend
CopyPasteKiller
Design
Flamebait
fun
Hacker News
IADNUG
Nitriq
Projects
Stuff
Tips and Tricks
Wishlist
XAML
Archive
November, 2011 (2)
April, 2011 (1)
March, 2011 (2)
November, 2010 (1)
September, 2010 (1)
July, 2010 (2)
June, 2010 (2)
May, 2010 (1)
April, 2010 (1)
March, 2010 (1)
November, 2009 (1)
October, 2009 (5)
September, 2009 (1)
August, 2009 (1)
July, 2009 (1)
June, 2009 (1)
May, 2009 (1)
April, 2009 (2)
March, 2009 (1)
February, 2009 (2)
January, 2009 (1)
October, 2008 (1)
September, 2008 (1)
August, 2008 (1)
July, 2008 (2)
June, 2008 (2)
May, 2008 (2)
March, 2008 (2)
February, 2008 (8)
January, 2008 (4)
December, 2007 (6)
November, 2007 (2)