コード例 #1
0
        private static void OnSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            SvgCanvas viewbox = obj as SvgCanvas;

            if (viewbox == null)
            {
                return;
            }

            viewbox._sourceUri = (Uri)args.NewValue;
            if (viewbox._sourceUri == null)
            {
                viewbox.OnUnloadDiagram();
            }
            else
            {
                viewbox.OnSettingsChanged();
            }
        }
コード例 #2
0
        private static void OnStreamSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            SvgCanvas svgCanvas = obj as SvgCanvas;

            if (svgCanvas == null)
            {
                return;
            }

            svgCanvas._sourceStream = (Stream)args.NewValue;
            if (svgCanvas._sourceStream == null)
            {
                svgCanvas.OnUnloadDiagram();
            }
            else
            {
                svgCanvas.OnSettingsChanged();
            }
        }
コード例 #3
0
        private static void OnMessageStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SvgCanvas canvas = d as SvgCanvas;

            canvas.InvalidateVisual();
        }