Select to view content in your preferred language

Sizing items in a SymbologyControl

768
0
06-19-2013 12:37 AM
by Anonymous User
Not applicable
Original User: mtor

Hi,

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:

When using esriDisplayStyleIcon:
[ATTACH=CONFIG]25355[/ATTACH]

When using esriDisplayStyleList:
[ATTACH=CONFIG]25356[/ATTACH]

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

<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>


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 🙂
0 Kudos
0 Replies