Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Having a window extend an abstract class

 
 
Old 01-31-2006   #1 (permalink)
Jason Dolinger


 
 

Having a window extend an abstract class

Is this possible? I've developed an abstract .cs class which extends
from Window. I'd now like to extend other window classes from my window
(specified both in the .xaml and .xaml.cs files) and I get the following
error:

Error 10 Can't specify an element of type
Lab49.ApplicationWindowManager.ManagedWindow. Only non-abstract types
are allowed as elements. Line 2 Position 19. C:\Documents and
Settings\jdolinger\My Documents\Visual Studio\Projects\WPF
Demos\TradingDemo\TradingDemo\TestClass.xaml 2 19 TradingDemo

A quick example would look something like this:


// The abstract class (no .xaml for this)
public abstract class MyAbstractWindow : Window {

}


// The .xaml file:
<?Mapping XmlNamespace="http://local" ClrNamespace="MyNamespace" ?>
<local:MyAbstractWindow x:Class=MyNamespace.ConcreteWindow>
...
</local:MyAbstractWindow>



// The concrete window class .xaml.cs file:
public partial class ConcreteWindow : MyAbstractWindow {

}



When I remove the abstract keyword from the superclass, everything works
fine. But this really should be an abstract class, I don't want people
to be able to instantiate. Is this specifically prohibited for a reason?

Thanks!
Jason


My System SpecsSystem Spec
Old 01-31-2006   #2 (permalink)
Eddie


 
 

Re: Having a window extend an abstract class

Unfortunately this is an unsupported scenario in V1 Avalon. Please
check in future versions of the platform.
Thanks!

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
When a class is both an inherited class of another, and alsoimplements an interface method .NET General
win32_pingstatus class / dns class PowerShell
Extend option ghosted out - can't extend partition? HELP! Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46