List transformations by suitability

List datum transformations by suitability
Loading

Code

<UserControl
    x:Class="ArcGISRuntime.UWP.Samples.ListTransformations.ListTransformations"
    x:Name="_this"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ArcGISRuntime.UWP.Samples.ListTransformations"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid DataContext="{Binding ElementName=_this}">
        <esriUI:MapView x:Name="MyMapView" />
        <Border BorderBrush="Black" BorderThickness="1" Background="White"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="375">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="InSpatialRefTextBox"
                           Grid.Row="0" Grid.Column="0"
                           FontWeight="SemiBold" />
                <TextBlock x:Name="OutSpatialRefTextBox"
                           HorizontalAlignment="Right"
                           Grid.Row="0" Grid.Column="1"
                           FontWeight="SemiBold" />
                <CheckBox x:Name="UseExtentCheckBox"
                          Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                          Margin="0,5,0,0"
                          Content="Consider current extent"
                          IsChecked="False"
                          Checked="UseExtentCheckBox_CheckChanged"
                          Unchecked="UseExtentCheckBox_CheckChanged" />
                <ListView x:Name="TransformationsListBox"
                          Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                          BorderBrush="Black" BorderThickness="1" Padding="0"
                          Height="200"
                          ItemsSource="{Binding Path=SuitableTransformationsList}"
                          SelectionChanged="TransformationsListBox_Selected">
                    <ListView.ItemTemplate>
                        <DataTemplate x:DataType="local:DatumTransformationListBoxItem">
                            <UserControl>
                                <TextBlock x:Name="TransformNameTextBlock"
                                           Text="{Binding Path=TransformationObject.Name}"
                                           TextWrapping="Wrap">
                                    <!-- View states to manage display of unavailable transforms, and the default transform. -->
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup>
                                            <!-- If missing PE files locally, the transform is unavailable. -->
                                            <VisualState x:Name="UnavailableTransformState">
                                                <VisualState.StateTriggers>
                                                    <StateTrigger
                                                        IsActive="{x:Bind TransformationObject.IsMissingProjectionEngineFiles, Mode=OneWay}" />
                                                </VisualState.StateTriggers>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="TransformNameTextBlock"
                                                                     Storyboard.TargetProperty="(TextBlock.Opacity)"
                                                                     To="0.5" Duration="0:0:1" />
                                                </Storyboard>
                                            </VisualState>
                                            <!-- One transform is the default, highlight it in blue. -->
                                            <VisualState x:Name="DefaultTransformState">
                                                <VisualState.StateTriggers>
                                                    <StateTrigger IsActive="{x:Bind IsDefault, Mode=OneWay}" />
                                                </VisualState.StateTriggers>
                                                <Storyboard>
                                                    <ColorAnimation Duration="0:0:1" To="Blue"
                                                                    Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
                                                                    Storyboard.TargetName="TransformNameTextBlock" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                </TextBlock>
                            </UserControl>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                <TextBlock x:Name="MessagesTextBox"
                           Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                           Margin="0,5,0,0"
                           TextWrapping="Wrap" FontWeight="SemiBold" />
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code