コード例 #1
0
ファイル: ImageLoader.cs プロジェクト: leontov/tele2
        private void DeviceLost(CanvasDevice sender, object args)
        {
            sender.DeviceLost -= DeviceLost;

            _canvasDevice             = new CanvasDevice();
            _canvasDevice.DeviceLost += DeviceLost;
            _deviceLostHelper.WatchDevice(_canvasDevice);

            CanvasComposition.SetCanvasDevice(_graphicsDevice, _canvasDevice);
        }
コード例 #2
0
ファイル: ImageLoader.cs プロジェクト: leontov/tele2
        public ImageLoader(Compositor compositor)
        {
            Debug.Assert(compositor != null && _compositor == null);

            _compositor       = compositor;
            _drawingLock      = new object();
            _deviceLostHelper = new DeviceLostHelper();

            _canvasDevice             = new CanvasDevice();
            _canvasDevice.DeviceLost += DeviceLost;

            _deviceLostHelper.WatchDevice(_canvasDevice);
            _deviceLostHelper.DeviceLost += DeviceRemoved;

            _graphicsDevice = CanvasComposition.CreateCompositionGraphicsDevice(_compositor, _canvasDevice);
            _graphicsDevice.RenderingDeviceReplaced += RenderingDeviceReplaced;
        }