07-05-2018, 12:09 PM
(This post was last modified: 07-05-2018, 12:11 PM by RUL.
Edit Reason: Made title more clear
)
Hello
I want to show a customized svg in a ZoomPanel with a customized Viewport, while having a clean MVVM pattern.
I'm currently loading an svg in the ViewModel like so:
This gives me a System.Windows.Controls.Viewbox, which I need to loop through its Children to find customize certain parts of the SVG. This works perfectly.
After that, I could add the svgViewbox to a ZoomPanel, via the Content-Tag:
But then how to set a Viewport in the form of a Rect?
I already know the method SetViewboxNow(rectViewport);
But i want to bind this rectViewport in XAML, to stay true to MVVM pattern.
Thanks in advance.
I want to show a customized svg in a ZoomPanel with a customized Viewport, while having a clean MVVM pattern.
I'm currently loading an svg in the ViewModel like so:
Code:
var readerSvg = new Ab2d.ReaderSvg();
svgViewbox = readerSvg.Read(svgFilePath);
This gives me a System.Windows.Controls.Viewbox, which I need to loop through its Children to find customize certain parts of the SVG. This works perfectly.
After that, I could add the svgViewbox to a ZoomPanel, via the Content-Tag:
Code:
<ab2d:ZoomPanel x:Name="MyZoomPanel" Content="{Binding SvgViewbox}" />
But then how to set a Viewport in the form of a Rect?
Code:
Rect rectViewport = new Rect(xFactor, yFactor, widthFactor, heightFactor)
I already know the method SetViewboxNow(rectViewport);
But i want to bind this rectViewport in XAML, to stay true to MVVM pattern.
Thanks in advance.