随笔分类 -  WPF

ListBoxItem ContextMenu
摘要:今天想把listboxitem加上右键菜单,如下<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource ListBoxItemLDPStyle}"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> <MenuItem Header="Header" Click="MenuItem_Cli... 阅读全文

posted @ 2013-01-28 17:35 beastplus 阅读(1289) 评论(0) 推荐(0)

自定义附加属性的绑定
摘要:不要忘记()要不就是UnsetValue 悲剧啊 阅读全文

posted @ 2012-12-29 16:36 beastplus 阅读(220) 评论(0) 推荐(0)

WindowsFormsHost 使用注意事项
摘要:窗口的AllowsTransparency不能为true,否则WinForm控件无显示WindowsFormsHost的父元素的父元素。。。。不能有背景,否则无显示。背景只能如下使用<Window> <Grid> <Border Background=""/> <WindowsFormsHost/> </Grid></Window> 阅读全文

posted @ 2012-12-28 08:42 beastplus 阅读(553) 评论(0) 推荐(0)

WPF ScrollViewer ScrollBar高宽
摘要:<sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">width</sys:Double> <sys:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarHeightKey}">height</sys:Double>样式字典中加入如上 阅读全文

posted @ 2012-12-19 17:32 beastplus 阅读(745) 评论(0) 推荐(0)

WPF自定义窗口样式小技巧
摘要:1窗口大小的调整,这个应该不算啥技巧,就是头次使用长长记性窗口模板中有ResizeGrip,并在ResizeMode="CanResizeWithGrip"时显示2WindowStyle=None时自定义按钮关闭窗体方法一:在某个cs文件中创建类,把关闭写在cs中,这样代码是很丑方法二:最近项目中用了CaliburnMicro,使得关闭窗口简单起来在自定义的按钮上添加cm:Action.Target="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}&qu 阅读全文

posted @ 2012-11-27 16:00 beastplus 阅读(304) 评论(0) 推荐(0)

导航