Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm working on an Engine application, and we use WPF when creating our UI. We've got a dialog for choosing scalebar styles, and it's setup using a WindowsFormsHost. Unfortunately the items in the SymbologyControl are too small to be of any practical use at all.

Am I dowing something wrong here, or is it somehow possible to set the size of the items?

XAML code:

<Window x:Class="ScalebarDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        mc:Ignorable="d" 
        Height="340" Width="480"
        Loaded="Window_Loaded">
    <Grid>
        <WindowsFormsHost Name="_hostControl"/>
    </Grid>
</Window>

And code behind:

using System.IO;
using System.Windows;
using ESRI.ArcGIS;
using MyApp.Dialogs.ViewModels;
using AOctr = ESRI.ArcGIS.Controls;

namespace MyApp.Dialogs
{
    /// <summary>
    /// Interaction logic for ScalebarDialog.xaml
    /// </summary>
    public partial class ScalebarDialog: Window
    {
        public AOctr.AxSymbologyControl AxSymbologyControl { get; private set; }

        public ScalebarDialog()
        {
            InitializeComponent();

            AxSymbologyControl = new AOctr.AxSymbologyControl();
            _hostControl.Child = AxSymbologyControl;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var installPath = RuntimeManager.ActiveRuntime.Path;
            var styleFileName = Path.Combine(installPath, @"Styles\ESRI.ServerStyle");

            AxSymbologyControl.StyleClass = AOctr.esriSymbologyStyleClass.esriStyleClassScaleBars;
            AxSymbologyControl.LoadStyleFile(styleFileName);
            AxSymbologyControl.Appearance = AOctr.esriControlsAppearance.esriFlat;
            AxSymbologyControl.DisplayStyle = AOctr.esriSymbologyDisplayStyle.esriDisplayStyleIcon;
            //AxSymbologyControl.DisplayStyle = AOctr.esriSymbologyDisplayStyle.esriDisplayStyleList;

            AOctr.ISymbologyStyleClass symbologyStyleClass = AxSymbologyControl.GetStyleClass(AxSymbologyControl.StyleClass);
            symbologyStyleClass.SelectItem(0);
        }
    }
}

I'll really appreciate any type of input on the matter :)

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.