Information générale
Catégorie:
Windows Presentation Foundation (WPF)
>>I am just starting to learn WPF and I am wondering what the best way is to implement controls. When I am working in a Windows Forms environment, the first thing that I do is subclass all of the controls that I intend to use so that I can add application wide functionality to all instances of a given control.
>>
>>Should I be creating application subclasses of WPF controls? If so, what is the best way to go about it?
>
>You can sub-class controls in WPF in the same way as in a WinForms app. But, in reality, you will probably find that most cases where you used a derived control in WinForms can be better handled in WPF using Styles, Templates and Commands. You certainly shouldn't be placing appearance related code in derived classes. If you're creating User Controls then bear in mind that you cannot sub-class from them unless they are defined solely in code (not XAML based)
>HTH,
>Viv
Thanks Viv,
That is exactly what I needed to know.
Richard
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement