private void InitializeGraphicsDevice() { if (_graphicsDeviceService == null) { _graphicsDeviceService = new DXGraphicsDeviceService(); // create the image source _imageSource = new DXImageSource( GraphicsDevice, (int)ActualWidth, (int)ActualHeight); rootImage.Source = _imageSource.WriteableBitmap; Services.AddService(typeof(IGraphicsDeviceService), _graphicsDeviceService); } }
private void DoResize() { if (_imageSource != null) { _imageSource.Dispose(); _imageSource = new DXImageSource( GraphicsDevice, (int)ActualWidth, (int)ActualHeight); _imageSourcePresenter = new RenderTargetGraphicsPresenter(GraphicsDevice, _imageSource.RenderTarget); rootImage.Source = _imageSource.WriteableBitmap; if (Resized != null) { Resized(this, EventArgs.Empty); } } }