-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using Named property value instead of constant string in DockingManag…
…er.CreateUIElementForModel Binding Expression
- Loading branch information
1 parent
382ed52
commit bd740e3
Showing
2 changed files
with
149 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,151 @@ | ||
<Application x:Class="MLibTest.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Startup="Application_Startup"> | ||
Startup="Application_Startup" | ||
xmlns:avalonDockControls="clr-namespace:Xceed.Wpf.AvalonDock.Controls;assembly=Xceed.Wpf.AvalonDock" | ||
> | ||
<Application.Resources> | ||
|
||
<!--AnchorablePaneControlStyle--> | ||
<Style x:Key="AnchorablePaneControlStyle" | ||
TargetType="{x:Type avalonDockControls:LayoutAnchorablePaneControl}"> | ||
<Setter Property="Foreground" | ||
Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}" /> | ||
<Setter Property="Background" | ||
Value="Blue" /> | ||
<Setter Property="Padding" Value="100"/> | ||
<Setter Property="TabStripPlacement" | ||
Value="Bottom" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type avalonDockControls:LayoutAnchorablePaneControl}"> | ||
<Grid ClipToBounds="true" | ||
SnapsToDevicePixels="true" | ||
KeyboardNavigation.TabNavigation="Local"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<!--Following border is required to catch mouse events--> | ||
<Border Background="Transparent" | ||
Grid.RowSpan="2" /> | ||
<Border x:Name="ContentPanel" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
Background="{TemplateBinding Background}" | ||
Grid.Column="0" | ||
KeyboardNavigation.DirectionalNavigation="Contained" | ||
Grid.Row="0" | ||
KeyboardNavigation.TabIndex="2" | ||
KeyboardNavigation.TabNavigation="Cycle"> | ||
<ContentPresenter x:Name="PART_SelectedContentHost" | ||
ContentSource="SelectedContent" | ||
Margin="{TemplateBinding Padding}" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | ||
</Border> | ||
<avalonDockControls:AnchorablePaneTabPanel x:Name="HeaderPanel" | ||
Margin="2,0,2,2" | ||
IsItemsHost="true" | ||
Grid.Row="1" | ||
KeyboardNavigation.TabIndex="1" | ||
Panel.ZIndex="1" /> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsEnabled" | ||
Value="false"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
|
||
<Setter Property="ItemContainerStyle"> | ||
<Setter.Value> | ||
<Style TargetType="{x:Type TabItem}"> | ||
<Setter Property="IsSelected" | ||
Value="{Binding IsSelected, Mode=TwoWay}" /> | ||
<Setter Property="IsEnabled" | ||
Value="{Binding IsEnabled}" /> | ||
<Setter Property="ToolTip" | ||
Value="{Binding ToolTip}" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type TabItem}"> | ||
<Grid SnapsToDevicePixels="true"> | ||
<Border x:Name="Bd" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="1,0,1,1" | ||
Background="{TemplateBinding Background}" | ||
Padding="{TemplateBinding Padding}"> | ||
<ContentPresenter x:Name="Content" | ||
ContentSource="Header" | ||
HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" | ||
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" | ||
RecognizesAccessKey="True" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | ||
</Border> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="Selector.IsSelected" | ||
Value="true"> | ||
<Setter Property="Background" | ||
Value="White" /> | ||
<Setter Property="Panel.ZIndex" | ||
Value="1" /> | ||
<Setter Property="Margin" | ||
Value="0,-1,-1,-2" /> | ||
</Trigger> | ||
<MultiTrigger> | ||
<MultiTrigger.Conditions> | ||
<Condition Property="IsMouseOver" | ||
Value="true" /> | ||
<Condition Property="Selector.IsSelected" | ||
Value="false" /> | ||
</MultiTrigger.Conditions> | ||
<Setter Property="Background" | ||
Value="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}" /> | ||
<Setter Property="BorderBrush" | ||
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" /> | ||
<Setter Property="Panel.ZIndex" | ||
Value="0" /> | ||
</MultiTrigger> | ||
<Trigger Property="IsEnabled" | ||
Value="false"> | ||
<Setter Property="Foreground" | ||
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}, Path=Items.Count, FallbackValue=1}" | ||
Value="1"> | ||
<Setter Property="Visibility" | ||
Value="Collapsed" /> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</Setter.Value> | ||
</Setter> | ||
|
||
<!--Setter Property="ItemTemplate"> | ||
<Setter.Value> | ||
<DataTemplate> | ||
<avalonDockControls:LayoutAnchorableTabItem Model="{Binding}" /> | ||
</DataTemplate> | ||
</Setter.Value> | ||
</> | ||
<Setter Property="ContentTemplate"> | ||
<Setter.Value> | ||
<DataTemplate> | ||
<avalonDockControls:LayoutAnchorableControl Model="{Binding}" /> | ||
</DataTemplate> | ||
</Setter.Value> | ||
</Setter--> | ||
</Style> | ||
|
||
</Application.Resources> | ||
</Application> |