Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing
Message
De
01/10/2008 14:07:04
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
Subclassing
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01352065
Message ID:
01352065
Vues:
59
Hi,

I'm about to start - well thinking of starting - the first application

I'd like to invest time in subclassing most controls.

I'm thinking of starting with subclassing the wpf form - so I can add some functionality, like restoring it to its previous position and the like

My plan is to create a blank solution and adding a 'base' project (with the subclasses) . The intention to 'include' that base project into other apps (solutions) in the future
The second project would be THE app

Question re subclassing wpf windows/page/....
Is that the best approach ? [think I can manage the templates = modify the existing ones]

Or is there something better - like adding a class (to be written) which would handle such things
That class would have to be able to 'intercept' events from the window it is on. So, like adding it as a property
public partial class WindowBase : Window
{
          ClassToHandleMostOfTheThings PropertyToHandleMostOfTheThings;

	public WindowBase()
		:base()
	{
		InitializeComponent();
		PropertyToHandleMostOfTheThings = new ClassToHandleMostOfTheThings(this);


	}
}
Goal is to minimize the code to add on each window

Any thoughts ?
Gregory
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform