1 <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="{x:Type ScrollViewer}"> 2 <Setter Property="Focusable" Value="false"/> 3
1 <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="{x:Type ScrollViewer}"> 2 <Setter Property="Focusable" Value="false"/> 3 <Setter Property="Template"> 4 <Setter.Value> 5 <ControlTemplate TargetType="{x:Type ScrollViewer}"> 6 <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> 7 <Grid.ColumnDefinitions> 8 <ColumnDefinition Width="*"/> 9 <ColumnDefinition Width="Auto"/> 10 </Grid.ColumnDefinitions> 11 <Grid.RowDefinitions> 12 <RowDefinition Height="*"/> 13 <RowDefinition Height="Auto"/> 14 </Grid.RowDefinitions> 15 <DockPanel Margin="{TemplateBinding Padding}"> 16 <ScrollViewer DockPanel.Dock="Top" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> 17 <GridViewHeaderRowPresenter AllowsColumnReorder="{Binding TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContainerStyle="{Binding TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderToolTip="{Binding TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderStringFormat="{Binding TemplatedParent.View.ColumnHeaderStringFormat, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContextMenu="{Binding TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderTemplate="{Binding TemplatedParent.View.ColumnHeaderTemplate, RelativeSource={RelativeSource TemplatedParent}}" Columns="{Binding TemplatedParent.View.Columns, RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderTemplateSelector="{Binding TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> 18 </ScrollViewer> 19 <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" KeyboardNavigation.DirectionalNavigation="Local" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> 20 </DockPanel> 21 <ScrollBar x:Name="PART_HorizontalScrollBar" Cursor="Arrow" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0.0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Style="{DynamicResource ScrollBarStyle}"/> 22 <ScrollBar x:Name="PART_VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0.0" Orientation="Vertical" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource ScrollBarStyle}"/> 23 </Grid> 24 </ControlTemplate> 25 </Setter.Value> 26 </Setter> 27 </Style> 28 <Style x:Key="ListViewStyle1" TargetType="{x:Type ListView}"> 29 <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> 30 <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> 31 <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> 32 <Setter Property="ScrollViewer.PanningMode" Value="Both"/> 33 <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> 34 <Setter Property="Template"> 35 <Setter.Value> 36 <ControlTemplate TargetType="{x:Type ListView}"> 37 <ScrollViewer Padding="{TemplateBinding Padding}" Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}"> 38 <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> 39 </ScrollViewer> 40 <ControlTemplate.Triggers> 41 <MultiTrigger> 42 <MultiTrigger.Conditions> 43 <Condition Property="IsGrouping" Value="true"/> 44 <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> 45 </MultiTrigger.Conditions> 46 <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> 47 </MultiTrigger> 48 </ControlTemplate.Triggers> 49 </ControlTemplate> 50 </Setter.Value> 51 </Setter> 52 </Style> 53 <Style TargetType="{x:Type ListViewItem}"> 54 <Setter Property="Template" > 55 <Setter.Value> 56 <ControlTemplate TargetType="{x:Type ListBoxItem}"> 57 <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True"> 58 <GridViewRowPresenter VerticalAlignment="Center" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> 59 </Border> 60 <ControlTemplate.Triggers> 61 <Trigger Property="IsSelected" Value="True"> 62 <Setter Property="BorderThickness" TargetName="Bd" Value="2"></Setter> 63 <Setter Property="BorderBrush" TargetName="Bd" Value="#FF866C"></Setter> 64 </Trigger> 65 <Trigger Property="IsMouseOver" Value="True"> 66 <Setter Property="BorderThickness" TargetName="Bd" Value="2"></Setter> 67 <Setter Property="BorderBrush" TargetName="Bd" Value="#FFEAE4"></Setter> 68 </Trigger> 69 <Trigger Property="Height" Value="Auto"> 70 <Setter Property="MinHeight" Value="35" /> 71 </Trigger> 72 <Trigger Property="IsEnabled" Value="False"> 73 <Setter Property="Opacity" Value="0.5"/> 74 </Trigger> 75 </ControlTemplate.Triggers> 76 </ControlTemplate> 77 </Setter.Value> 78 </Setter> 79 </Style> 80 <Style TargetType="{x:Type GridViewColumnHeader}"> 81 <Setter Property="Background" Value="#FFEAE4" /> 82 <Setter Property="Template" > 83 <Setter.Value> 84 <ControlTemplate TargetType="{x:Type GridViewColumnHeader}"> 85 <Grid SnapsToDevicePixels="True" > 86 <Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> 87 <Grid> 88 <Grid.RowDefinitions> 89 <RowDefinition MaxHeight="7"/> 90 <RowDefinition/> 91 </Grid.RowDefinitions> 92 <Border Padding="{TemplateBinding Padding}" Grid.RowSpan="2"> 93 <ContentPresenter x:Name="HeaderContent" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> 94 </Border> 95 </Grid> 96 </Border> 97 <Canvas> 98 <Thumb x:Name="PART_HeaderGripper"> 99 <Thumb.Style> 100 <Style TargetType="{x:Type Thumb}"> 101 <Setter Property="Canvas.Right" Value="-9"/> 102 <Setter Property="Width" Value="18"/> 103 <Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/> 104 <Setter Property="Padding" Value="0"/> 105 <Setter Property="Background" Value="White"/> 106 <Setter Property="Template"> 107 <Setter.Value> 108 <ControlTemplate TargetType="{x:Type Thumb}"> 109 <Border Background="Transparent" Padding="{TemplateBinding Padding}"> 110 <Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="1"/> 111 </Border> 112 </ControlTemplate> 113 </Setter.Value> 114 </Setter> 115 </Style> 116 </Thumb.Style> 117 </Thumb> 118 </Canvas> 119 </Grid> 120 <ControlTemplate.Triggers> 121 <Trigger Property="IsMouseOver" Value="True"> 122 <Setter Property="Background" TargetName="HeaderBorder" Value="#FF866B"/> 123 <Setter Property="Background" TargetName="PART_HeaderGripper" Value="Transparent"/> 124 </Trigger> 125 <Trigger Property="IsPressed" Value="True"> 126 <Setter Property="Background" TargetName="HeaderBorder" Value="#FF866B"/> 127 <Setter Property="Visibility" TargetName="PART_HeaderGripper" Value="Hidden"/> 128 </Trigger> 129 <Trigger Property="Height" Value="Auto"> 130 <Setter Property="MinHeight" Value="35"/> 131 </Trigger> 132 <Trigger Property="IsEnabled" Value="False"> 133 <Setter Property="Opacity" Value="0.5"/> 134 </Trigger> 135 </ControlTemplate.Triggers> 136 </ControlTemplate> 137 </Setter.Value> 138 </Setter> 139 </Style> 140 <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> 141 <Setter Property="OverridesDefaultStyle" Value="true"/> 142 <Setter Property="Background" Value="Transparent"/> 143 <Setter Property="Focusable" Value="false"/> 144 <Setter Property="IsTabStop" Value="false"/> 145 <Setter Property="Template"> 146 <Setter.Value> 147 <ControlTemplate TargetType="{x:Type RepeatButton}"> 148 <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> 149 </ControlTemplate> 150 </Setter.Value> 151 </Setter> 152 </Style> 153 <Style x:Key="VerticalScrollBarThumb" TargetType="{x:Type Thumb}"> 154 <Setter Property="OverridesDefaultStyle" Value="true"/> 155 <Setter Property="IsTabStop" Value="false"/> 156 <Setter Property="Template"> 157 <Setter.Value> 158 <ControlTemplate TargetType="{x:Type Thumb}"> 159 <Border x:Name="bd" Width="9" CornerRadius="5" Background="#D3D3D3"/> 160 <ControlTemplate.Triggers> 161 <Trigger Property="IsMouseOver" Value="True"> 162 <Setter Property="Background" TargetName="bd" Value="DarkGray" /> 163 </Trigger> 164 </ControlTemplate.Triggers> 165 </ControlTemplate> 166 </Setter.Value> 167 </Setter> 168 </Style> 169 <Style x:Key="HorizontalScrollBarThumb" TargetType="{x:Type Thumb}"> 170 <Setter Property="OverridesDefaultStyle" Value="true"/> 171 <Setter Property="IsTabStop" Value="false"/> 172 <Setter Property="Template"> 173 <Setter.Value> 174 <ControlTemplate TargetType="{x:Type Thumb}"> 175 <Border x:Name="bd" Height="9" CornerRadius="5" Background="#D3D3D3"/> 176 <ControlTemplate.Triggers> 177 <Trigger Property="IsMouseOver" Value="True"> 178 <Setter Property="Background" TargetName="bd" Value="DarkGray" /> 179 </Trigger> 180 </ControlTemplate.Triggers> 181 </ControlTemplate> 182 </Setter.Value> 183 </Setter> 184 </Style> 185 <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> 186 <Setter Property="OverridesDefaultStyle" Value="true"/> 187 <Setter Property="Background" Value="Transparent"/> 188 <Setter Property="Focusable" Value="false"/> 189 <Setter Property="IsTabStop" Value="false"/> 190 <Setter Property="Template"> 191 <Setter.Value> 192 <ControlTemplate TargetType="{x:Type RepeatButton}"> 193 <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> 194 </ControlTemplate> 195 </Setter.Value> 196 </Setter> 197 </Style> 198 199 <Style x:Key="VerticalScrollBarButtomButton" TargetType="{x:Type RepeatButton}"> 200 <Setter Property="OverridesDefaultStyle" Value="true"/> 201 <Setter Property="Focusable" Value="false"/> 202 <Setter Property="IsTabStop" Value="false"/> 203 <Setter Property="Template"> 204 <Setter.Value> 205 <ControlTemplate TargetType="{x:Type RepeatButton}"> 206 <Path x:Name="path" Data="M 4,6 L 13,6 L 8.5,13 Z" Fill="#D3D3D3" Stroke="#D3D3D3" /> 207 <ControlTemplate.Triggers> 208 <Trigger Property="IsMouseOver" Value="True"> 209 <Setter Property="Fill" TargetName="path" Value="DarkGray" /> 210 <Setter Property="Stroke" TargetName="path" Value="DarkGray" /> 211 </Trigger> 212 <Trigger Property="IsPressed" Value="True"> 213 <Setter Property="Fill" TargetName="path" Value="DarkGray" /> 214 <Setter Property="Stroke" TargetName="path" Value="DarkGray" /> 215 </Trigger> 216 </ControlTemplate.Triggers> 217 </ControlTemplate> 218 </Setter.Value> 219 </Setter> 220 </Style> 221 <Style x:Key="VerticalScrollBarTopButton" TargetType="{x:Type RepeatButton}"> 222 <Setter Property="OverridesDefaultStyle" Value="true"/> 223 <Setter Property="Focusable" Value="false"/> 224 <Setter Property="IsTabStop" Value="false"/> 225 <Setter Property="Template"> 226 <Setter.Value> 227 <ControlTemplate TargetType="{x:Type RepeatButton}"> 228 <Path x:Name="path" Data="M 4,10 L 13,10 L 8.5,3 Z" Fill="#D3D3D3" Stroke="#D3D3D3" /> 229 <ControlTemplate.Triggers> 230 <Trigger Property="IsMouseOver" Value="True"> 231 <Setter Property="Fill" TargetName="path" Value="DarkGray" /> 232 <Setter Property="Stroke" TargetName="path" Value="DarkGray" /> 233 </Trigger> 234 <Trigger Property="IsPressed" Value="True"> 235 <Setter Property="Fill" TargetName="path" Value="DarkGray" /> 236 <Setter Property="Stroke" TargetName="path" Value="DarkGray" /> 237 </Trigger> 238 </ControlTemplate.Triggers> 239 </ControlTemplate> 240 </Setter.Value> 241 </Setter> 242 </Style> 243 <Style x:Key="HorizontalScrollBarLeftButton" TargetType="{x:Type RepeatButton}"> 244 <Setter Property="OverridesDefaultStyle" Value="true"/> 245 <Setter Property="Focusable" Value="false"/> 246 <Setter Property="IsTabStop" Value="false"/> 247 <Setter Property="Template"> 248 <Setter.Value> 249 <ControlTemplate TargetType="{x:Type RepeatButton}"> 250 <Path x:Name="path" Data="M 10,4 L 10,13 L 3, 8.5 Z" Fill="#D3D3D3" Stroke="#D3D3D3" /> 251 <ControlTemplate.Triggers>