ArcGIS Runtime SDK for .NET Samples

Read symbols from a mobile style

Select symbols from a mobile style

Loading

<UserControl x:Class="ArcGISRuntime.WPF.Samples.SymbolsFromMobileStyle.SymbolsFromMobileStyle"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:ArcGISRuntime.WPF.Samples.SymbolsFromMobileStyle"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <UserControl.Resources>
        <local:ColorToSolidBrushConverter x:Key="ColorToBrushConverter"/>
    </UserControl.Resources>
    <Grid>
        <esri:MapView x:Name="MyMapView"/>
        <Border Style="{StaticResource BorderStyle}" 
                Padding="0" Width="400" Height="290" 
                Margin="0,20,20,0">
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="140"/>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="40"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <ListBox x:Name="EyeSymbolList"
                         Grid.Row="0" Grid.Column="0"
                         Margin="20"
                         SelectionMode="Single"
                         SelectionChanged="SymbolPropertyChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Image Source="{Binding ImageSrc}"
                                   Height="15"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <ListBox x:Name="MouthSymbolList"
                         Grid.Row="0" Grid.Column="1"
                         Margin="20"
                         SelectionMode="Single"
                         SelectionChanged="SymbolPropertyChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Image Source="{Binding ImageSrc}"
                                   Height="15"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <ListBox x:Name="HatSymbolList"
                         Grid.Row="0" Grid.Column="2"
                         Margin="20"
                         SelectionMode="Single"
                         SelectionChanged="SymbolPropertyChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Image Source="{Binding ImageSrc}"
                                   Height="20"
                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <Slider x:Name="SizeSlider"
                        SmallChange="1" LargeChange="5"
                        Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                        Margin="10,0"
                        Minimum="8" Maximum="60" Value="20"/>
                <Label x:Name="SizeLabel" 
                       Grid.Row="1" Grid.Column="2">
                    <Label.Content>
                        <TextBlock>
                            <Run Text="Size:"/>
                            <Run Text="{Binding ElementName=SizeSlider, Path=Value, StringFormat={}{0:#}}"/>
                        </TextBlock>
                    </Label.Content>
                </Label>
                <ComboBox x:Name="FaceColorComboBox"
                          Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                          Width="150" Height="25"
                          HorizontalAlignment="Center" VerticalAlignment="Center"
                          HorizontalContentAlignment="Center"
                          SelectionChanged="SymbolPropertyChanged">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <Border Background="{Binding Converter={StaticResource ColorToBrushConverter}}" Height="25" Width="150"/>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                
                <Image x:Name="SymbolPreviewImage"
                       Grid.Row="2" Grid.Column="2" Grid.RowSpan="2"
                       Width="80" Height="80"/>
                <Button x:Name="ClearGraphicsButton"
                       Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                       Width="140" Height="20"
                        Content="Clear graphics"
                        Click="ClearGraphicsClick"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code