Templ

mianWindow

<UserControl x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="350" Width="525">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/TabControlStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<DockPanel Name="Git">
<Grid DockPanel.Dock="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<!-- Header-->
<TextBlock Grid.Row="0" Height="150" Width="Auto" Text="Git Code Manage Dashboard"
FontSize="30"
Padding="50"
FontWeight="Bold"
Foreground="White"
>
<TextBlock.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#007ACC" Offset="0.39"/>
<GradientStop Color="White" Offset="0.8"/>
</LinearGradientBrush>
</TextBlock.Background>
</TextBlock>
<!-- Body -->
<TabControl Grid.Row="1" Style="{DynamicResource GitTabControlStyle}" Margin="20,10,20,10">
<TabItem Header="Overall" IsSelected="True" Style="{DynamicResource GitTabItemStyle}">
<Grid>
<Button Content="Overall"></Button>
</Grid>
</TabItem>
<TabItem Header="Commits" Style="{DynamicResource GitTabItemStyle}">
<Grid>
<Button Content="Commit"></Button>
</Grid>
</TabItem>
<TabItem Header="Settings" Style="{DynamicResource GitTabItemStyle}">
<Grid>
<Button Content="Setting"></Button>
</Grid>
</TabItem>
</TabControl>
<!-- Foot-->
<Border Grid.Row="2" DockPanel.Dock ="Bottom" Height="20" Width="Auto">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#007ACC" Offset="0.39"/>
</LinearGradientBrush>
</Border.Background>
</Border>

</Grid>
</DockPanel>
</UserControl>

style

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="TabControl.HeaderBackGround" Color="#007ACC" />
<SolidColorBrush x:Key="TabControl.ActivedItemHeaderBackground" Color="#FF10a8ab" />
<SolidColorBrush x:Key="TabControl.BodyBackground" Color="White" />
<SolidColorBrush x:Key="TabControl.BorderBrush" Color="Gray" />
<SolidColorBrush x:Key="TabItem.Foreground" Color="#FF9BEDF3" />

<Style x:Key="GitTabControlStyle" TargetType="{x:Type TabControl}" BasedOn="{StaticResource {x:Type TabControl}}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid>
<Border Background="{DynamicResource TabControl.BodyBackground}" BorderThickness="1" BorderBrush="{DynamicResource TabControl.BorderBrush}" Margin="-1">
<Border.Effect>
<BlurEffect />
</Border.Effect>
</Border>

<Border BorderBrush="{DynamicResource TabControl.BorderBrush}" BorderThickness="1" ClipToBounds="True" SnapsToDevicePixels="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Name="ROW0" Height="30"/>
<RowDefinition Name="ROW1" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Name="COL0" />
<ColumnDefinition Name="COL1" />
</Grid.ColumnDefinitions>

<Border Background="{DynamicResource TabControl.HeaderBackGround}" Name="Mask" />

<Border Grid.Row="0" Grid.Column="0" Padding="10,6" Name="TP">
<TabPanel IsItemsHost="True">
<TabPanel.OpacityMask>
<VisualBrush Visual="{Binding ElementName=Mask}" />
</TabPanel.OpacityMask>
</TabPanel>
</Border>

<Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Name="TC">
<Border Name="EB" Margin="-1" BorderThickness="0,0,0,0" BorderBrush="{DynamicResource TabControl.BorderBrush}">
<Border.Effect>
<BlurEffect Radius="5" />
</Border.Effect>
</Border>
<Border>
<ContentPresenter x:Name="PART_SelectedContentHost" Width="Auto"
ContentSource="SelectedContent" Margin="10"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</Grid>
</Grid>
</Border>
</Grid>

<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Top">
<Setter TargetName="ROW0" Property="Height" Value="auto" />

<Setter TargetName="Mask" Property="Grid.Row" Value="0" />
<Setter TargetName="Mask" Property="Grid.Column" Value="0" />
<Setter TargetName="Mask" Property="Grid.ColumnSpan" Value="2" />
<!--<Setter TargetName="Mask" Property="CornerRadius" Value="10,10,0,0" />-->

<Setter TargetName="TP" Property="Grid.Row" Value="0" />
<Setter TargetName="TP" Property="Grid.Column" Value="0" />
<Setter TargetName="TP" Property="Grid.ColumnSpan" Value="2" />

<Setter TargetName="TC" Property="Grid.Column" Value="0" />
<Setter TargetName="TC" Property="Grid.Row" Value="1" />
<Setter TargetName="TC" Property="Grid.ColumnSpan" Value="2" />

<Setter TargetName="EB" Property="BorderThickness" Value="0,1,0,0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter TargetName="ROW1" Property="Height" Value="auto" />

<Setter TargetName="Mask" Property="Grid.Row" Value="1" />
<Setter TargetName="Mask" Property="Grid.Column" Value="0" />
<Setter TargetName="Mask" Property="Grid.ColumnSpan" Value="2" />
<Setter TargetName="Mask" Property="CornerRadius" Value="0,0,10,10" />

<Setter TargetName="TP" Property="Grid.Row" Value="1" />
<Setter TargetName="TP" Property="Grid.Column" Value="0" />
<Setter TargetName="TP" Property="Grid.ColumnSpan" Value="2" />

<Setter TargetName="TC" Property="Grid.Column" Value="0" />
<Setter TargetName="TC" Property="Grid.Row" Value="0" />
<Setter TargetName="TC" Property="Grid.ColumnSpan" Value="2" />

<Setter TargetName="EB" Property="BorderThickness" Value="0,0,0,1" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="COL0" Property="Width" Value="auto" />

<Setter TargetName="Mask" Property="Grid.Row" Value="0" />
<Setter TargetName="Mask" Property="Grid.Column" Value="0" />
<Setter TargetName="Mask" Property="Grid.RowSpan" Value="2" />
<Setter TargetName="Mask" Property="CornerRadius" Value="10,0,0,10" />

<Setter TargetName="TP" Property="Grid.Row" Value="0" />
<Setter TargetName="TP" Property="Grid.Column" Value="0" />
<Setter TargetName="TP" Property="Grid.RowSpan" Value="2" />

<Setter TargetName="TC" Property="Grid.Column" Value="1" />
<Setter TargetName="TC" Property="Grid.Row" Value="0" />
<Setter TargetName="TC" Property="Grid.RowSpan" Value="2" />

<Setter TargetName="EB" Property="BorderThickness" Value="1,0,0,0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter TargetName="COL1" Property="Width" Value="auto" />

<Setter TargetName="Mask" Property="Grid.Row" Value="0" />
<Setter TargetName="Mask" Property="Grid.Column" Value="1" />
<Setter TargetName="Mask" Property="Grid.RowSpan" Value="2" />
<Setter TargetName="Mask" Property="CornerRadius" Value="0,10,10,0" />

<Setter TargetName="TP" Property="Grid.Row" Value="0" />
<Setter TargetName="TP" Property="Grid.Column" Value="1" />
<Setter TargetName="TP" Property="Grid.RowSpan" Value="2" />

<Setter TargetName="TC" Property="Grid.Column" Value="0" />
<Setter TargetName="TC" Property="Grid.Row" Value="0" />
<Setter TargetName="TC" Property="Grid.RowSpan" Value="2" />

<Setter TargetName="EB" Property="BorderThickness" Value="0,0,1,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="GitTabItemStyle" TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource TabItem.Foreground}" />
<Setter Property="TextBlock.FontSize" Value="14" />
<Setter Property="TextBlock.FontWeight" Value="Bold" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Border x:Name="bbb" SnapsToDevicePixels="True" ClipToBounds="True" CornerRadius="15" >
<ContentPresenter x:Name="contentPresenter"
ContentSource="Header"
Focusable="False"
HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}">

</ContentPresenter>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="bbb" Property="Background" Value="{DynamicResource TabControl.ActivedItemHeaderBackground}" />
<Setter TargetName="bbb" Property="Padding" Value="3" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="90" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

时间: 2024-08-09 19:47:33

Templ的相关文章

LeetCode: Longest Substring Without Repeating Characters 题解

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest subst

拓扑排序

#include<iostream>using namespace std;struct huan{ int node; bool isfound; int start;};int min(int a,int b){ int temp; if(a>b){ temp=a; a=b; b=temp; //cout<<"a="<<a<<endl; } return a;}int main(){ int node_number; //节点总

bottle框架学习(三)之模版的使用

模板的基本使用 Bottle内置了一个快速强大的模板引擎,称为SimpleTemplate模板引擎.可通过template() 函 数或view()修饰器来渲染一个模板.只需提供模板的名字和传递给模板的变量.如下: [[email protected]]# tree . . ├── templ.py └── views └── hello.tpl 1directories, 2files [[email protected]]# cat templ.py  #!/usr/bin/envpytho

【字源大挪移—读书笔记】 第二部分:字根

[2] 字根:[2.1]表示[否定]的字根.[2.2]表示[方位]的字根.[2.3]表示[程度]的字根.[2.4]表示[状态]的字根.[2.5]表示[现象]的字根.[2.6]表示[身体]的字根.[2.7]表示[姿势]的字根.[2.8]表示[心,心里活动]的字根.[2.9]表示[行为动作]的字根.[2.10]表示[感官动作]的字根.[2.11]表示[感觉]的字根.[2.12]表示[生命]的字根.[2.13]表示[死亡]的字根.[2.14]表示[社会]的字根 [2.1]表示[否定]的字根 -neg-

BZOJ 1458 士兵占领 Dinic最大流

题目大意:给定一个m*n的棋盘,其中k个点有障碍,要求放置最少的士兵,使第i行有至少L[i]个,第j列有至少C[j]个 首先这种问题很明显的网络流 但是正图肯定是跑不了 限制条件是至少而且要求放置的也是最少 很难解决 反向考虑 将棋盘上先放满士兵 此时若不能满足条件则无解 然后求最多能撤掉多少个士兵 其中第i行最多撤去templ[i]-l[i]个士兵 templ[i]表示第i行当前放置的士兵个数 尼玛我的网络流是多久不写了--居然没连反向弧就跑样例--最逗的是数组开小一倍不报RE报WA-- #i

Hough变换直线检测

Hough变换直线检测 [email protected] http://blog.csdn.net/kezunhai 霍夫变换是图像变换中的经典算法之一,主要用来从图像中分离出具有某种相同特征的几何形状(如,直线,圆等).霍夫变换寻找直线与圆的方法相比与其它方法可以更好的减少噪声干扰.Hough变换的基本原理在于利用点与线的对偶性,将原始图像空间的曲线通过转换到参数空间的一个点. 从图中可以看到,x-y坐标和K-b坐标有点--线的对偶性.x-y坐标中的P1.P2对应于k-b坐标中的L1.L2:

JS中模板嵌套学习(代码)

<script src="script/jquery-1.4.2.js"></script>    <script src="script/jsrender.js"></script>    <script id="header" type="text/x-jsrender">        <tr>               <th>序号&

word用宏命令完美解决列表编号变黑块的问题

相信很多人跟我一样,多次定义新的多级列表,会导致列表编号变成下面这样黑块 在百度搜索结果尝试了鼠标左键选中应用样式,文档关闭后打开问题依旧: 还是得感谢万能的Google,帮我找到了答案. 问题根因: The problem occurs because the font characteristics in the list template have become corrupted. 大概意思就是模板中的字体损坏了,英文不好认不全囧. 解决步骤: 1. 打开VB编辑器 没有开发工具栏的请自

UVA 122 Trees on the level 二叉树 广搜

题目链接: https://vjudge.net/problem/UVA-122 题目描述: 给你一种二叉树的构造方法, 让你逐层输出二叉树的节点值, 如果不能够则输出"not complete" 解题思路: 这道题就是硬搞就可以了, 参考紫书去做的, 首先处理输入就是非常麻烦的事情, 用到了sscanf就会轻松很多, 看来C中还是有很多很多的好用的标准库函数可以拿来用的, 例如还有本题中的strchr() , 处理完输入, 然后就去构造数. 然后广搜一遍即可 代码: #include