Count Widget

Operations Dashboard for ArcGIS with the Count Widget sample

This Operations Dashboard for ArcGIS sample demonstrates how to implement a custom widget that executes a statistical query against a data source and shows the number of features that match the query.

Operations Dashboard for ArcGIS samples are supported only in Visual Studio 2012. A live preview is not available.

To run this sample, open the solution in Visual Studio 2012, set the Start Action and Start Options debug options in the Project Properties as described in the Testing add-ins help topic, and then build and run the project.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="CountWidgetCS.CountWidget"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:opsCenter="clr-namespace:ESRI.ArcGIS.OperationsCenter;assembly=ESRI.ArcGIS.OperationsCenter"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
  <Grid Margin="10">
    <Grid.RowDefinitions>
      <RowDefinition Height="auto" />
      <RowDefinition Height="auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <TextBlock Grid.Row="0" Text="Number of features where" HorizontalAlignment="Left" Margin="10"
               Style="{StaticResource SettingLabelStyle}" Foreground="{DynamicResource ThemedForegroundBrush}" FontSize="{DynamicResource ThemedTextSize}" />

    <TextBlock x:Name="CountOfLabel" Grid.Row="1" Text="" HorizontalAlignment="Left" Margin="10"
               Style="{StaticResource SettingLabelStyle}" Foreground="{DynamicResource ThemedForegroundBrush}" FontSize="{DynamicResource ThemedTextSize}" />
   
    <Viewbox Grid.Row="2" Stretch="Uniform">
      <TextBlock x:Name="CountBlock" Text="No Data" Margin="10" Foreground="{DynamicResource ThemedForegroundBrush}"/>
    </Viewbox>
  </Grid>
</UserControl>
Sample code usage restrictions
5/16/2014