#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

169 lines
5.7 KiB

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView"
xmlns:Converters="clr-namespace:ICSharpCode.WpfDesign.Designer.Converters"
>
<Converters:LevelConverter x:Key="LevelConverter" />
<Style TargetType="{x:Type Default:IconItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:IconItem}">
<StackPanel Orientation="Horizontal">
<Image Source="{TemplateBinding Icon}"
Stretch="None" />
<TextBlock Text="{TemplateBinding Text}"
VerticalAlignment="Center"
Margin="5 0 0 0" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpandButtonStyle"
TargetType="ToggleButton">
<Setter Property="Focusable"
Value="False" />
<Setter Property="ClickMode"
Value="Press" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent">
<Border Width="9"
Height="9"
SnapsToDevicePixels="true"
BorderBrush="#FF7898B5"
BorderThickness="1"
CornerRadius="1">
<Border.Background>
<LinearGradientBrush EndPoint="1,1"
StartPoint="0,0">
<GradientStop Color="White"
Offset=".2" />
<GradientStop Color="#FFC0B7A6"
Offset="1" />
</LinearGradientBrush>
</Border.Background>
<Path Margin="1,1,1,1"
x:Name="ExpandPath"
Fill="Black"
Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Data"
TargetName="ExpandPath"
Value="M 0 2 L 0 3 L 5 3 L 5 2 Z" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Brush x:Key="InsertBrush">#FFC73C</Brush>
<Style TargetType="{x:Type Default:DragTreeView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:DragTreeView}">
<Grid Background="White">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<ItemsPresenter />
</ScrollViewer>
<Border x:Name="PART_InsertLine"
Background="{StaticResource InsertBrush}"
Height="2"
Width="50"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Visibility="Collapsed"
IsHitTestVisible="False" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="Foreground"
Value="{x:Static SystemColors.ControlTextBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:DragTreeViewItem}">
<DockPanel Background="White">
<Grid x:Name="bg"
Margin="{TemplateBinding Level, Converter={StaticResource LevelConverter}}"
DockPanel.Dock="Top"
Background="{TemplateBinding Background}">
<ToggleButton HorizontalAlignment="Left" x:Name="expandButton"
Style="{StaticResource ExpandButtonStyle}"
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
<Border x:Name="contentBorder"
Margin="11,0,0,0"
HorizontalAlignment="Stretch">
<ContentPresenter x:Name="PART_Header"
ContentSource="Header" />
</Border>
</Grid>
<ItemsPresenter x:Name="itemsHost" />
<DockPanel.ContextMenu>
<ContextMenu>
<MenuItem Command="ApplicationCommands.Cut" />
<MenuItem Command="ApplicationCommands.Copy" />
<MenuItem Command="ApplicationCommands.Paste" />
<Separator />
<MenuItem Command="ApplicationCommands.Delete" />
</ContextMenu>
</DockPanel.ContextMenu>
<DockPanel.ToolTip>
<ToolTip Background="White">
<Rectangle Width="50" Height="50">
<Rectangle.Fill>
<VisualBrush Stretch="Uniform" Visual="{Binding DesignItem.View}" />
</Rectangle.Fill>
</Rectangle>
</ToolTip>
</DockPanel.ToolTip>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded"
Value="False">
<Setter TargetName="itemsHost"
Property="Visibility"
Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems"
Value="False">
<Setter TargetName="expandButton"
Property="Visibility"
Value="Collapsed" />
</Trigger>
<Trigger Property="IsSelected"
Value="True">
<Setter TargetName="bg"
Property="Background"
Value="{x:Static SystemColors.HighlightBrush}" />
<Setter Property="Foreground"
Value="{x:Static SystemColors.HighlightTextBrush}" />
</Trigger>
<Trigger Property="IsDragHover"
Value="True">
<Setter TargetName="contentBorder"
Property="Background"
Value="{StaticResource InsertBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>