normalize namespaces in DIYGrid.xaml

This commit is contained in:
John Colvin committed 2019-08-14 00:24:35 -05:00
1 parent b32c836f34
commit 577d2fa742
1 file changed
+59 -60
@@ -1,9 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mbts="clr-namespace:mbts.ui"
xmlns:ui="clr-namespace:mbts.ui"
xmlns:bts="clr-namespace:mbts.ui.controls"
xmlns:u="clr-namespace:mbts.ui"
xmlns:c="clr-namespace:mbts.ui.controls"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/view/Controls/Popup/PopupControl.xaml"/>
@@ -35,14 +34,14 @@
<Condition Property="Selector.IsSelectionActive" Value="False"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static bts:DIYGrid.InactiveSelectionHighlightKey}}"/>
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static c:DIYGrid.InactiveSelectionHighlightKey}}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="True"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{Binding SelectionHighlight, RelativeSource={RelativeSource AncestorType=bts:DIYGrid}}"/>
<Setter Property="Background" TargetName="Bd" Value="{Binding SelectionHighlight, RelativeSource={RelativeSource AncestorType=c:DIYGrid}}"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -50,14 +49,14 @@
</Setter>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="{ui:Brush {mbts:BTSColor Grid.input_cell_background}}"/>
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.input_cell_background}}"/>
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{ui:Brush {mbts:BTSColor Grid.alternate_row_background}}"/>
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.alternate_row_background}}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="bts:DIYGridRowsPresenter" BasedOn="{StaticResource {x:Type ListBox}}">
<Style TargetType="c:DIYGridRowsPresenter" BasedOn="{StaticResource {x:Type ListBox}}">
<Setter Property="IsTextSearchEnabled" Value="False"/>
</Style>
<DataTemplate x:Key="DefaultColumnHeaderContentTemplate">
@@ -65,7 +64,7 @@
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding}" TextWrapping="WrapWithOverflow" TextAlignment="Center"/>
</Grid>
</DataTemplate>
<Style TargetType="bts:DIYGrid">
<Style TargetType="c:DIYGrid">
<Setter Property="Focusable" Value="False"/>
<Setter Property="SelectionMode" Value="Extended"/>
<Setter Property="ColumnHeaderStyle">
@@ -73,15 +72,15 @@
<Style TargetType="GridViewColumnHeader">
<!-- Background - note that we're settings this property on the containing stackpanel in which the GridViewHeaderRowPresenter resides -->
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{mbts:BTSColor header_text}"/>
<Setter Property="BorderBrush" Value="{mbts:BTSColor header}"/>
<Setter Property="Foreground" Value="{u:BTSColor header_text}"/>
<Setter Property="BorderBrush" Value="{u:BTSColor header}"/>
<Setter Property="BorderThickness" Value="0,1,1,0"/>
<Setter Property="Command" Value="{x:Static bts:DIYGrid.SortCommand}"/>
<Setter Property="Command" Value="{x:Static c:DIYGrid.SortCommand}"/>
<Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}}"/>
<Setter Property="CommandTarget" Value="{Binding RelativeSource={RelativeSource AncestorType=bts:DIYGrid}}"/>
<Setter Property="CommandTarget" Value="{Binding RelativeSource={RelativeSource AncestorType=c:DIYGrid}}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Height" Value="{x:Static bts:DIYGrid.DefaultColumnHeaderHeight}"/>
<Setter Property="Height" Value="{x:Static c:DIYGrid.DefaultColumnHeaderHeight}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
@@ -112,7 +111,7 @@
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
/>
<Border x:Name="OperatorsBorder" Grid.Column="1" Background="{mbts:BTSColor Name=header}">
<Border x:Name="OperatorsBorder" Grid.Column="1" Background="{u:BTSColor Name=header}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -132,7 +131,7 @@
Visibility="Collapsed"
Width="8"
/>
<bts:PopupControl
<c:PopupControl
x:Name="FilterPopup"
Grid.Column="1"
Margin="2,0,0,0"
@@ -144,44 +143,44 @@
ShowExpanderArrow="False"
PopupPlacement="Bottom"
PlacementTarget="{Binding RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
IsOpen="{Binding Path='Column.(bts:DataGridFilterProperties.FilterOpen)', Mode=TwoWay, RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
ContentTemplate="{Binding Path='Column.(bts:DataGridFilterProperties.FilterTemplate)', RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
Content="{Binding Path='Column.(bts:DataGridFilterProperties.Filter)', RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
IsOpen="{Binding Path='Column.(c:DataGridFilterProperties.FilterOpen)', Mode=TwoWay, RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
ContentTemplate="{Binding Path='Column.(c:DataGridFilterProperties.FilterTemplate)', RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
Content="{Binding Path='Column.(c:DataGridFilterProperties.Filter)', RelativeSource={RelativeSource AncestorType=GridViewColumnHeader}}"
>
<bts:PopupControl.InputBindings>
<c:PopupControl.InputBindings>
<KeyBinding
Key="Return"
CommandParameter="{Binding Path='Column.(bts:DataGridFilterProperties.Filter)', RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=GridViewColumnHeader}}"
Command="{x:Static bts:DataGridFilterProperties.CommitCommand}"
CommandParameter="{Binding Path='Column.(c:DataGridFilterProperties.Filter)', RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=GridViewColumnHeader}}"
Command="{x:Static c:DataGridFilterProperties.CommitCommand}"
/>
<KeyBinding Key="Esc" Command="{x:Static bts:PopupControl.CloseCommand}"/>
</bts:PopupControl.InputBindings>
<bts:PopupControl.CommandBindings>
<KeyBinding Key="Esc" Command="{x:Static c:PopupControl.CloseCommand}"/>
</c:PopupControl.InputBindings>
<c:PopupControl.CommandBindings>
<CommandBinding
Command="{x:Static bts:DataGridFilterProperties.CommitCommand}"
Executed="{x:Static bts:DataGridFilterProperties.commit_executed}"
CanExecute="{x:Static bts:DataGridFilterProperties.commit_can_execute}"
Command="{x:Static c:DataGridFilterProperties.CommitCommand}"
Executed="{x:Static c:DataGridFilterProperties.commit_executed}"
CanExecute="{x:Static c:DataGridFilterProperties.commit_can_execute}"
/>
<CommandBinding
Command="{x:Static bts:DataGridFilterProperties.ClearCommand}"
Executed="{x:Static bts:DataGridFilterProperties.clear_executed}"
CanExecute="{x:Static bts:DataGridFilterProperties.clear_can_execute}"
Command="{x:Static c:DataGridFilterProperties.ClearCommand}"
Executed="{x:Static c:DataGridFilterProperties.clear_executed}"
CanExecute="{x:Static c:DataGridFilterProperties.clear_can_execute}"
/>
</bts:PopupControl.CommandBindings>
<bts:PopupControl.Header>
</c:PopupControl.CommandBindings>
<c:PopupControl.Header>
<Grid>
<Image Name="FilterPopupImage" Height="9" Width="9" Margin="3">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="{x:Static mbts:Icons.Filter}"/>
<Setter Property="Source" Value="{x:Static u:Icons.Filter}"/>
<Setter Property="Opacity" Value="0.0"/>
</Style>
</Image.Style>
</Image>
</Grid>
</bts:PopupControl.Header>
<bts:PopupControl.Style>
<Style TargetType="bts:PopupControl">
</c:PopupControl.Header>
<c:PopupControl.Style>
<Style TargetType="c:PopupControl">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="LightGray"/>
@@ -192,8 +191,8 @@
</Trigger>
</Style.Triggers>
</Style>
</bts:PopupControl.Style>
</bts:PopupControl>
</c:PopupControl.Style>
</c:PopupControl>
</Grid>
</Border>
</Grid>
@@ -235,8 +234,8 @@
<Setter Property="Grid.Column" TargetName="SortArrow" Value="0"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="HeaderBorder" Value="{mbts:BTSColor Name=header_alternate}"/>
<Setter Property="Background" TargetName="OperatorsBorder" Value="{mbts:BTSColor Name=header_alternate}"/>
<Setter Property="Background" TargetName="HeaderBorder" Value="{u:BTSColor Name=header_alternate}"/>
<Setter Property="Background" TargetName="OperatorsBorder" Value="{u:BTSColor Name=header_alternate}"/>
<Setter Property="Visibility" TargetName="PART_HeaderGripper" Value="Hidden"/>
<Setter Property="Margin" TargetName="HeaderContent" Value="1,1,0,0"/>
</Trigger>
@@ -244,15 +243,15 @@
<Setter Property="MinHeight" Value="20"/>
</Trigger>
<!--Filter Active-->
<DataTrigger Binding="{Binding Path='Column.(bts:DataGridFilterProperties.FilterActive)', RelativeSource={RelativeSource Self}}" Value="True">
<DataTrigger Binding="{Binding Path='Column.(c:DataGridFilterProperties.FilterActive)', RelativeSource={RelativeSource Self}}" Value="True">
<Setter TargetName="HeaderContent" Property="Margin" Value="0,0,11,0"/>
<Setter TargetName="FilterPopupImage" Property="Source" Value="{x:Static mbts:Icons.FilterActive}"/>
<Setter TargetName="FilterPopupImage" Property="Source" Value="{x:Static u:Icons.FilterActive}"/>
<Setter TargetName="FilterPopupImage" Property="Opacity" Value="1.0"/>
<Setter Property="Grid.Column" TargetName="SortArrow" Value="0"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path='Column.(bts:DataGridFilterProperties.FilterActive)', RelativeSource={RelativeSource Self}}" Value="{x:Null}">
<DataTrigger Binding="{Binding Path='Column.(c:DataGridFilterProperties.FilterActive)', RelativeSource={RelativeSource Self}}" Value="{x:Null}">
<Setter TargetName="HeaderContent" Property="Margin" Value="0,0,11,0"/>
<Setter TargetName="FilterPopupImage" Property="Source" Value="{x:Static mbts:Icons.FilterError}"/>
<Setter TargetName="FilterPopupImage" Property="Source" Value="{x:Static u:Icons.FilterError}"/>
<Setter TargetName="FilterPopupImage" Property="Opacity" Value="1.0"/>
<Setter Property="Grid.Column" TargetName="SortArrow" Value="0"/>
</DataTrigger>
@@ -281,10 +280,10 @@
<Setter.Value>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Background" Value="{mbts:BTSColor Name=header}"/>
<Setter Property="Foreground" Value="{mbts:BTSColor Name=header_text}"/>
<Setter Property="Background" Value="{u:BTSColor Name=header}"/>
<Setter Property="Foreground" Value="{u:BTSColor Name=header_text}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="{ui:Brush Color={ui:Color Name=Grid.grid_vertical_group_separator}}"/>
<Setter Property="BorderBrush" Value="{u:Brush Color={u:Color Name=Grid.grid_vertical_group_separator}}"/>
<Setter Property="BorderThickness" Value="0,0,2,0"/>
<Setter Property="Margin" Value="0,0,0,-1"/>
<Setter Property="FontWeight" Value="Bold"/>
@@ -309,7 +308,7 @@
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type bts:DIYGrid}">
<ControlTemplate TargetType="{x:Type c:DIYGrid}">
<Grid>
<Grid.ColumnDefinitions>
<!-- Frozen -->
@@ -323,9 +322,9 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- fill the space above the frozen columns -->
<Rectangle Fill="{mbts:BTSColor Name=header}" Height="{Binding Path=ActualHeight, ElementName=_super_headers}" HorizontalAlignment="Stretch" Margin="0,0,-1,-1"/>
<Rectangle x:Name="_super_header_frozen" Fill="{u:BTSColor Name=header}" Height="{Binding Path=ActualHeight, ElementName=_super_headers}" HorizontalAlignment="Stretch" Margin="0,0,-1,-1"/>
<!-- colums set in code behind -->
<GridViewHeaderRowPresenter x:Name="_header_frozen" Grid.Row="1" Grid.Column="0" AllowsColumnReorder="False" VerticalAlignment="Bottom" ColumnHeaderContainerStyle="{TemplateBinding ColumnHeaderStyle}" UseLayoutRounding="True"/>
<GridViewHeaderRowPresenter x:Name="_header_frozen" Grid.Row="1" Grid.Column="0" AllowsColumnReorder="False" VerticalAlignment="Bottom" ColumnHeaderContainerStyle="{TemplateBinding ColumnHeaderStyle}"/>
<ScrollViewer
x:Name="_header_scroll_viewer"
Grid.Column="1"
@@ -337,13 +336,13 @@
>
<!-- setting the bg color for this stackpanel is a work-around for the vertical white lines that appear on high-dpi displays between some columns -->
<!-- in reality, there is some high dpi rounding thing going on, but that's a battle for another day -->
<StackPanel Background="{mbts:BTSColor Name=header}">
<StackPanel Background="{u:BTSColor Name=header}">
<!-- We don't need super headers over the fixed columns -->
<StackPanel Orientation="Horizontal" x:Name="_super_headers"/>
<GridViewHeaderRowPresenter x:Name="_header_scroll" AllowsColumnReorder="False" ColumnHeaderContainerStyle="{TemplateBinding ColumnHeaderStyle}" UseLayoutRounding="True"/>
</StackPanel>
</ScrollViewer>
<bts:DIYGridRowsPresenter
<c:DIYGridRowsPresenter
x:Name="_row_presenter"
Grid.Row="2"
Grid.ColumnSpan="2"
@@ -360,21 +359,21 @@
SelectedItem="{Binding CurrentRow, RelativeSource={RelativeSource TemplatedParent}}"
SelectionMode="{TemplateBinding SelectionMode}"
>
<bts:DIYGridRowsPresenter.Resources>
<c:DIYGridRowsPresenter.Resources>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource DIYGridRowStyle}"/>
</bts:DIYGridRowsPresenter.Resources>
<bts:DIYGridRowsPresenter.Template>
<ControlTemplate TargetType="{x:Type bts:DIYGridRowsPresenter}">
</c:DIYGridRowsPresenter.Resources>
<c:DIYGridRowsPresenter.Template>
<ControlTemplate TargetType="{x:Type c:DIYGridRowsPresenter}">
<ScrollViewer Focusable="False">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</ControlTemplate>
</bts:DIYGridRowsPresenter.Template>
</bts:DIYGridRowsPresenter>
</c:DIYGridRowsPresenter.Template>
</c:DIYGridRowsPresenter>
<ScrollBar Grid.Row="3" Grid.Column="1" Orientation="Horizontal" LargeChange="10" x:Name="_scroll_horiz" Visibility="{TemplateBinding RowsHorizontalScrollBarVisibility}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary>