- xplorerbar_src.zip
- XPlorerBar_src
- XPlorerBar.DemoApp.sln
- XPlorerBar.DemoApp.suo
- XPlorerBar.DemoApp
- App.xaml
- App.xaml.cs
- Converters
- Extra_BindingMode
- Extra_ThemeManagement
- Images
- codeproject120x60.gif
- Computer16.png
- Copy16.png
- CreateFolder16.png
- Delete16.png
- MailFile16.png
- Move16.png
- MusicOnLine16.png
- MyComputer16.png
- MyDocuments16.png
- MyMusic32.png
- MyNetwork16.png
- MyPictures16.png
- MyPictures32.png
- MyPictures48.png
- NetworkFavorites16.png
- OrderPictures16.png
- PlayAll16.png
- PrintPictures16.png
- PublishFolder16.png
- Rename16.png
- SharedMusic16.png
- ShareFolder16.png
- SlideShow16.png
- MainWindow.xaml
- MainWindow.xaml.cs
- Properties
- Resources
- Images
- Folder16.png
- MyComputer16.png
- NetworkPlaces16.png
- PicturePrint16.png
- PictureTasks32.png
- PictureTasksMono48.png
- PrintsOnline16.png
- SlideShow16.png
- Skins
- XPlorerBar.DemoApp.csproj
- XPlorerBar.Documentation
- Help
- Documentation.chm
- LastBuild.log
- XPlorerBarDocumentationProject.shfb
- XPlorerBar.Library
- xplorerbar_demo.zip
- XPlorerBar_demo
- ZonaTools.XPlorerBar.DemoApp.exe
- ZonaTools.XPlorerBar.dll
- ZonaTools.XPlorerBar.Documentation.chm
|
<!--
Copyright © 2008, Zona-Tools, all rights reserved.
This source code is licensed under the Code Project Open License (CPOL).
Check out http://www.codeproject.com/info/cpol10.aspx for further details.
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xpbar="clr-namespace:ZonaTools.XPlorerBar">
<!-- ======================== -->
<!-- = Main template import = -->
<!-- ======================== -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ZonaTools.XPlorerBar;component/Themes/XPlorerBar.Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- ================================= -->
<!-- = Converters instances creation = -->
<!-- ================================= -->
<xpbar:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter"/>
<!-- =============================== -->
<!-- = XPlorerSection header style = -->
<!-- =============================== -->
<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type xpbar:XPlorerResourceKeys},ResourceId=XPlorerSectionHeaderStyle}"
TargetType="{x:Type ToggleButton}">
<Setter Property="Background" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderBackgroundBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderForegroundBrushKey}}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Border Background="{TemplateBinding Background}"
Height="25" VerticalAlignment="Bottom" CornerRadius="4,4,0,0" >
<DockPanel LastChildFill="True">
<!-- Expand/Collapse button -->
<Grid DockPanel.Dock="Right" Margin="0,3,6,5">
<!-- Button border -->
<Ellipse x:Name="buttonBorder"
Width="17" Height="17"
HorizontalAlignment="Left" VerticalAlignment="Top"
StrokeThickness="1" SnapsToDevicePixels="True"
Stroke="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderButtonBorderBrushKey}}"
Fill="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderButtonBackgroundBrushKey}}">
<!-- Button shadow effect -->
<Ellipse.BitmapEffect>
<DropShadowBitmapEffect x:Name="buttonShadow"
Color="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type Ellipse}}, Path=Stroke,
Converter={StaticResource SolidColorBrushToColorConverter}}"
Opacity="0.5" Direction="315" Softness="0.6" ShadowDepth="2"/>
</Ellipse.BitmapEffect>
</Ellipse>
<!-- Arrows -->
<Path x:Name="buttonArrows"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="4.5,4"
SnapsToDevicePixels="True"
Data="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderExpandArrowsKey}}"
Fill="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderButtonForegroundBrushKey}}"/>
</Grid>
<!-- Header text -->
<ContentPresenter x:Name="contentSite"
Content="{TemplateBinding Content}" Margin="35,6,10,0"
HorizontalAlignment="Left" VerticalAlignment="Top">
<ContentPresenter.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</DockPanel>
</Border>
<!-- Header image -->
<Image x:Name="headerImage"
Width="32" Height="32" Margin="1,0,0,0" Visibility="Visible"
HorizontalAlignment="Left" VerticalAlignment="Bottom"
Source="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type xpbar:XPlorerSection}}, Path=HeaderImage}"/>
</Grid>
<ControlTemplate.Triggers>
<!-- IsChecked = true -->
<Trigger Property="IsChecked" Value="True">
<!-- Updates the button -->
<Setter TargetName="buttonArrows" Property="Data" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderCollapseArrowsKey}}"/>
</Trigger>
<!-- IsMouseOver = true -->
<Trigger Property="IsMouseOver" Value="True">
<!-- Updates the header -->
<Setter Property="Foreground" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderHoverForegroundBrushKey}}"/>
<!-- Updates the button -->
<Setter TargetName="buttonArrows" Property="Fill" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionHeaderButtonHoverForegroundBrushKey}}"/>
</Trigger>
<!-- IsPrimary = true -->
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPrimary}" Value="true">
<!-- Updates the header -->
<Setter Property="Background" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderBackgroundBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderForegroundBrushKey}}"/>
<!-- Updates the button -->
<Setter TargetName="buttonArrows" Property="Fill" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderButtonForegroundBrushKey}}"/>
<Setter TargetName="buttonBorder" Property="Stroke" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderButtonBorderBrushKey}}"/>
<Setter TargetName="buttonBorder" Property="Fill" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderButtonBackgroundBrushKey}}"/>
</DataTrigger>
<!-- IsMouseOver = true && IsPrimary = true -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<!-- IsMouseOver = true -->
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}" Value="True"/>
<!-- IsPrimary = true -->
<Condition Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPrimary}" Value="True"/>
</MultiDataTrigger.Conditions>
<!-- Updates the header -->
<Setter Property="Foreground" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderHoverForegroundBrushKey}}"/>
<!-- Updates the button -->
<Setter TargetName="buttonArrows" Property="Fill" Value="{DynamicResource {x:Static xpbar:XPlorerResourceKeys.XPlorerSectionPrimaryHeaderButtonHoverForegroundBrushKey}}"/>
</MultiDataTrigger>
<!-- There is no header image -->
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HeaderImage}" Value="{x:Null}">
<Setter TargetName="headerImage" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="contentSite" Property="Margin" Value="12,6,10,0"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been developing and managing projects for real-time embedded softwares for eight years. Then, I moved from Paris to the south of France and began to lead a team who was developping Java applications.
My main occupation right now is to continue my journey in the WPF world.
You can check out my blog
here. [
^]