public void CreateDeviceDependentResources(DeviceResources resources)
        {
            this.deviceResources = resources;

            var dwriteFactory = this.deviceResources.DWriteFactory;

            this.textFormat = dwriteFactory.CreateTextFormat("Gabriola", null, DWriteFontWeight.Regular, DWriteFontStyle.Normal, DWriteFontStretch.Normal, 36.0f, "en-US");
            this.textFormat.TextAlignment      = DWriteTextAlignment.Center;
            this.textFormat.ParagraphAlignment = DWriteParagraphAlignment.Near;
        }
        public void CreateDeviceDependentResources(DeviceResources resources)
        {
            if (resources == null)
            {
                throw new ArgumentNullException("resources");
            }

            this.deviceResources = resources;

            this.stateBlock = this.deviceResources.D2DFactory.CreateDrawingStateBlock();

            this.textFormat = this.deviceResources.DWriteFactory.CreateTextFormat("Segoe UI", null, DWriteFontWeight.Light, DWriteFontStyle.Normal, DWriteFontStretch.Normal, 20.0f, string.Empty);
        }