GraphZoomAndScaleControl in WPF app

Oct 7, 2013 at 5:06 PM
Tony,

First, thanks for the work your team has put into this control. It's well-done, easy-to-modify, and straightforward to use.

I've been trying to the NodeXL GraphZoomAndScaleControl in a WPF app by instantiating the control in XAML with a WindowsFormHost:
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <nodexl:NodeXLControl x:Name="LinkGraph" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
        <WindowsFormsHost Grid.Row="1" Height="28">
            <nodeutil:GraphZoomAndScaleControl x:Name="ZoomScale" Anchor="Left" Visible="True"/>
        </WindowsFormsHost>
    </Grid>
In my code-behind, I initialize the ZoomAndScale control with:
this.ZoomScale.NodeXLControl = this.LinkGraph;
The graph displays just fine but I can't seem to get the zoom and scale control to display.

Is it possible to use this control in WPF? Did I miss something really obvious?

Thanks far any help.


Clyde
Oct 8, 2013 at 5:42 AM
Clyde:

I've never tried that myself, but I don't know of any reason why it wouldn't work. Have you tried any debugging yet? For example, if you substitute a WPF TextBox for the GraphZoomAndScaleControl, does the TextBox show up properly in your Grid? That would help determine whether it's a GraphZoomAndScaleControl problem or a general layout problem.

-- Tony
Oct 8, 2013 at 1:18 PM
Thanks for your really quick reply Tony.

The problem appears to be related to the fact that I'm using Caliburn.Micro as an MVVM framework (which I didn't show in my code snippet because it would have confused matters), so I've relented and created my own scale and zoom controls directly in WPF. Not a really hard thing to do at all.

Clyde