|
<UserControl x:Class="Tabber3D.SelectedElementUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="auto" Width="auto">
<UserControl.Resources>
<!-- Brushes -->
<LinearGradientBrush x:Key="buttonNormalBrush" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="Pink"/>
<GradientStop Offset="1" Color="Crimson"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="buttonPressedBrush" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="Pink"/>
<GradientStop Offset="1" Color="DarkRed"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="buttonDisabledBrush" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="White"/>
<GradientStop Offset="1" Color="DarkGray"/>
</LinearGradientBrush>
<!-- Close Button Template (for Button used on TabItems Header) -->
<ControlTemplate x:Key="closeButtonTemplate" TargetType="{x:Type Button}">
<Border x:Name="bgBorder" Background="{TemplateBinding Background}" Width="10" Height="10" BorderThickness="0.5">
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="Red"/>
<GradientStop Offset="1" Color="Black"/>
</LinearGradientBrush>
</Border.BorderBrush>
<Canvas>
<Line X1="2" Y1="2" X2="7" Y2="7" Stroke="White" StrokeThickness="1.5"/>
<Line X1="7" Y1="2" X2="2" Y2="7" Stroke="White" StrokeThickness="1.5"/>
</Canvas>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BitmapEffect">
<Setter.Value>
<OuterGlowBitmapEffect/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="bgBorder" Property="Background"
Value="{StaticResource buttonPressedBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="bgBorder" Property="Background"
Value="{StaticResource buttonDisabledBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</UserControl.Resources>
<DockPanel x:Name="dockMain" LastChildFill="True">
<DockPanel x:Name="dockTopBanner" DockPanel.Dock="Top"
Width="{Binding ElementName=dockMain,Path=ActualWidth}" Background="Transparent">
<DockPanel>
<Button x:Name="btnClose" Content="X" Click="btnClose_Click" DockPanel.Dock="Right"
Width="20" Height="20" Template="{StaticResource closeButtonTemplate}"
Background="{StaticResource buttonNormalBrush}"
HorizontalAlignment="Right"/>
</DockPanel>
</DockPanel>
<Grid x:Name="mainContent" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
MinHeight="300" MinWidth="300"/>
</DockPanel>
</UserControl>
|
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 currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)
- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence
Both of these at Sussex University UK.
Award(s)
I am lucky enough to have won a few awards for Zany Crazy code articles over the years
- Microsoft C# MVP 2016
- Codeproject MVP 2016
- Microsoft C# MVP 2015
- Codeproject MVP 2015
- Microsoft C# MVP 2014
- Codeproject MVP 2014
- Microsoft C# MVP 2013
- Codeproject MVP 2013
- Microsoft C# MVP 2012
- Codeproject MVP 2012
- Microsoft C# MVP 2011
- Codeproject MVP 2011
- Microsoft C# MVP 2010
- Codeproject MVP 2010
- Microsoft C# MVP 2009
- Codeproject MVP 2009
- Microsoft C# MVP 2008
- Codeproject MVP 2008
- And numerous codeproject awards which you can see over at my blog