Browse Source

Create closeable pane for the analyzer.

pull/166/head
Daniel Grunwald 14 years ago
parent
commit
4489dd8289
  1. 83
      ILSpy/AnalyzerTreeView.cs
  2. 4
      ILSpy/ContextMenuEntry.cs
  3. 117
      ILSpy/Controls/DockedPane.cs
  4. 4
      ILSpy/ILSpy.csproj
  5. 30
      ILSpy/MainWindow.xaml
  6. 78
      ILSpy/MainWindow.xaml.cs
  7. 11
      ILSpy/SessionSettings.cs
  8. 10
      ILSpy/TreeNodes/Analyzer/AnalyzeContextMenuEntry.cs
  9. 90
      ILSpy/themes/generic.xaml

83
ILSpy/AnalyzerTreeView.cs

@ -0,0 +1,83 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.ILSpy.TreeNodes.Analyzer;
using ICSharpCode.TreeView;
namespace ICSharpCode.ILSpy
{
/// <summary>
/// Analyzer tree view.
/// </summary>
public partial class AnalyzerTreeView : SharpTreeView
{
static AnalyzerTreeView instance;
public static AnalyzerTreeView Instance {
get {
if (instance == null) {
App.Current.VerifyAccess();
instance = new AnalyzerTreeView();
}
return instance;
}
}
private AnalyzerTreeView()
{
this.ShowRoot = false;
this.Root = new AnalyzerTreeNode { Language = MainWindow.Instance.CurrentLanguage };
ContextMenuProvider.Add(this);
}
public void Show()
{
if (!IsVisible)
MainWindow.Instance.ShowInBottomPane("Analyzer", this);
}
public void Show(AnalyzerTreeNode node)
{
Show();
node.IsExpanded = true;
this.Root.Children.Add(node);
this.SelectedItem = node;
this.FocusNode(node);
}
}
[ExportMainMenuCommand(Menu = "_View", Header = "_Analyzer", MenuCategory = "ShowPane", MenuOrder = 100)]
sealed class ShowAnalyzerCommand : SimpleCommand
{
public override void Execute(object parameter)
{
AnalyzerTreeView.Instance.Show();
}
}
}

4
ILSpy/ContextMenuEntry.cs

@ -84,8 +84,10 @@ namespace ICSharpCode.ILSpy
void treeView_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
SharpTreeNode[] selectedNodes = treeView.GetTopLevelSelection().ToArray();
if (selectedNodes.Length == 0)
if (selectedNodes.Length == 0) {
e.Handled = true; // don't show the menu
return;
}
ContextMenu menu = new ContextMenu();
foreach (var category in entries.OrderBy(c => c.Metadata.Order).GroupBy(c => c.Metadata.Category)) {
if (menu.Items.Count > 0) {

117
ILSpy/Controls/DockedPane.cs

@ -0,0 +1,117 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
namespace ICSharpCode.ILSpy.Controls
{
class DockedPane : Control
{
static DockedPane()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DockedPane), new FrameworkPropertyMetadata(typeof(DockedPane)));
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register("Title", typeof(string), typeof(DockedPane));
public string Title {
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty ContentProperty =
DependencyProperty.Register("Content", typeof(object), typeof(DockedPane));
public object Content {
get { return GetValue(ContentProperty); }
set { SetValue(ContentProperty, value); }
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
Button closeButton = (Button)this.Template.FindName("PART_Close", this);
if (closeButton != null) {
closeButton.Click += closeButton_Click;
}
}
void closeButton_Click(object sender, RoutedEventArgs e)
{
if (CloseButtonClicked != null)
CloseButtonClicked(this, e);
}
public event EventHandler CloseButtonClicked;
protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
{
base.OnKeyDown(e);
if (!e.Handled && e.Key == Key.F4 && e.KeyboardDevice.Modifiers == ModifierKeys.Control) {
if (CloseButtonClicked != null)
CloseButtonClicked(this, e);
e.Handled = true;
}
}
}
[MarkupExtensionReturnType(typeof(Color))]
class ControlColor : MarkupExtension
{
float val;
/// <summary>
/// Amount of highlight (0..1)
/// </summary>
public float Highlight { get; set; }
/// <summary>
/// val: Color value in the range 105..255.
/// </summary>
public ControlColor(float val)
{
if (!(val >= 105 && val <= 255))
throw new ArgumentOutOfRangeException("val");
this.val = val;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (val > 227) {
return Interpolate(227, SystemColors.ControlLightColor, 255, SystemColors.ControlLightLightColor);
} else if (val > 160) {
return Interpolate(160, SystemColors.ControlDarkColor, 227, SystemColors.ControlLightColor);
} else {
return Interpolate(105, SystemColors.ControlDarkDarkColor, 160, SystemColors.ControlDarkColor);
}
}
Color Interpolate(float v1, Color c1, float v2, Color c2)
{
float v = (val - v1) / (v2 - v1);
Color c = c1 * (1 - v) + c2 * v;
return c * (1 - Highlight) + SystemColors.HighlightColor * Highlight;
}
}
}

4
ILSpy/ILSpy.csproj

@ -84,6 +84,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AboutPage.cs" />
<Compile Include="AnalyzerTreeView.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="App.xaml.cs">
<SubType>Code</SubType>
<DependentUpon>App.xaml</DependentUpon>
@ -94,6 +97,7 @@
<Compile Include="CommandLineArguments.cs" />
<Compile Include="Commands.cs" />
<Compile Include="ConnectMethodDecompiler.cs" />
<Compile Include="Controls\DockedPane.cs" />
<Compile Include="DecompilerSettingsPanel.xaml.cs">
<DependentUpon>DecompilerSettingsPanel.xaml</DependentUpon>
<SubType>Code</SubType>

30
ILSpy/MainWindow.xaml

@ -44,7 +44,6 @@
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Show _analyzer" Name="showAnalyzer" IsCheckable="True" Checked="ShowAnalyzer_Checked" Unchecked="ShowAnalyzer_Unchecked" />
</MenuItem>
</Menu>
<!-- ToolBar -->
@ -115,16 +114,18 @@
VerticalAlignment="Stretch"
BorderBrush="Transparent" />
<!-- Right pane: Text Editor -->
<Grid Grid.Column="2" Name="rightPane">
<Grid Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="0" Name="topPaneRow" />
<RowDefinition Height="1" />
<RowDefinition Height="0.7*" MinHeight="100" Name="textViewRow" />
<RowDefinition Height="1" />
<RowDefinition Height="0" Name="analyzerRow" />
<RowDefinition Height="0" Name="bottomPaneRow" />
</Grid.RowDefinitions>
<Border BorderBrush="Black" BorderThickness="1" Name="updateAvailablePanel" Visibility="Collapsed">
<DockPanel>
@ -136,7 +137,7 @@
</DockPanel>
</Border>
<!-- decompilerTextView is inserted into row 1 by code -->
<controls:DockedPane x:Name="topPane" Grid.Row="1" Title="Top" Visibility="Collapsed" CloseButtonClicked="TopPane_CloseButtonClicked" />
<GridSplitter
Grid.ZIndex="1"
@ -146,13 +147,22 @@
BorderBrush="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=showAnalyzer, Converter={StaticResource BooleanToVisibilityConverter}}" />
Visibility="{Binding Visibility, ElementName=bottomPane}" />
<!-- decompilerTextView is into the mainPane by code -->
<ContentPresenter Name="mainPane" Grid.Row="3"/>
<GridSplitter
Grid.ZIndex="1"
Grid.Row="4"
Margin="0,-2,0,-5"
BorderThickness="0,2,0,5"
BorderBrush="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Visibility="{Binding Visibility, ElementName=bottomPane}" />
<DockPanel Grid.Row="3"
Visibility="{Binding IsChecked, ElementName=showAnalyzer, Converter={StaticResource BooleanToVisibilityConverter}}">
<Label DockPanel.Dock="Top">Analyzer</Label>
<tv:SharpTreeView Name="analyzerTree" ShowRoot="False" />
</DockPanel>
<controls:DockedPane x:Name="bottomPane" Grid.Row="5" Title="Bottom" Visibility="Collapsed" CloseButtonClicked="BottomPane_CloseButtonClicked" />
</Grid>
</Grid>
</DockPanel>

78
ILSpy/MainWindow.xaml.cs

@ -81,8 +81,7 @@ namespace ICSharpCode.ILSpy
InitializeComponent();
App.CompositionContainer.ComposeParts(this);
Grid.SetRow(decompilerTextView, 1);
rightPane.Children.Add(decompilerTextView);
mainPane.Content = decompilerTextView;
if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) {
leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
@ -93,7 +92,6 @@ namespace ICSharpCode.ILSpy
InitMainMenu();
InitToolbar();
ContextMenuProvider.Add(treeView);
ContextMenuProvider.Add(analyzerTree);
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
@ -601,22 +599,6 @@ namespace ICSharpCode.ILSpy
#endregion
#region Analyzer
public void AddToAnalyzer(AnalyzerTreeNode node)
{
if (analyzerTree.Root == null)
analyzerTree.Root = new AnalyzerTreeNode { Language = sessionSettings.FilterSettings.Language };
if (!showAnalyzer.IsChecked)
showAnalyzer.IsChecked = true;
node.IsExpanded = true;
analyzerTree.Root.Children.Add(node);
analyzerTree.SelectedItem = node;
analyzerTree.FocusNode(node);
}
#endregion
protected override void OnStateChanged(EventArgs e)
{
base.OnStateChanged(e);
@ -632,25 +614,61 @@ namespace ICSharpCode.ILSpy
sessionSettings.ActiveTreeViewPath = GetPathForNode(treeView.SelectedItem as SharpTreeNode);
sessionSettings.WindowBounds = this.RestoreBounds;
sessionSettings.SplitterPosition = leftColumn.Width.Value / (leftColumn.Width.Value + rightColumn.Width.Value);
if (showAnalyzer.IsChecked)
sessionSettings.AnalyzerSplitterPosition = analyzerRow.Height.Value / (analyzerRow.Height.Value + textViewRow.Height.Value);
if (topPane.Visibility == Visibility.Visible)
sessionSettings.BottomPaneSplitterPosition = topPaneRow.Height.Value / (topPaneRow.Height.Value + textViewRow.Height.Value);
if (bottomPane.Visibility == Visibility.Visible)
sessionSettings.BottomPaneSplitterPosition = bottomPaneRow.Height.Value / (bottomPaneRow.Height.Value + textViewRow.Height.Value);
sessionSettings.Save();
}
void ShowAnalyzer_Checked(object sender, RoutedEventArgs e)
#region Top/Bottom Pane management
public void ShowInTopPane(string title, object content)
{
topPaneRow.MinHeight = 100;
if (sessionSettings.TopPaneSplitterPosition > 0 && sessionSettings.TopPaneSplitterPosition < 1) {
textViewRow.Height = new GridLength(1 - sessionSettings.TopPaneSplitterPosition, GridUnitType.Star);
topPaneRow.Height = new GridLength(sessionSettings.TopPaneSplitterPosition, GridUnitType.Star);
}
topPane.Title = title;
topPane.Content = content;
topPane.Visibility = Visibility.Visible;
FrameworkElement fe = content as FrameworkElement;
if (fe != null)
fe.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
}
void TopPane_CloseButtonClicked(object sender, EventArgs e)
{
sessionSettings.TopPaneSplitterPosition = topPaneRow.Height.Value / (topPaneRow.Height.Value + textViewRow.Height.Value);
topPaneRow.MinHeight = 0;
topPaneRow.Height = new GridLength(0);
topPane.Visibility = Visibility.Collapsed;
}
public void ShowInBottomPane(string title, object content)
{
analyzerRow.MinHeight = 100;
if (sessionSettings.AnalyzerSplitterPosition > 0 && sessionSettings.AnalyzerSplitterPosition < 1) {
textViewRow.Height = new GridLength(1 - sessionSettings.AnalyzerSplitterPosition, GridUnitType.Star);
analyzerRow.Height = new GridLength(sessionSettings.AnalyzerSplitterPosition, GridUnitType.Star);
bottomPaneRow.MinHeight = 100;
if (sessionSettings.BottomPaneSplitterPosition > 0 && sessionSettings.BottomPaneSplitterPosition < 1) {
textViewRow.Height = new GridLength(1 - sessionSettings.BottomPaneSplitterPosition, GridUnitType.Star);
bottomPaneRow.Height = new GridLength(sessionSettings.BottomPaneSplitterPosition, GridUnitType.Star);
}
bottomPane.Title = title;
bottomPane.Content = content;
bottomPane.Visibility = Visibility.Visible;
FrameworkElement fe = content as FrameworkElement;
if (fe != null)
fe.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
}
void ShowAnalyzer_Unchecked(object sender, RoutedEventArgs e)
void BottomPane_CloseButtonClicked(object sender, EventArgs e)
{
sessionSettings.AnalyzerSplitterPosition = analyzerRow.Height.Value / (analyzerRow.Height.Value + textViewRow.Height.Value);
analyzerRow.MinHeight = 0;
analyzerRow.Height = new GridLength(0);
sessionSettings.BottomPaneSplitterPosition = bottomPaneRow.Height.Value / (bottomPaneRow.Height.Value + textViewRow.Height.Value);
bottomPaneRow.MinHeight = 0;
bottomPaneRow.Height = new GridLength(0);
bottomPane.Visibility = Visibility.Collapsed;
}
#endregion
}
}

11
ILSpy/SessionSettings.cs

@ -49,7 +49,8 @@ namespace ICSharpCode.ILSpy
this.WindowState = FromString((string)doc.Element("WindowState"), WindowState.Normal);
this.WindowBounds = FromString((string)doc.Element("WindowBounds"), new Rect(10, 10, 750, 550));
this.SplitterPosition = FromString((string)doc.Element("SplitterPosition"), 0.4);
this.AnalyzerSplitterPosition = FromString((string)doc.Element("AnalyzerSplitterPosition"), 0.3);
this.TopPaneSplitterPosition = FromString((string)doc.Element("TopPaneSplitterPosition"), 0.3);
this.BottomPaneSplitterPosition = FromString((string)doc.Element("BottomPaneSplitterPosition"), 0.3);
}
public event PropertyChangedEventHandler PropertyChanged;
@ -68,8 +69,11 @@ namespace ICSharpCode.ILSpy
public WindowState WindowState = WindowState.Normal;
public Rect WindowBounds;
/// <summary>
/// position of the left/right splitter
/// </summary>
public double SplitterPosition;
public double AnalyzerSplitterPosition;
public double TopPaneSplitterPosition, BottomPaneSplitterPosition;
public void Save()
{
@ -84,7 +88,8 @@ namespace ICSharpCode.ILSpy
doc.Add(new XElement("WindowState", ToString(this.WindowState)));
doc.Add(new XElement("WindowBounds", ToString(this.WindowBounds)));
doc.Add(new XElement("SplitterPosition", ToString(this.SplitterPosition)));
doc.Add(new XElement("AnalyzerSplitterPosition", ToString(this.AnalyzerSplitterPosition)));
doc.Add(new XElement("TopPaneSplitterPosition", ToString(this.TopPaneSplitterPosition)));
doc.Add(new XElement("BottomPaneSplitterPosition", ToString(this.BottomPaneSplitterPosition)));
ILSpySettings.SaveSettings(doc);
}

10
ILSpy/TreeNodes/Analyzer/AnalyzeContextMenuEntry.cs

@ -52,19 +52,19 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer
foreach (IMemberTreeNode node in selectedNodes) {
TypeDefinition type = node.Member as TypeDefinition;
if (type != null)
MainWindow.Instance.AddToAnalyzer(new AnalyzedTypeTreeNode(type));
AnalyzerTreeView.Instance.Show(new AnalyzedTypeTreeNode(type));
FieldDefinition field = node.Member as FieldDefinition;
if (field != null)
MainWindow.Instance.AddToAnalyzer(new AnalyzedFieldTreeNode(field));
AnalyzerTreeView.Instance.Show(new AnalyzedFieldTreeNode(field));
MethodDefinition method = node.Member as MethodDefinition;
if (method != null)
MainWindow.Instance.AddToAnalyzer(new AnalyzedMethodTreeNode(method));
AnalyzerTreeView.Instance.Show(new AnalyzedMethodTreeNode(method));
var propertyAnalyzer = Analyzer.AnalyzedPropertyTreeNode.TryCreateAnalyzer(node.Member);
if (propertyAnalyzer != null)
MainWindow.Instance.AddToAnalyzer(propertyAnalyzer);
AnalyzerTreeView.Instance.Show(propertyAnalyzer);
var eventAnalyzer = Analyzer.AnalyzedEventTreeNode.TryCreateAnalyzer(node.Member);
if (eventAnalyzer != null)
MainWindow.Instance.AddToAnalyzer(eventAnalyzer);
AnalyzerTreeView.Instance.Show(eventAnalyzer);
}
}
}

90
ILSpy/themes/generic.xaml

@ -2,6 +2,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- SortableGridViewColumn.
Displays an up arrow or down arrow in the column header when the grid is sorted using that column.
-->
@ -23,7 +27,87 @@
</StackPanel>
</DataTemplate>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- DockedPane -->
<Style TargetType="{x:Type controls:DockedPane}">
<Style.Resources>
<Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{controls:ControlColor 243}" Offset="0"/>
<GradientStop Color="{controls:ControlColor 235}" Offset="0.5"/>
<GradientStop Color="{controls:ControlColor 221}" Offset="0.5"/>
<GradientStop Color="{controls:ControlColor 205}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderBrush">
<Setter.Value>
<SolidColorBrush Color="{controls:ControlColor 150}"/>
</Setter.Value>
</Setter>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Border SnapsToDevicePixels="true" x:Name="buttonBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" />
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="buttonBorder">
<Setter.Value>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{controls:ControlColor 250, Highlight=0.3}" Offset="0"/>
<GradientStop Color="{controls:ControlColor 224, Highlight=0.4}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="buttonBorder">
<Setter.Value>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{controls:ControlColor 224}" Offset="0"/>
<GradientStop Color="{controls:ControlColor 248}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Style.Resources>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:DockedPane}">
<Border BorderThickness="1" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" CornerRadius="0,2,0,0">
<DockPanel>
<Border BorderThickness="0,0,0,1" BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" DockPanel.Dock="Top">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{TemplateBinding Title}" Margin="3,0" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Button x:Name="PART_Close" Grid.Column="2" VerticalAlignment="Center" Width="16" Height="16" DockPanel.Dock="Right" Style="{DynamicResource CloseButtonStyle}" ToolTip="Close">
<Path x:Name="Path" Stretch="Fill" StrokeThickness="0.5" Stroke="#FF333333" Fill="#FF969696" Data="F1 M 0,1.3333L 1.33333,0L 4,2.6666L 6.6666,0 8,1.3333L 5.3333,4L 8,6.6666L 6.6666,8L 4,5.3333L 1.3333,8L 0,6.6666L 2.6666,4L 0,1.3333 Z " HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Button>
</Grid>
</Border>
<ContentPresenter Content="{TemplateBinding Content}" />
</DockPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Loading…
Cancel
Save