From MSDN -
Abstract classes cannot be instantiated, and are frequently either
partially implemented, or not at all implemented.
If you need Panel
, create an object of classes deriving from Panel. Most popular are
- Grid
- DockPanel
- StackPanel
- Canvas
Complete list for classes deriving from Panels can be found here.
This will serve your purpose -
System.Windows.Controls.Panel Panel1 = new System.Windows.Controls.DockPanel();
But I think you need to access Dock
property of DockPanel (and properties specific to DockPanel), so you should create DockPanel object instead -
System.Windows.Controls.DockPanel Panel1 = new System.Windows.Controls.DockPanel();