There isn't much in the way of xaml since it's mostly constructed in code behind. Here is the xaml:
<sc:RefreshableUserControl
x:Class="Dashboard.Silverlight.Views.Aviation.FixedWingLocation"
xmlns:sc="clr-namespace:Dashboard.Silverlight.SupportClasses"
xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
mc:Ignorable="d"
d:DesignHeight="762" d:DesignWidth="1024" >
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.Resources>
<sc:FooterValueConverter x:Key="FooterValueConverter" />
<sc:FooterForeColorValueConverter x:Key="ForeColorValueConverter"/>
<ControlTemplate x:Key="GridViewFooterCellTemplate" TargetType="telerik:GridViewFooterCell">
<Border Background="{Binding Path=CurrentItem.Value, Converter ={StaticResource FooterValueConverter}}"
x:Name="PART_FooterCellBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" >
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<ContentPresenter.ContentTemplate>
<DataTemplate>
<ContentControl Foreground="{Binding Path=CurrentItem.Value, Converter ={StaticResource ForeColorValueConverter}}"
Content="{Binding CurrentItem.Value}" />
</DataTemplate>
</ContentPresenter.ContentTemplate>
</ContentPresenter>
</Border>
</ControlTemplate>
<SolidColorBrush x:Key="ControlOuterBorder" Color="#FF848484"/>
<Style x:Key="GridViewFooterCellStyle1" TargetType="telerik:GridViewFooterCell">
<Setter Property="Template" Value="{StaticResource GridViewFooterCellTemplate}"/>
<Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder}"/>
<Setter Property="BorderThickness" Value="0,0,1,0"/>
<Setter Property="Padding" Value="5,0,3,0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
</Grid.Resources>
<Viewbox x:Name="vbViewbox" Visibility="Visible">
<Grid x:Name="grdViewbox" Margin="5,5,5,5">
<Grid.RowDefinitions>
<RowDefinition Height=".9*"/>
<RowDefinition Height=".1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<telerik:RadPanelBar x:Name="pbAviation" Margin="12,8,12,20" FontWeight="Bold" Grid.Row="0" Width="auto" telerik:StyleManager.Theme="Transparent" ExpandMode="Single" >
<!--Contents of panel bar inserted programmatically in code behind-->
</telerik:RadPanelBar>
<StackPanel Name="stackRectangles" Grid.Row="1" Margin="0,12,0,0" telerik:StyleManager.Theme="Transparent" HorizontalAlignment="Center"
VerticalAlignment="Top" Orientation="Horizontal">
<TextBlock Grid.Row="1" Foreground="#FF080707" Margin="3,0">Legend: FMC %</TextBlock>
<Rectangle Width="65" Height="17" RadiusX="5" RadiusY="5" Stroke="Black" StrokeThickness="1.5">
<Rectangle.Projection>
<PlaneProjection CenterOfRotationX="0" CenterOfRotationY="0"/>
</Rectangle.Projection>
<Rectangle.Effect>
<telerik:ReflectionEffect/>
</Rectangle.Effect>
<Rectangle.Fill>
<LinearGradientBrush x:Name="lgbGreen" EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FF075207" Offset="0.759"/>
<GradientStop Color="#FF21C221" Offset="0.056"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock Foreground="#FF080707" HorizontalAlignment="Center" Margin="3,0">75-100%</TextBlock>
<Rectangle Width="65" Height="17" RadiusX="5" RadiusY="5" Stroke="Black" StrokeThickness="1.5">
<Rectangle.Effect>
<telerik:ReflectionEffect/>
</Rectangle.Effect>
<Rectangle.Fill>
<LinearGradientBrush x:Name="lgbYellow" EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="Yellow" Offset="0.043"/>
<GradientStop Color="#FF898925" Offset="0.866"/>
<GradientStop Color="#FFC2C246" Offset="0.47"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock Foreground="#FF080707" HorizontalAlignment="Center" Margin="3,0">74-60%</TextBlock>
<Rectangle Width="65" Height="17" RadiusX="5" RadiusY="5" StrokeThickness="1.5" Stroke="Black">
<Rectangle.Fill>
<LinearGradientBrush x:Name="lgbRed" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF5C221C" Offset="0.72"/>
<GradientStop Color="#FFF72E2E" Offset="0.013"/>
</LinearGradientBrush>
</Rectangle.Fill>
<Rectangle.Effect>
<telerik:ReflectionEffect/>
</Rectangle.Effect>
</Rectangle>
<TextBlock Foreground="#FF080707" HorizontalAlignment="Center" Margin="3,0">59-50%</TextBlock>
<Rectangle Width="65" Height="17" RadiusX="5" RadiusY="5" Stroke="Black" StrokeThickness="1.5">
<Rectangle.Effect>
<telerik:ReflectionEffect/>
</Rectangle.Effect>
<Rectangle.Fill>
<LinearGradientBrush x:Name="lgbBlack" EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FF0C0C0C" Offset="0.543" />
<GradientStop Color="#FFA9A7A7" Offset="0.004"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock Foreground="Black" HorizontalAlignment="Center" Margin="3,0">0-49%</TextBlock>
</StackPanel>
</Grid>
</Viewbox>
</Grid>
</sc:RefreshableUserControl>
public void CreatePanelBar()
{
List<string> locations = GetLocations();
foreach (string location in locations)
{
RadPanelBarItem item = new RadPanelBarItem();
item.Name = location;
item.Header = location;
pbAviation.Items.Insert(0, item);
StackPanel stackGrid = new StackPanel();
//gvFixed contains the grid of data for each location
RadGridView gvFixed = new RadGridView();
gvFixed.ShowColumnFooters = true;
gvFixed.ShowGroupPanel = false;
gvFixed.IsFilteringAllowed = false;
StyleManager.SetTheme(gvFixed, new TransparentTheme());
stackGrid.Children.Add(gvFixed);
#region gvFixed columns
//Add the columns to the grid
GridViewDataColumn Name = new GridViewDataColumn();
Name.DataType = typeof(string);
Name.DataMemberBinding = new Binding("FixedType");
Name.Header = "MDS";
Name.UniqueName = "Name";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(Name);
CountFunction NameTotal = new CountFunction();
NameTotal.ResultFormatString = location.ToString() + " Totals ";
((GridViewDataColumn)gvFixed.Columns["Name"]).AggregateFunctions.Add(NameTotal);
GridViewDataColumn ColOnHand = new GridViewDataColumn();
ColOnHand.DataType = typeof(double);
ColOnHand.DataMemberBinding = new Binding("OnHand");
ColOnHand.Header = "On Hand";
ColOnHand.UniqueName = "OnHand";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColOnHand);
SumFunction OnHandTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["OnHand"]).AggregateFunctions.Add(OnHandTotal);
GridViewDataColumn ColFMC = new GridViewDataColumn();
ColFMC.DataType = typeof(double);
ColFMC.DataMemberBinding = new Binding("FMC");
ColFMC.Header = "FMC";
ColFMC.UniqueName = "FMC";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColFMC);
SumFunction FMCTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["FMC"]).AggregateFunctions.Add(FMCTotal);
GridViewDataColumn ColNMCS = new GridViewDataColumn();
ColNMCS.DataType = typeof(double);
ColNMCS.DataMemberBinding = new Binding("NMCS");
ColNMCS.Header = "NMCS";
ColNMCS.UniqueName = "NMCS";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColNMCS);
SumFunction NMCSTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["NMCS"]).AggregateFunctions.Add(NMCSTotal);
GridViewDataColumn ColNMCM = new GridViewDataColumn();
ColNMCM.DataType = typeof(double);
ColNMCM.DataMemberBinding = new Binding("NMCM");
ColNMCM.Header = "NMCM";
ColNMCM.UniqueName = "NMCM";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColNMCM);
SumFunction NMCMTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["NMCM"]).AggregateFunctions.Add(NMCMTotal);
GridViewDataColumn ColPMCS = new GridViewDataColumn();
ColPMCS.DataType = typeof(double);
ColPMCS.DataMemberBinding = new Binding("PMCS");
ColPMCS.Header = "PMCS";
ColPMCS.UniqueName = "PMCS";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColPMCS);
SumFunction PMCSTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["PMCS"]).AggregateFunctions.Add(PMCSTotal);
GridViewDataColumn ColPMCM = new GridViewDataColumn();
ColPMCM.DataType = typeof(double);
ColPMCM.DataMemberBinding = new Binding("PMCM");
ColPMCM.Header = "PMCM";
ColPMCM.UniqueName = "PMCM";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColPMCM);
SumFunction PMCMTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["PMCM"]).AggregateFunctions.Add(PMCMTotal);
GridViewDataColumn ColFMCPercent = new GridViewDataColumn();
ColFMCPercent.DataType = typeof(double);
ColFMCPercent.DataMemberBinding = new Binding("FMCPercent");
ColFMCPercent.Header = "FMC %";
ColFMCPercent.UniqueName = "FMCPercent";
gvFixed.AutoGenerateColumns = false;
ColFMCPercent.FooterCellStyle = this.LayoutRoot.Resources["GridViewFooterCellStyle1"] as Style;
ColFMCPercent.IsReadOnly = true;
gvFixed.Columns.Add(ColFMCPercent);
var roundedAggregateFunction = new AggregateFunction<FixedSystem, double>() { AggregationExpression = p => Math.Round(p.Average(prd => prd.FMCPercent)) };
((GridViewDataColumn)gvFixed.Columns["FMCPercent"]).AggregateFunctions.Add(roundedAggregateFunction);
GridViewDataColumn ColScheduleS = new GridViewDataColumn();
ColScheduleS.DataType = typeof(double);
ColScheduleS.DataMemberBinding = new Binding("ScheduleS");
ColScheduleS.Header = "S";
ColScheduleS.UniqueName = "ScheduleS";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColScheduleS);
SumFunction ScheduleSTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["ScheduleS"]).AggregateFunctions.Add(ScheduleSTotal);
GridViewDataColumn ColScheduleM = new GridViewDataColumn();
ColScheduleM.DataType = typeof(double);
ColScheduleM.DataMemberBinding = new Binding("ScheduleM");
ColScheduleM.Header = "M";
ColScheduleM.UniqueName = "ScheduleM";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColScheduleM);
SumFunction ScheduleMTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["ScheduleM"]).AggregateFunctions.Add(ScheduleMTotal);
GridViewDataColumn ColScheduleT = new GridViewDataColumn();
ColScheduleT.DataType = typeof(double);
ColScheduleT.DataMemberBinding = new Binding("ScheduleT");
ColScheduleT.Header = "Total";
ColScheduleT.UniqueName = "ScheduleT";
gvFixed.AutoGenerateColumns = false;
gvFixed.Columns.Add(ColScheduleT);
SumFunction ScheduleTTotal = new SumFunction();
((GridViewDataColumn)gvFixed.Columns["ScheduleT"]).AggregateFunctions.Add(ScheduleTTotal);
#endregion
gvFixed.RowLoaded += new EventHandler<RowLoadedEventArgs>(gvFixed_RowLoaded);
//set the data source for the grid
gvFixed.ItemsSource = from fs in fixedSystem
where (fs.UnitType == "D" || fs.UnitType == "L") && fs.Owner.Location.ToString() == item.Name
group fs by fs.FixedType into grouping
select new FixedSystem()
{
Owner = new SystemOwner(),
FixedType = grouping.Key,
OnHand = grouping.Sum(fs => fs.OnHand),
FMC = grouping.Sum(fs => fs.FMC),
NMCS = grouping.Sum(fs => fs.NMCS),
NMCM = grouping.Sum(fs => fs.NMCM),
PMCS = grouping.Sum(fs => fs.PMCS),
PMCM = grouping.Sum(fs => fs.PMCM),
FMCPercent = Math.Round(grouping.Average(fs => fs.FMCPercent)),
ScheduleS = grouping.Sum(fs => fs.ScheduleS),
ScheduleM = grouping.Sum(fs => fs.ScheduleM),
ScheduleT = grouping.Sum(fs => fs.ScheduleT)
};
//set the totals for the grid
gvFixed.CalculateAggregates();
item.Items.Add(stackGrid);
}
if (pbAviation.Items.Count > 0)
{
((RadPanelBarItem)pbAviation.Items.First()).IsExpanded = true;
}
}