ExportInitializerAttribute Class |
Namespace: Eto
The ExportInitializerAttribute type exposes the following members.
Name | Description | |
---|---|---|
ExportInitializerAttribute |
Initializes a new instance of the PlatformInitializerAttribute class
|
Name | Description | |
---|---|---|
InitializerType |
Type of the extension class to instantiate when the assembly this attribute is supplied on is loaded by the platform.
|
Name | Description | |
---|---|---|
Register |
Registers the extension with the specified platform
(Overrides PlatformExtensionAttributeRegister(Platform).) |
MyControl
using Eto; using Eto.Forms; namespace MyControls { [Handler(typeof(IHandler))] public class MyControl : Control { new IHandler Handler => base.Handler as IHandler; public bool SomeProperty { get { return Handler.SomeProperty; } set { Handler.SomeProperty = value; } } public new interface IHandler : IHandler { bool SomeProperty { get; set; } } } }
using Eto; using Eto.Forms; using Eto.Wpf.Forms; [assembly:ExportInitializer(typeof(MyControls.Wpf.MyPlatform))] namespace MyControls.Wpf { class MyPlatform : IPlatformExtension { public Initialize(Platform platform) { platform.Add<MyControl.IHandler>(() => new MyControlHandler()); } } public class MyControlHandler : WpfFrameworkElement<SomeWpfControl, MyControl, MyControl.ICallback>, MyControl.IHandler { public MyControlHandler() { Control = new SomeWpfControl(); } // TODO: public bool SomeProperty { get { return false; } set { } } } }