protected override void Dispose(bool disposing) { if (disposing) { if (ApplicationWindow != null) { ApplicationWindow.Dispose(); ApplicationWindow = null; } } }
public virtual DirectXDevice CreateDevice(DeviceInformation deviceInformation) { var device = DirectXDevice.New(deviceInformation.Adapter, deviceInformation.DeviceCreationFlags, deviceInformation.GraphicsProfile); var parameters = deviceInformation.PresentationParameters; CreatePresenter(device, parameters); // Force to resize the applicationWindow ApplicationWindow.Resize(parameters.BackBufferWidth, parameters.BackBufferHeight); return(device); }
public void Run(ApplicationContext applicationContext) { ApplicationWindow = CreateWindow(applicationContext); // Register on Activated ApplicationWindow.Activated += OnActivated; ApplicationWindow.Deactivated += OnDeactivated; ApplicationWindow.Initialization += OnInitialize; ApplicationWindow.Tick += (s, e) => application.Tick(); ApplicationWindow.Shutdown += OnExiting; var windowCreated = WindowCreated; if (windowCreated != null) { windowCreated(this, EventArgs.Empty); } ApplicationWindow.Run(); }