Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SubClassing Controls
Message
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01417695
Message ID:
01417820
Vues:
41
>>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
Fil
Voir

Click here to load this message in the networking platform