基本信息
源码名称:wpf 2d效果示例图 含左侧导航 示例源码下载
源码大小:3.99M
文件格式:.zip
开发语言:C#
更新时间:2013-10-03
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
<!--
// Copyright © Microsoft Corporation. All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-->
<Page x:Class="BrushesIntroduction.SampleViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:examples="clr-namespace:BrushesIntroduction"
WindowTitle="Brush Examples"
Background="White">
<Page.Resources>
<DoubleAnimation From="0" To="1" Duration="0:0:0.1" x:Key="MyFadeInAnimationResource" />
<HierarchicalDataTemplate x:Key="ExamplesDataTemplate"
ItemsSource="{Binding XPath=Children/Example}">
<TextBlock
Text="{Binding XPath=@Title}"
ToolTip="{Binding XPath=Description}" />
</HierarchicalDataTemplate>
</Page.Resources>
<DockPanel Name="mainPanel">
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File" >
<MenuItem Command="{x:Static examples:SampleViewer.ExitCommand}">
<MenuItem.CommandBindings>
<CommandBinding
Command="{x:Static examples:SampleViewer.ExitCommand}"
Executed="executeExitCommand" />
</MenuItem.CommandBindings>
<MenuItem.InputBindings>
<KeyBinding
Command="{x:Static examples:SampleViewer.ExitCommand}"
Key="F4" Modifiers="Alt" />
</MenuItem.InputBindings>
</MenuItem>
</MenuItem>
</Menu>
<Rectangle
DockPanel.Dock="Top"
Height="1"
Fill="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
</Rectangle>
<Rectangle
DockPanel.Dock="Top"
Height="1"
Fill="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}">
</Rectangle>
<Border DockPanel.Dock="Left" BorderBrush="LightGray" BorderThickness="0,0,2,0"
Background="{StaticResource GlassBrushResource}">
<Expander ExpandDirection="Left">
<Expander.Header>
<TextBlock Foreground="#99000000"
FontFamily="Verdana" FontWeight="Bold" FontSize="24pt"
Text="Contents">
<TextBlock.LayoutTransform>
<RotateTransform Angle="90" />
</TextBlock.LayoutTransform>
</TextBlock>
</Expander.Header>
<Border Background="{StaticResource MySteelBrushResource}">
<Border Background="{StaticResource MyCloudyGlassBrushResource}">
<StackPanel DockPanel.Dock="Left" Orientation="Vertical"
HorizontalAlignment="Left" Margin="10">
<!-- Lists the different brush samples. The list is
defined in the sampleResources\TOC.xml file. -->
<TreeView Name="myPageList"
KeyboardNavigation.DirectionalNavigation="Cycle"
BorderBrush="Transparent"
Background="Transparent"
ItemTemplate="{DynamicResource ExamplesDataTemplate}"
ItemContainerStyle="{StaticResource TreeViewItemHeaderStyle}"
SelectedValuePath="Example">
<TreeView.ItemsSource>
<Binding Source="{StaticResource ExampleData}" XPath="*"/>
</TreeView.ItemsSource>
<TreeView.Triggers>
<EventTrigger RoutedEvent="TreeView.SelectedItemChanged">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="myFrame"
Storyboard.TargetProperty="Opacity"
From="1" To="0" Duration="0:0:0.1"
CurrentStateInvalidated="transitionAnimationStateChanged"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TreeView.Triggers>
</TreeView>
</StackPanel>
</Border>
</Border>
</Expander>
</Border>
<ScrollViewer VerticalAlignment="Stretch">
<Frame Name="myFrame"
NavigationUIVisibility="Hidden"
Navigated="myFrameNavigated" Source="BrushTypesExample.xaml"
VerticalAlignment="Stretch" />
</ScrollViewer>
</DockPanel>
</Page>