![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| 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 | |||