#379 – 将ToolTip当做放大器使用(Using a Tooltip As a Magnifier)
来源:互联网 发布:淘宝店铺没有实名认证 编辑:程序博客网 时间:2024/05/18 01:19
你可以将ToolTip当做放大器使用,当鼠标悬停在控件上的时候,ToolTip将会显示这个控件的放大视图。
在下面的代码中,我们定义TooTip中有一个长宽是控件两倍的Rectangle (使用绑定和converter)。然后我们用VisualBrush 填充Rectangle 并绑定VisualBrush 的Visual 属性到Tooltip的宿主控件。
<Window.Resources> <loc:DoubleIntConverter x:Key="doubleIntConverter"/> <ToolTip x:Key="reflectingTooltip" DataContext="{Binding Path=PlacementTarget, RelativeSource={x:Static RelativeSource.Self}}" Placement="Center"> <Rectangle Width="{Binding ActualWidth, Converter={StaticResource doubleIntConverter}}" Height="{Binding ActualHeight, Converter={StaticResource doubleIntConverter}}"> <Rectangle.Fill> <VisualBrush Visual="{Binding}"/> </Rectangle.Fill> </Rectangle> </ToolTip></Window.Resources>
原文地址:https://wpf.2000things.com/2011/09/05/379-using-a-tooltip-as-a-magnifier/
0 0
- #379 – 将ToolTip当做放大器使用(Using a Tooltip As a Magnifier)
- #375 – 将Tooltip 于父控件的某个属性绑定(Binding Something in a Tooltip to a Property on the Parent Control)
- ToolTip 使用
- ToolTip
- tooltip
- Tooltip
- tooltip
- tooltip
- Using TemplateRef to create a tooltip/popover directive in Angular 2
- #377 – 通过将ToolTip定义为资源对其进行重用(Reuse Tooltips by Defining Them as Resources)
- #400 – 使用ItemsPanel 属性将WrapPanel 作为ListBox的显示面板(Using a WrapPanel as the Items Panel for a ListBox)
- Using Tooltip Controls
- Using the ToolTip Manager
- OpenGL 放大器(Cocos2d magnifier)
- 【Tooltip】WPF中Tooltip使用技巧总结
- 【Tooltip】WPF中Tooltip使用技巧总结
- 【Tooltip】WPF中Tooltip使用技巧总结
- 15 jQuery Plugins To Create A User Friendly Tooltip
- 关于auto和decltype
- git查看本地分支关联(跟踪)的远程分支之间的对应关系,本地分支对应哪个远程分支
- 友盟基本使用
- Myeclipse2015界面化开发Swing程序(选项卡)
- LeetCode : Longest Palindrome
- #379 – 将ToolTip当做放大器使用(Using a Tooltip As a Magnifier)
- cron命令
- 杂谈:行业的自豪感
- JVM运行原理及Stack和Heap的实现过程
- 给Beyond Compare自定义快捷键的方法
- 11 2
- 图片处理
- c51中的bit,char的强制类型转换
- php将字符串按照首字母顺序排序