WindowGrid(WPF Window embed to Windows Forms Control)
sample files download startup WindowsFormsApplication.exe
Require
.Net Framework:4.0 +
Methods
-
WindowGrid(Window window)
instanced method,init WindowGrid.
-
WindowGrid.Init(Window window)
instanced method,init WindowGrid when instantiation WindowGrid object without arguments.
-
WindowGrid.GetHost(T t)
static method,return ElementHost object.
Usage
1 Add References
add below dll to Windows Forms application.
- PresentationCore.dll
- PresentationFramework.dll
- System.Xaml.dll
- WindowGrid.dll
- WindowsBase.dll
- WindowsFormsIntegration.dll
2 Coding
//using namespace
using XY.UI;
this.panel2.Controls.Clear();
this.panel2.Controls.Add(WindowGrid.GetHost<MainWindow>());
//or
//ElementHost host = WindowGrid.GetHost<MainWindow>();
//this.panel2.Controls.Add(host);
//or
//MainWindow window = new MainWindow();
//ElementHost host = WindowGrid.GetHost<MainWindow>(window);
//this.panel2.Controls.Add(host);
Bug
Not support .net framework < 4.0 in my way.