Message Processing

This sample demonstrates use of the message processing functionality to display military symbols on the map. Military symbol messages are displayed on the map via GraphicsLayers within a MessageGroupLayer. In this application, an empty MessageGroupLayer based on the SymbolDictionaryType Mil2525C is declared in XAML. An event handler is also assigned to handle the Initialized event raised when the MessageGroupLayer's associated MessageProcessor object is initialized by the map. The initialized event is used to indicate that the MessageProcessor is ready to begin processing messages. In this application, the event is simply used to enable UI components which allow the user to manually initiate the processing of messages which here are being read from a static XML file on disk. GraphicsLayers which contain the Graphics representing individual messages are automatically added to the MessageGroupLayer by the API.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.MessageProcessing"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <Grid>
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="_map" UseAcceleratedDisplay="True" WrapAround="True"
                  Extent="-245200 , 6665900, -207000 , 6687300">
            <esri:ArcGISTiledMapServiceLayer ID="World Topo Map" 
                    Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
            <esri:MessageGroupLayer x:Name="_messageGroupLayer"
                    MessageProcessorInitialized="HandleMessageProcessorInitialized"
                    SymbolDictionaryType="Mil2525C" />
        </esri:Map>
        <Border Background="{ StaticResource PanelGradient}" BorderThickness="1" CornerRadius="5"
                HorizontalAlignment="Right"  VerticalAlignment="Top"
                Margin="20" Padding="10" BorderBrush="Black" >
            <StackPanel>
                <TextBlock FontWeight="Bold" Foreground="White">
                    Click on the button below to run the message processor.<LineBreak/>       
                    It will read simulated messages from an XML file and <LineBreak/>
                    display military symbols on the map <LineBreak/>
                    using Mil2525C Symbols.
                </TextBlock>
                <Button x:Name="ProcessMessagesButton" Content="Process Messages" Click="ProcessMessagesButton_Click" Width="140" Height="24" 
                    VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,5,0,0"/>
            </StackPanel>
        </Border>
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014