Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing
Message
From
03/10/2008 13:14:39
 
 
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01352065
Message ID:
01352607
Views:
21
>
>I appreciated the later bit where they went into the code for the 'post-it' listbox. I must admit that although I knew that sort of thing was possible I didn't suss that it WAS a listbox until it was mentioned!
>
>(Thanks for the link Matt)
>Best,
>Viv


Viv,

I was - still am - looking for a way to add functionality/behaviour to the standard wpf classes
My thought was - hell - I have to subclass

Subclassing in wpf is a pain in the - ahem - neck

In the wpf world, there exist things like 'attached properties' and 'dependency objects'.

I do not understand them yet. I tend to think that they may be the answer to my need

Have a look at this - the last paragraph reads : the biggest challenge in wpf is to unlearn what we know of the 'classic' technologies


Food for thought - and thanks for your interest -
bye,


A excerpt from here http://groups.google.com/group/wpf-disciples/browse_thread/thread/ecf7738d16300335/4400354b4be8f393?lnk=st&q=#4400354b4be8f393


Salut Aline,

Wow, enfin je peux parler de WPF en français!! Ca fait du bien :)


Bon, on ne va pas ennuyer nos amis ricains plus longtemps? Sorry guys,
back to EN :)


The classic answer to the "Why shouldn't I subclass" answer is Kevin
Moore's post:
http://work.j832.com/2007/06/don-subclass-panel-unless-you-making.html


In short, markup subclassing is bad.


That said, you can subclass in code, for example to add specific
functionality. About this, see my (I hope) classic post:


http://blog.galasoft.ch/archive/2007/03/02/107747.aspx


And yes, like Mike says, most of the time you don't need to because you
can modify the L&F of the element using templates. And also, you can add
your own DependencyProperties to implement new functionality.


Le plus grand challenge avec WPF, c'est de "désapprendre" ce qu'on sait
des technologies "classiques" :)


Bien du plaisir,

Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform