左侧导航移动上去有滑动效果(不错),右侧弹出效果更炫,下载即可使用<!--// 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="GeometrySample.SampleViewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowTitle="Geometries Sample" Loaded="pageLoaded"> <Page.Resources> <Storyboard x:Key="ZoomInStoryboard" Completed="zoomInStoryboardCompleted"> <DoubleAnimation Storyboard.TargetName="MyHorizontalAxisAngleRotation3D" Storyboard.TargetProperty="Angle" From="360" To="0" Duration="0:0:1" AutoReverse="False" FillBehavior="Stop" BeginTime="0:0:0" DecelerationRatio="1" /> <DoubleAnimation Storyboard.TargetName="MyScaleTransform3D" Storyboard.TargetProperty="ScaleX" From="0" To="1" Duration="0:0:2" AutoReverse="False" DecelerationRatio="1" /> <DoubleAnimation Storyboard.TargetName="MyScaleTransform3D" Storyboard.TargetProperty="ScaleY" From="0" To="1" Duration="0:0:2" AutoReverse="False" DecelerationRatio="1" /> <DoubleAnimation Storyboard.TargetName="MyScaleTransform3D" Storyboard.TargetProperty="ScaleZ" From="0" To="1" Duration="0:0:2" AutoReverse="False" DecelerationRatio="1" /> </Storyboard> </Page.Resources> <Page.Triggers> <EventTrigger RoutedEvent="RadioButton.Checked"> <BeginStoryboard> <Storyboard Completed="zoomOutStoryboardCompleted"> <DoubleAnimation Storyboard.TargetName="MyHorizontalAxisAngleRotation3D" Storyboard.TargetProperty="Angle" From="0" To="360" Duration="0:0:1" AutoReverse="False" FillBehavior="Stop" BeginTime="0:0:1" AccelerationRatio="1" /> <DoubleAnimation Storyboard.TargetName="MyScaleTransform3D" Storyboard.TargetProperty="ScaleX" From="1" To="0" Duration="0:0:2" AutoReverse="False" AccelerationRatio="1" /> <DoubleAnimation Storyboard.TargetName="MyScaleTransform3D" Storyboard.TargetProperty="ScaleY" From="1" To="0" Duration="0:0:2" AutoReverse="False" AccelerationRatio="1" /> <DoubleAnimation Storyboard.TargetName="MyScaleTransform3D" Storyboard.TargetProperty="ScaleZ" From="1" To="0.1" Duration="0:0:2" AutoReverse="False" AccelerationRatio="1" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Page.Triggers> <DockPanel> <Border DockPanel.Dock="Left" Background="{StaticResource MyBlueGridBrushResource}"> <StackPanel VerticalAlignment="Stretch" Margin="10"> <RadioButton x:Name="Example1RadioButton" Checked="sampleSelected" Margin="0,0,0,10">Geometry Usage</RadioButton> <RadioButton Checked="sampleSelected" Margin="0,0,0,10">Shape Geometries</RadioButton> <RadioButton Checked="sampleSelected" Margin="0,0,0,10">PathGeometry</RadioButton> <RadioButton Checked="sampleSelected" Margin="0,0,0,10">Geometry Attribute Syntax Example</RadioButton> <RadioButton Checked="sampleSelected">Combining Geometries Example</RadioButton> </StackPanel> </Border> <Grid Background="Black"> <Rectangle Fill="{StaticResource BlackBackgroundGridBrushResource}"> <Rectangle.OpacityMask> <RadialGradientBrush> <GradientStop Offset="0.0" Color="#FF000000" /> <GradientStop Offset="1.0" Color="#00000000" /> </RadialGradientBrush> </Rectangle.OpacityMask> </Rectangle> <Border> <Border ClipToBounds="True"> <Viewbox Stretch="Fill" Width="{Binding ElementName=myScrollViewer, Path=ActualWidth}" Height="{Binding ElementName=myScrollViewer, Path=ActualHeight}"> <Viewport3D Name="myViewport3D" Opacity="1" IsHitTestVisible="False"> <Viewport3D.Camera> <PerspectiveCamera LookDirection="0,0,-2" UpDirection="0,1,0" Position="0,0,5" FieldOfView="90"/> </Viewport3D.Camera> <ModelVisual3D> <ModelVisual3D.Children> <ModelVisual3D> <ModelVisual3D.Content> <AmbientLight Color="#FFFFFFFF" /> </ModelVisual3D.Content> </ModelVisual3D> <ModelVisual3D> <ModelVisual3D.Children> <ModelVisual3D> <ModelVisual3D.Content> <GeometryModel3D x:Name="myPlane"> <GeometryModel3D.Geometry><MeshGeometry3D x:Name="myGeometry" TriangleIndices="0,1,2 3,4,5, 11,10,9,8,7,6"TextureCoordinates="0,0 0,-1 -1,-1 -1,-1 -1,0 0,0 -1,-1 -1,0 0,0 0,0 0,-1 -1,-1 " Positions="12,-9,0 12,9,0 -12,9,0 -12,9,0 -12,-9,0 12,-9,0" /> </GeometryModel3D.Geometry> <GeometryModel3D.Material><DiffuseMaterial> <DiffuseMaterial.Brush> <VisualBrush RenderOptions.CacheInvalidationThresholdMinimum="0" RenderOptions.CachingHint="Cache" Visual="{Binding ElementName=myScrollViewer}" /> </DiffuseMaterial.Brush></DiffuseMaterial> </GeometryModel3D.Material> </GeometryModel3D> </ModelVisual3D.Content> <ModelVisual3D.Transform> <Transform3DGroup> <RotateTransform3D x:Name="myHorizontalRotation"CenterX="0" CenterY="0" CenterZ="0"><RotateTransform3D.Rotation> <AxisAngleRotation3D Axis="0,1,0" Angle="0" x:Name="MyHorizontalAxisAngleRotation3D" /></RotateTransform3D.Rotation> </RotateTransform3D> <ScaleTransform3D x:Name="MyScaleTransform3D" ScaleX="1" ScaleY="1" ScaleZ="1" /> </Transform3DGroup> </ModelVisual3D.Transform> </ModelVisual3D> </ModelVisual3D.Children> </ModelVisual3D> </ModelVisual3D.Children> </ModelVisual3D> </Viewport3D> </Viewbox> </Border> </Border> <Border Name="scrollViewerBorder"> <ScrollViewer Name="myScrollViewer" Background="White" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Frame Name="mainFrame" Background="White" ContentRendered="frameContentRendered" NavigationUIVisibility="Hidden"> <Frame.RenderTransform> <ScaleTransform /> </Frame.RenderTransform> </Frame> </ScrollViewer> </Border> </Grid> </DockPanel></Page>
下载WPF很炫的几何图形 实例源码下载用户还喜欢
- 18480 文章数
- 500万+ 热度
作者专栏
编辑推荐
- 淡抹u2引擎,修复内容较多,物有所值
- 界域传说·经典巨作=传世单机(一键安装)
- 丸子版本(175个传世版本大集合)
- GS版本:神话公益服务端+客户端
- 图片放大工具(放大图片不模糊)
- 剪映无限制VIP版
- 传奇世界客户端下载器,史上最全传世客户端
- 传世GS20220920商业引擎注册+登录配置器 解压密码是1
- U2官方排行榜游戏网关 支持元神,支持传家宝
- GS开战传世客户端+服务端
- (淡漠夕阳)u2引擎合区工具
- 传世GS引擎消除“你的游戏客户端版本号过旧,请及时更新”提示
- 传世一机多区双线路配置器--免密码版本
- 传世凤凰登陆器劫持修复软件
- SQLite3 for Navicat
- 传奇世界npc对话框编辑工具
- 传世GS落霞铭文服务器端
- gs_20210409引擎包+注册机(无限制)
- 传奇世界NPC对话封包查看器[支持时长版和极速版]
- 彩虹引擎传世脚本编辑工具1.7版来了,支持函数脚本翻译
评论