.NET Development: Finding MapCtrl in Blend for WPF
1 to 3 of 3
-
- CommentAuthorAngus
- CommentTimeOct 18th 2011
How do I add the MapCtrl control to my .NET 4 WPF app?
I've got an empty project with the correct namespaces in it, but I don't know where the control is.
Can anyone help me out?
Thanks -
- CommentAuthorAlex H
- CommentTimeOct 18th 2011
Hi Angus,We do not currently offer native WPF Controls for GeoBase. This is something that is under consideration for future releases.
It is possible to use the existing Windows Forms controls within a WPF application by using the WindowsFormsHost class from the WindowsFormsIntegration assembly. However, performance may not match native WPF controls, and I doubt it will integrate nicely with Expression Blend's UI builder. Here's the Microsoft Documentation, and here's one of the better tutorials.
If the target for your WPF application is the browser, I would suggest you take a look at our Silverlight SDK, which may offer a superior experience. Documentation on this can be found on this site, under the Resources tab at the top. We do not use Expression Blend internally, so I don't know if our Silverlight Controls will integrate with the WYSWIG editor - if you give it a try, let us know!
Thanks,
Alex -
- CommentAuthorAngus
- CommentTimeOct 19th 2011 edited
Thanks for the quick feedback.
Based on that link, here's a solution. (No word on performance, yet, but Blend does play nicely with many MapCtrl attributes):
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:telogis="clr-namespace:Telogis.GeoBase;assembly=geobase.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="GeoZone1.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Grid>
<WindowsFormsHost x:Name="formshost" Margin="174,8,8,8">
<telogis:MapCtrl
x:Name="mapCtrl"
BorderStyle="Fixed3D" Heading="-90" MapQuality="Perfect" Perspective="TwoPointFiveD" RenderLabels="True" Satellite="True" />
</WindowsFormsHost>
</Grid>
</Window>
1 to 3 of 3
