Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing
Message
From
01/10/2008 14:07:04
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Subclassing
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01352065
Message ID:
01352065
Views:
60
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
Next
Reply
Map
View

Click here to load this message in the networking platform