WPF-悬浮在底部的导航
先用Rectangle代替导航按钮,这个导航会悬浮在界面的底部,当鼠标移进导航按钮上的时候,按钮会放大,移出后恢复正常。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
< Window x:Class = "DockingTest.MainWindow"
Title = "MainWindow" Height = "764" Width = "1169" >
< Grid >
< DockPanel >
< WrapPanel Height = "32" DockPanel.Dock = "Top" >
< Button x:Name = "LeftButton" Click = "LeftButton_Click" Content = "Add To Left" />
< Button x:Name = "RightButton" Click = "RightButton_Click" Content = "Add To Right" />
</ WrapPanel >
< DockPanel x:Name = "ChildLeft" DockPanel.Dock = "Left" />
< DockPanel x:Name = "ChildRight" DockPanel.Dock = "Right" />
</ DockPanel >
< WrapPanel Height = "60" Orientation = "Horizontal" HorizontalAlignment = "Center" VerticalAlignment = "Bottom" Panel.ZIndex = "1" >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
< Rectangle Width = "50" Height = "50" Fill = "Blue" Margin = "3" RenderTransformOrigin = "0.5,1" >
< Rectangle.RenderTransform >
< TransformGroup >
< ScaleTransform ScaleX = "1" ScaleY = "1" />
</ TransformGroup >
</ Rectangle.RenderTransform >
< Rectangle.Triggers >
< EventTrigger RoutedEvent = "Rectangle.MouseEnter" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1" To = "1.2" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
< EventTrigger RoutedEvent = "Rectangle.MouseLeave" >
< BeginStoryboard >
< Storyboard >
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
< DoubleAnimation Storyboard.TargetProperty = "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" From = "1.0" To = "1" BeginTime = "00:00:00" Duration = "00:00:00.1" />
</ Storyboard >
</ BeginStoryboard >
</ EventTrigger >
</ Rectangle.Triggers >
</ Rectangle >
</ WrapPanel >
</ Grid > </ Window > |
WPF-悬浮在底部的导航的更多相关文章
- 转-TabHost组件(一)(实现底部菜单导航)
http://www.cnblogs.com/lichenwei/p/3974009.html 什么是TabHost? TabHost组件的主要功能是可以进行应用程序分类管理,例如:在用户使用wind ...
- 转-TabHost组件(二)(实现底部菜单导航)
http://www.cnblogs.com/lichenwei/p/3975095.html 上面文章<安卓开发复习笔记——TabHost组件(一)(实现底部菜单导航)>中提到了利用自定 ...
- WPF笔记(1.2 Navigation导航)——Hello,WPF!
原文:WPF笔记(1.2 Navigation导航)--Hello,WPF! 这一节是讲导航的.看了一遍,发现多不能实现,因为版本更新了,所以很多旧的语法不支持了,比如说,不再有NavigationA ...
- NavUtils【底部虚拟导航栏工具类】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 获取底部虚拟导航栏的高度值 效果图 代码分析 checkDeviceHasNavigationBar(Context context ...
- 安卓开发笔记——TabHost组件(二)(实现底部菜单导航)
上面文章<安卓开发复习笔记——TabHost组件(一)(实现底部菜单导航)>中提到了利用自定义View(ImageView+TextView)来设置一个底部菜单的样式 这边再补充一种更为灵 ...
- 安卓开发笔记——TabHost组件(一)(实现底部菜单导航)
什么是TabHost? TabHost组件的主要功能是可以进行应用程序分类管理,例如:在用户使用windows操作系统的时候,经常见到如图所示的图形界面. TabHost选项卡,说到这个组件, ...
- Flutter学习之制作底部菜单导航
简介 现在我们的 APP 上面都会在屏幕下方有一排的按钮,点击不同的按钮可以进入不同的界面.就是说在界面的底部会有一排的按钮导航.可看下面的图示. 完成图示 程序工程目录 梳理下实现步骤我们需要实现这 ...
- WPF 悬浮键盘
原文:WPF 悬浮键盘 public class TouchScreenKeyboard : Window { #region Property & Variable & Constr ...
- 微信小程序框架分析小练手(一)——猫眼电影底部标签导航制作
旧版猫眼电影底部有4个标签导航:电影.影院.发现.我的,如下图所示: 一.首先,打开微信开发者工具,新建一个项目:movie.如下图: 二.建立如下的一些目录: 三.将底部标签导航图标的素材放到ima ...
随机推荐
- Ubuntu 16.04下使用Wine安装Xshell 4和Xftp 4
说明: 1.使用的Wine版本是深度出品(Deepin),已经精简了很多没用的配置,使启动能非常快,占用资源小. 2.由于Xshell 5的C++库无法在这个Wine版本运行,即使升级官方原版的2+版 ...
- Utuntu 和 window共享文件
由于自己想用服务器跑代码,数据集和模型一般都在本机电脑上,用实验室服务器需要拷贝数据或者,在服务器上重新下载数据很麻烦 都在局域网内可以实现文件共享,代码和数据都在本地,共享给服务器,只需要使用服务器 ...
- [转] RabbitMQ介绍
转自: http://lynnkong.iteye.com/blog/1699684 1 什么是RabbitMQ? RabbitMQ是实现AMQP(高级消息队列协议)的消息中间件的一种,最初 ...
- iphone越狱-------平刷回越狱前(未越狱)状态
众所周知,iPhone采用了沙盒机制,应用之间不能任意的访问,所以很多机友在拿到iPhone后,往往选择进行越狱,但是有时候,越狱的手机有的时候在安全.性能.流畅性等方面表现并不如意,所以只好寻求重新 ...
- C# 将链表存入二进制文件及读取二进制文件得到链表示例
// 将tasks保存到二进制文件中 public Boolean saveToFile(String file) { try { ) { // 没任务就不存 return false; } if ( ...
- php如何读取ini文件
很多时候,我们使用配置文件来读取配置,那么php如何使用ini文件呢? 代码如下: 例如将:数据库信息存到ini文件中,进行读取. <?php header('content-type:text ...
- poj 1651 Multiplication Puzzle【区间DP】
题目链接:http://poj.org/problem? id=1651 题意:初使ans=0,每次消去一个值,位置在pos(pos!=1 && pos !=n) 同一时候ans+=a ...
- vs附加到多个进程调试
我们用vs调试,通常附加到一个进程进行调试,有时候需要同时附加到多个进程. 例如:同时调试客户端与服务端,我们需要同时附加到客户端与服务端进程. 按F5(执行)键调试,程序只要遇到断点就中断. 按F1 ...
- [Node.js] 關於 console.log 的格式化輸出
Node.js 當中的 console.log,除了基本字串的輸出之外,還可以利用 %s.%d.%j 格式化的輸出,就讓我們來看些例子吧! 一.範例1 (字串輸出):console.js consol ...
- 算法NB三人组
#快速排序-除了python自带的sort排序模块之外就这个最好用,只需会这个就行,其他的排序了解就好,能用冒泡,插入..的都可以用快排快速实现 import random from timewrap ...