How to use a DataTrigger with MetadataBinding in XAML

39
0
11-30-2020 08:17 AM
Labels (2)
New Contributor

Hello, i use ArcGIS Pro 2.6.2 and the Metadata Toolkit with Visual Studio 2017 to customize the GUI a little bit. So based on the following XML element from the metadata: metadata/mdContact/role/RoleCd@value i want to display a custom text in a label. I tried using the following XAML markup:

        <Label Grid.Row="0" Grid.Column="0" Name="SomeLabelControl">
            <Label.Style>
                <Style TargetType="Label">
                    <Setter Property="Content" Value="unknown value"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Source={StaticResource XmlRecord}, XPath=role/RoleCd/@value}" Value="001">
                            <Setter Property="Content" Value="Some Val 1" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Source={StaticResource XmlRecord}, XPath=role/RoleCd/@value}" Value="007">
                            <Setter Property="Content" Value="Some Val 2" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Label.Style>
        </Label>

How should the binding be defined? With the markup displayed above it only shows "unknown value".

Is there an official Metadata Toolkit forum available? Because i did not found any.

 

Regards

 

Christian

Reply
0 Kudos
0 Replies