Browse Source

Move OutlineTreeView into WpfDesign.Designer.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3498 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
22cb860681
  1. 1
      samples/XamlDesigner/Document.cs
  2. 9
      samples/XamlDesigner/ExtensionMethods.cs
  3. 5
      samples/XamlDesigner/MainWindow.xaml
  4. 29
      samples/XamlDesigner/Outline.xaml
  5. 145
      samples/XamlDesigner/Themes/Generic.xaml
  6. 5
      samples/XamlDesigner/ToolboxView.xaml
  7. 7
      samples/XamlDesigner/ToolboxView.xaml.cs
  8. 14
      samples/XamlDesigner/XamlDesigner.csproj
  9. 9
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ExtensionMethods.cs
  10. BIN
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/Tag.png
  11. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragListener.cs
  12. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeView.cs
  13. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeViewItem.cs
  14. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/IconItem.cs
  15. 28
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml
  16. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs
  17. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs
  18. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs
  19. 151
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineView.xaml
  20. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
  21. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml
  22. 2
      src/Main/Base/Project/Src/Project/CustomTool.cs

1
samples/XamlDesigner/Document.cs

@ -6,6 +6,7 @@ using System.ComponentModel;
using System.IO; using System.IO;
using ICSharpCode.WpfDesign.Designer; using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.Designer.Xaml; using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.Designer.OutlineView;
using System.Xml; using System.Xml;
using ICSharpCode.WpfDesign; using ICSharpCode.WpfDesign;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;

9
samples/XamlDesigner/ExtensionMethods.cs

@ -29,15 +29,6 @@ namespace ICSharpCode.XamlDesigner
return (T)data.GetData(typeof(T).FullName); return (T)data.GetData(typeof(T).FullName);
} }
public static T FindAncestor<T>(this DependencyObject d) where T : class
{
while (true) {
if (d == null) return null;
if (d is T) return d as T;
d = VisualTreeHelper.GetParent(d);
}
}
public static Stream ToStream(this string s) public static Stream ToStream(this string s)
{ {
return new MemoryStream(Encoding.UTF8.GetBytes(s)); return new MemoryStream(Encoding.UTF8.GetBytes(s));

5
samples/XamlDesigner/MainWindow.xaml

@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sd="http://sharpdevelop.net" xmlns:sd="http://sharpdevelop.net"
xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:Outline="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner" xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
SnapsToDevicePixels="True" SnapsToDevicePixels="True"
AllowDrop="True" AllowDrop="True"
@ -94,7 +95,7 @@
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content2" Title="Outline"> <AvalonDock:DockableContent x:Name="content2" Title="Outline">
<Default:Outline Root="{Binding CurrentDocument.OutlineRoot}"/> <Outline:Outline Root="{Binding CurrentDocument.OutlineRoot}"/>
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
@ -113,7 +114,5 @@
</AvalonDock:ResizingPanel> </AvalonDock:ResizingPanel>
</AvalonDock:DockingManager> </AvalonDock:DockingManager>
</DockPanel> </DockPanel>
</Window> </Window>

29
samples/XamlDesigner/Outline.xaml

@ -1,29 +0,0 @@
<UserControl x:Class="ICSharpCode.XamlDesigner.Outline"
x:Name="root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
xmlns:Converters="clr-namespace:ICSharpCode.XamlDesigner.Converters">
<UserControl.Resources>
<HierarchicalDataTemplate DataType="{x:Type Default:OutlineNode}"
ItemsSource="{Binding Children}">
<Default:IconItem Icon="Images/Tag.png"
Text="{Binding Name}" />
</HierarchicalDataTemplate>
</UserControl.Resources>
<Default:OutlineTreeView Root="{Binding Root, ElementName=root}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="IsSelected"
Value="{Binding IsSelected}" />
<Setter Property="IsExpanded"
Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>
</ItemsControl.ItemContainerStyle>
</Default:OutlineTreeView>
</UserControl>

145
samples/XamlDesigner/Themes/Generic.xaml

@ -3,149 +3,4 @@
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner" xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
xmlns:Converters="clr-namespace:ICSharpCode.XamlDesigner.Converters"> xmlns:Converters="clr-namespace:ICSharpCode.XamlDesigner.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>
<Brush x:Key="InsertBrush">#FFC73C</Brush>
<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>
<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">
<DockPanel x:Name="bg"
DockPanel.Dock="Top"
Background="{TemplateBinding Background}">
<ToggleButton x:Name="expandButton"
Style="{StaticResource ExpandButtonStyle}"
DockPanel.Dock="Left"
Margin="{TemplateBinding Level, Converter={StaticResource LevelConverter}}"
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
<Border x:Name="contentBorder"
HorizontalAlignment="Left">
<ContentPresenter x:Name="PART_Header"
ContentSource="Header" />
</Border>
</DockPanel>
<ItemsPresenter x:Name="itemsHost" />
</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="Hidden" />
</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> </ResourceDictionary>

5
samples/XamlDesigner/ToolboxView.xaml

@ -1,18 +1,19 @@
<UserControl x:Class="ICSharpCode.XamlDesigner.ToolboxView" <UserControl x:Class="ICSharpCode.XamlDesigner.ToolboxView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Outline="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"> xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner">
<UserControl.Resources> <UserControl.Resources>
<HierarchicalDataTemplate DataType="{x:Type Default:AssemblyNode}" <HierarchicalDataTemplate DataType="{x:Type Default:AssemblyNode}"
ItemsSource="{Binding Controls}"> ItemsSource="{Binding Controls}">
<Default:IconItem Icon="Images/Reference.png" <Outline:IconItem Icon="Images/Reference.png"
Text="{Binding Name}" Text="{Binding Name}"
ToolTip="{Binding Path}" /> ToolTip="{Binding Path}" />
</HierarchicalDataTemplate> </HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type Default:ControlNode}"> <DataTemplate DataType="{x:Type Default:ControlNode}">
<Default:IconItem Icon="Images/Tag.png" <Outline:IconItem Icon="Images/Tag.png"
Text="{Binding Type.Name}" /> Text="{Binding Type.Name}" />
</DataTemplate> </DataTemplate>

7
samples/XamlDesigner/ToolboxView.xaml.cs

@ -1,6 +1,10 @@
using ICSharpCode.WpfDesign.Designer.OutlineView;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -11,9 +15,6 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Reflection;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner

14
samples/XamlDesigner/XamlDesigner.csproj

@ -108,21 +108,11 @@
<Compile Include="DocumentView.xaml.cs"> <Compile Include="DocumentView.xaml.cs">
<DependentUpon>DocumentView.xaml</DependentUpon> <DependentUpon>DocumentView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="DragListener.cs" />
<Compile Include="DragTreeView.cs" />
<Compile Include="DragTreeViewItem.cs" />
<Compile Include="ErrorListView.xaml.cs"> <Compile Include="ErrorListView.xaml.cs">
<DependentUpon>ErrorListView.xaml</DependentUpon> <DependentUpon>ErrorListView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ExtensionMethods.cs" /> <Compile Include="ExtensionMethods.cs" />
<Compile Include="IconItem.cs" />
<Compile Include="MainWindow_Commands.cs" /> <Compile Include="MainWindow_Commands.cs" />
<Compile Include="Outline.xaml.cs">
<DependentUpon>Outline.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="OutlineNode.cs" />
<Compile Include="OutlineTreeView.cs" />
<Compile Include="Shell.cs" /> <Compile Include="Shell.cs" />
<Compile Include="MainWindow.xaml.cs"> <Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
@ -161,10 +151,6 @@
<None Include="TestFiles\2.xaml"> <None Include="TestFiles\2.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</None> </None>
<Page Include="Outline.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<None Include="TestFiles\3.xaml"> <None Include="TestFiles\3.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</None> </None>

9
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ExtensionMethods.cs

@ -42,6 +42,15 @@ namespace ICSharpCode.WpfDesign.Designer
} }
} }
public static T FindAncestor<T>(this DependencyObject d) where T : class
{
while (true) {
if (d == null) return null;
if (d is T) return d as T;
d = VisualTreeHelper.GetParent(d);
}
}
public static T FindChild<T>(this DependencyObject d) where T : class public static T FindChild<T>(this DependencyObject d) where T : class
{ {
if (d is T) return d as T; if (d is T) return d as T;

BIN
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/Tag.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

2
samples/XamlDesigner/DragListener.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragListener.cs

@ -5,7 +5,7 @@ using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class DragListener public class DragListener
{ {

3
samples/XamlDesigner/DragTreeView.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeView.cs

@ -12,10 +12,9 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Collections.Specialized; using System.Collections.Specialized;
using ICSharpCode.XamlDesigner.Converters;
using System.Collections; using System.Collections;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
// limitations: // limitations:
// - Do not use ItemsSource (use Root) // - Do not use ItemsSource (use Root)

2
samples/XamlDesigner/DragTreeViewItem.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeViewItem.cs

@ -13,7 +13,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class DragTreeViewItem : TreeViewItem public class DragTreeViewItem : TreeViewItem
{ {

2
samples/XamlDesigner/IconItem.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/IconItem.cs

@ -6,7 +6,7 @@ using System.Windows.Controls;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class IconItem : Control public class IconItem : Control
{ {

28
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml

@ -0,0 +1,28 @@
<UserControl x:Class="ICSharpCode.WpfDesign.Designer.OutlineView.Outline"
x:Name="root"
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">
<UserControl.Resources>
<HierarchicalDataTemplate DataType="{x:Type Default:OutlineNode}"
ItemsSource="{Binding Children}">
<Default:IconItem Icon="../Images/Tag.png"
Text="{Binding Name}" />
</HierarchicalDataTemplate>
</UserControl.Resources>
<Default:OutlineTreeView Root="{Binding Root, ElementName=root}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="IsSelected"
Value="{Binding IsSelected}" />
<Setter Property="IsExpanded"
Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>
</ItemsControl.ItemContainerStyle>
</Default:OutlineTreeView>
</UserControl>

2
samples/XamlDesigner/Outline.xaml.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs

@ -12,7 +12,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public partial class Outline public partial class Outline
{ {

2
samples/XamlDesigner/OutlineNode.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs

@ -9,7 +9,7 @@ using System.Collections;
using ICSharpCode.WpfDesign.Designer; using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.XamlDom; using ICSharpCode.WpfDesign.XamlDom;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class OutlineNode : INotifyPropertyChanged public class OutlineNode : INotifyPropertyChanged
{ {

2
samples/XamlDesigner/OutlineTreeView.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class OutlineTreeView : DragTreeView public class OutlineTreeView : DragTreeView
{ {

151
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineView.xaml

@ -0,0 +1,151 @@
<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">
<DockPanel x:Name="bg"
DockPanel.Dock="Top"
Background="{TemplateBinding Background}">
<ToggleButton x:Name="expandButton"
Style="{StaticResource ExpandButtonStyle}"
DockPanel.Dock="Left"
Margin="{TemplateBinding Level, Converter={StaticResource LevelConverter}}"
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
<Border x:Name="contentBorder"
HorizontalAlignment="Left">
<ContentPresenter x:Name="PART_Header"
ContentSource="Header" />
</Border>
</DockPanel>
<ItemsPresenter x:Name="itemsHost" />
</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="Hidden" />
</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>

18
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

@ -116,6 +116,17 @@
<Compile Include="Extensions\ResizeThumbExtension.cs" /> <Compile Include="Extensions\ResizeThumbExtension.cs" />
<Compile Include="Extensions\WindowResizeBehavior.cs" /> <Compile Include="Extensions\WindowResizeBehavior.cs" />
<Compile Include="BasicMetadata.cs" /> <Compile Include="BasicMetadata.cs" />
<Compile Include="OutlineView\DragListener.cs" />
<Compile Include="OutlineView\DragTreeView.cs" />
<Compile Include="OutlineView\DragTreeViewItem.cs" />
<Compile Include="OutlineView\IconItem.cs" />
<Compile Include="OutlineView\Outline.xaml.cs">
<DependentUpon>Outline.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="OutlineView\OutlineNode.cs">
</Compile>
<Compile Include="OutlineView\OutlineTreeView.cs" />
<Compile Include="PropertyGrid\Editors\BoolEditor.xaml.cs"> <Compile Include="PropertyGrid\Editors\BoolEditor.xaml.cs">
<DependentUpon>BoolEditor.xaml</DependentUpon> <DependentUpon>BoolEditor.xaml</DependentUpon>
</Compile> </Compile>
@ -186,6 +197,7 @@
<Compile Include="Xaml\XamlDesignItem.cs" /> <Compile Include="Xaml\XamlDesignItem.cs" />
<Compile Include="Xaml\XamlModelProperty.cs" /> <Compile Include="Xaml\XamlModelProperty.cs" />
<Compile Include="Xaml\XamlModelPropertyCollection.cs" /> <Compile Include="Xaml\XamlModelPropertyCollection.cs" />
<Resource Include="Images\Tag.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj"> <ProjectReference Include="..\..\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj">
@ -212,6 +224,11 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="OutlineView\Outline.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OutlineView\OutlineView.xaml" />
<Page Include="PropertyGrid\Editors\BoolEditor.xaml"> <Page Include="PropertyGrid\Editors\BoolEditor.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -267,6 +284,7 @@
<Page Include="Themes\Generic.xaml"> <Page Include="Themes\Generic.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Folder Include="OutlineView" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Images\Class.png" /> <Resource Include="Images\Class.png" />

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml

@ -2,5 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/Controls/ControlStyles.xaml" /> <ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/Controls/ControlStyles.xaml" />
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/OutlineView/OutlineView.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

2
src/Main/Base/Project/Src/Project/CustomTool.cs

@ -375,7 +375,9 @@ namespace ICSharpCode.SharpDevelop.Project
ICustomTool customTool = GetCustomTool(baseItem.CustomTool); ICustomTool customTool = GetCustomTool(baseItem.CustomTool);
if (customTool == null) { if (customTool == null) {
string message = "Cannot find custom tool '" + baseItem.CustomTool + "'."; string message = "Cannot find custom tool '" + baseItem.CustomTool + "'.";
if (!baseItem.CustomTool.StartsWith("MSBuild:")) {
CustomToolContext.StaticMessageView.AppendLine(message); CustomToolContext.StaticMessageView.AppendLine(message);
}
if (showMessageBoxOnErrors) { if (showMessageBoxOnErrors) {
MessageService.ShowError(message); MessageService.ShowError(message);
} }

Loading…
Cancel
Save