|
|
|
@ -2,7 +2,226 @@
@@ -2,7 +2,226 @@
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
|
xmlns:AvalonEdit="clr-namespace:ICSharpCode.AvalonEdit" |
|
|
|
|
xmlns:editing="clr-namespace:ICSharpCode.AvalonEdit.Editing" |
|
|
|
|
xmlns:rendering="clr-namespace:ICSharpCode.AvalonEdit.Rendering" |
|
|
|
|
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<LinearGradientBrush x:Key="VerticalScrollBarBackground" EndPoint="1,0" StartPoint="0,0"> |
|
|
|
|
<GradientStop Color="#E1E1E1" Offset="0"/> |
|
|
|
|
<GradientStop Color="#EDEDED" Offset="0.20"/> |
|
|
|
|
<GradientStop Color="#EDEDED" Offset="0.80"/> |
|
|
|
|
<GradientStop Color="#E3E3E3" Offset="1"/> |
|
|
|
|
</LinearGradientBrush> |
|
|
|
|
<SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4"/> |
|
|
|
|
<Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}"> |
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/> |
|
|
|
|
<Setter Property="Focusable" Value="false"/> |
|
|
|
|
<Setter Property="IsTabStop" Value="false"/> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}"> |
|
|
|
|
<Themes:ScrollChrome x:Name="Chrome" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" SnapsToDevicePixels="true" Themes:ScrollChrome.ScrollGlyph="{TemplateBinding Themes:ScrollChrome.ScrollGlyph}"/> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> |
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/> |
|
|
|
|
<Setter Property="Background" Value="Transparent"/> |
|
|
|
|
<Setter Property="Focusable" Value="false"/> |
|
|
|
|
<Setter Property="IsTabStop" Value="false"/> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}"> |
|
|
|
|
<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
|
|
|
|
|
<LinearGradientBrush x:Key="HorizontalScrollBarBackground" EndPoint="0,1" StartPoint="0,0"> |
|
|
|
|
<GradientStop Color="#E1E1E1" Offset="0"/> |
|
|
|
|
<GradientStop Color="#EDEDED" Offset="0.20"/> |
|
|
|
|
<GradientStop Color="#EDEDED" Offset="0.80"/> |
|
|
|
|
<GradientStop Color="#E3E3E3" Offset="1"/> |
|
|
|
|
</LinearGradientBrush> |
|
|
|
|
<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> |
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/> |
|
|
|
|
<Setter Property="Background" Value="Transparent"/> |
|
|
|
|
<Setter Property="Focusable" Value="false"/> |
|
|
|
|
<Setter Property="IsTabStop" Value="false"/> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}"> |
|
|
|
|
<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
|
|
|
|
|
<Style x:Key="MapScrollBarThumb" |
|
|
|
|
TargetType="{x:Type Thumb}"> |
|
|
|
|
<Setter Property="SnapsToDevicePixels" |
|
|
|
|
Value="True" /> |
|
|
|
|
<Setter Property="OverridesDefaultStyle" |
|
|
|
|
Value="true" /> |
|
|
|
|
<Setter Property="IsTabStop" |
|
|
|
|
Value="false" /> |
|
|
|
|
<Setter Property="Focusable" |
|
|
|
|
Value="false" /> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="{x:Type Thumb}"> |
|
|
|
|
<Border CornerRadius="2" |
|
|
|
|
Background="Transparent" |
|
|
|
|
BorderBrush="Black" |
|
|
|
|
BorderThickness="1" Margin="0,0,1,0" /> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
|
|
|
|
|
<Style x:Key="MapScrollBar" TargetType="{x:Type ScrollBar}"> |
|
|
|
|
<Setter Property="Background" Value="{StaticResource VerticalScrollBarBackground}"/> |
|
|
|
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> |
|
|
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/> |
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}"> |
|
|
|
|
<Grid x:Name="Bg" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
|
|
|
|
<Grid.RowDefinitions> |
|
|
|
|
<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/> |
|
|
|
|
<RowDefinition Height="0.00001*"/> |
|
|
|
|
<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/> |
|
|
|
|
</Grid.RowDefinitions> |
|
|
|
|
<Border Grid.Row="1"> |
|
|
|
|
<Border.Background> |
|
|
|
|
<VisualBrush Stretch="UniformToFill"> |
|
|
|
|
<VisualBrush.Visual> |
|
|
|
|
<rendering:TextView Document="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ScrollViewer}}, Path=Content.Document}"/> |
|
|
|
|
</VisualBrush.Visual> |
|
|
|
|
</VisualBrush> |
|
|
|
|
</Border.Background> |
|
|
|
|
</Border> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.LineUpCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}" Themes:ScrollChrome.ScrollGlyph="UpArrow"/> |
|
|
|
|
<Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1"> |
|
|
|
|
<Track.DecreaseRepeatButton> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> |
|
|
|
|
</Track.DecreaseRepeatButton> |
|
|
|
|
<Track.IncreaseRepeatButton> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> |
|
|
|
|
</Track.IncreaseRepeatButton> |
|
|
|
|
<Track.Thumb> |
|
|
|
|
<Thumb Style="{StaticResource MapScrollBarThumb}" Themes:ScrollChrome.ScrollGlyph="VerticalGripper"/> |
|
|
|
|
</Track.Thumb> |
|
|
|
|
</Track> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.LineDownCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="2" Style="{StaticResource ScrollBarButton}" Themes:ScrollChrome.ScrollGlyph="DownArrow"/> |
|
|
|
|
</Grid> |
|
|
|
|
<ControlTemplate.Triggers> |
|
|
|
|
<Trigger Property="IsEnabled" Value="false"> |
|
|
|
|
<Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> |
|
|
|
|
</Trigger> |
|
|
|
|
</ControlTemplate.Triggers> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
<Style.Triggers> |
|
|
|
|
<Trigger Property="Orientation" Value="Horizontal"> |
|
|
|
|
<Setter Property="Width" Value="Auto"/> |
|
|
|
|
<Setter Property="MinWidth" Value="0"/> |
|
|
|
|
<Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/> |
|
|
|
|
<Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/> |
|
|
|
|
<Setter Property="Background" Value="{StaticResource HorizontalScrollBarBackground}"/> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}"> |
|
|
|
|
<Grid x:Name="Bg" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/> |
|
|
|
|
<ColumnDefinition Width="0.00001*"/> |
|
|
|
|
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/> |
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}" Themes:ScrollChrome.ScrollGlyph="LeftArrow"/> |
|
|
|
|
<Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}"> |
|
|
|
|
<Track.DecreaseRepeatButton> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> |
|
|
|
|
</Track.DecreaseRepeatButton> |
|
|
|
|
<Track.IncreaseRepeatButton> |
|
|
|
|
<RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> |
|
|
|
|
</Track.IncreaseRepeatButton> |
|
|
|
|
<Track.Thumb> |
|
|
|
|
<Thumb Style="{StaticResource MapScrollBarThumb}" Themes:ScrollChrome.ScrollGlyph="HorizontalGripper"/> |
|
|
|
|
</Track.Thumb> |
|
|
|
|
</Track> |
|
|
|
|
<RepeatButton Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}" Themes:ScrollChrome.ScrollGlyph="RightArrow"/> |
|
|
|
|
</Grid> |
|
|
|
|
<ControlTemplate.Triggers> |
|
|
|
|
<Trigger Property="IsEnabled" Value="false"> |
|
|
|
|
<Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> |
|
|
|
|
</Trigger> |
|
|
|
|
</ControlTemplate.Triggers> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Trigger> |
|
|
|
|
</Style.Triggers> |
|
|
|
|
</Style> |
|
|
|
|
|
|
|
|
|
<Style TargetType="ScrollViewer" x:Key="MapScrollViewer"> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="ScrollViewer"> |
|
|
|
|
<Border CornerRadius="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> |
|
|
|
|
<Grid Background="{TemplateBinding Background}"> |
|
|
|
|
<Grid.RowDefinitions> |
|
|
|
|
<RowDefinition Height="*"/> |
|
|
|
|
<RowDefinition Height="Auto"/> |
|
|
|
|
</Grid.RowDefinitions> |
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
<ColumnDefinition Width="*"/> |
|
|
|
|
<ColumnDefinition Width="Auto"/> |
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
|
|
|
|
|
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" |
|
|
|
|
CanContentScroll="{TemplateBinding CanContentScroll}" |
|
|
|
|
Cursor="{TemplateBinding Cursor}" |
|
|
|
|
Margin="{TemplateBinding Padding}" |
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"/> |
|
|
|
|
|
|
|
|
|
<Rectangle Grid.Column="1" Grid.Row="1" Fill="#FFE9EEF4"/> |
|
|
|
|
|
|
|
|
|
<ScrollBar x:Name="PART_VerticalScrollBar" Width="50" |
|
|
|
|
AutomationProperties.AutomationId="VerticalScrollBar" |
|
|
|
|
IsTabStop="False" |
|
|
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" |
|
|
|
|
Grid.Column="1" Grid.Row="0" Orientation="Vertical" |
|
|
|
|
ViewportSize="{TemplateBinding ViewportHeight}" |
|
|
|
|
Maximum="{TemplateBinding ScrollableHeight}" |
|
|
|
|
Minimum="0" |
|
|
|
|
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
|
Style="{StaticResource MapScrollBar}" |
|
|
|
|
Margin="0,-1,-1,-1"/> |
|
|
|
|
|
|
|
|
|
<ScrollBar x:Name="PART_HorizontalScrollBar" Height="18" |
|
|
|
|
AutomationProperties.AutomationId="HorizontalScrollBar" |
|
|
|
|
IsTabStop="False" |
|
|
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" |
|
|
|
|
Grid.Column="0" Grid.Row="1" Orientation="Horizontal" |
|
|
|
|
ViewportSize="{TemplateBinding ViewportWidth}" |
|
|
|
|
Maximum="{TemplateBinding ScrollableWidth}" |
|
|
|
|
Minimum="0" |
|
|
|
|
Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
|
Margin="-1,0,-1,-1"/> |
|
|
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
</Border> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|
</Setter> |
|
|
|
|
</Style> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Style TargetType="{x:Type AvalonEdit:TextEditor}"> |
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" /> |
|
|
|
|
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" /> |
|
|
|
@ -31,6 +250,10 @@
@@ -31,6 +250,10 @@
|
|
|
|
|
Property="HorizontalScrollBarVisibility" |
|
|
|
|
Value="Disabled" /> |
|
|
|
|
</Trigger> |
|
|
|
|
<Trigger Property="UseMapScrollbar" Value="True"> |
|
|
|
|
<Setter Property="Style" TargetName="PART_ScrollViewer" |
|
|
|
|
Value="{StaticResource MapScrollViewer}" /> |
|
|
|
|
</Trigger> |
|
|
|
|
</ControlTemplate.Triggers> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
</Setter.Value> |
|
|
|
|