예제 #1
0
        private void InitializeRenderer()
        {
            if (textEditor != null)
            {
                textEditor.CancelEdit(true);
            }

            if (renderer != null)
            {
                renderer.Dispose();
                renderer = null;
            }

            if (canvasControl != null && Document != null && RendererProvider != null)
            {
                if (renderer == null || renderer.Document != Document || renderer.Canvas != canvasControl || RendererProvider != lastWin2DRendererProvider)
                {
                    renderer = RendererProvider.CreateRenderer(Document, canvasControl);

                    lastWin2DRendererProvider = RendererProvider;
                }
            }

            if (renderer != null)
            {
                UpdateScale();
            }
            if (canvasControl != null)
            {
                canvasControl.Invalidate();
            }
        }
예제 #2
0
        private void OnUnloading(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            Runner.Dispose();
            Runner = null;

            PlayerPanel.RemoveFromVisualTree();
            PlayerPanel = null;
        }