2023年12月29日

WPF TextBox Text Binding Mode=TwoWay不生效解决方法

摘要: Text="{Binding AiResult.Remark, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 主要是:UpdateSourceTrigger=PropertyChanged 阅读全文

posted @ 2023-12-29 14:54 lopengye 阅读(322) 评论(0) 推荐(0)

2023年12月21日

WPF ListView GridView表头Header修改外观的方式

摘要: <Window.Resources> <DataTemplate x:Key="BlueHeader"> <StackPanel Orientation="Horizontal" Margin="-5,-5,-5,-5" Width="120"> <StackPanel.Background> <L 阅读全文

posted @ 2023-12-21 11:01 lopengye 阅读(758) 评论(0) 推荐(0)

2023年10月23日

WPF ListBox中自定义控件的CaptureMouse失效问题解决办法 Canvas

摘要: 换用ItemsControl 阅读全文

posted @ 2023-10-23 23:54 lopengye 阅读(41) 评论(0) 推荐(0)

2023年8月21日

WPF Grid内的元素设置ZIndex

摘要: 有时需要对Grid内的元素进行重新叠放,可以使用Grid.SetZIndex()方法实现: Grid.SetZIndex(drawCanvas, 1); Grid.SetZIndex(canvRects, 0); 阅读全文

posted @ 2023-08-21 15:19 lopengye 阅读(523) 评论(0) 推荐(0)

2023年8月11日

WPF ListView数据项右键菜单ContextMenu重写,以及右键菜单中button绑定ViewModel命令

摘要: 想给数据项添加右键菜单,重新给右键菜单写了样式,右键菜单中包含button,如何给Button的Command绑定到页面的ViewModel,以下是代码示例 <DataTemplate x:Key="GridViewItemDataTemplate"> <Border Width="80" Heig 阅读全文

posted @ 2023-08-11 11:07 lopengye 阅读(982) 评论(0) 推荐(0)

2023年7月25日

WPF Popup带箭头,自适应箭头位置在target中间的实现方式

摘要: 如题,在WPF项目中,有时会涉及使用Popup控件实现一些弹出式菜单: 1.程序不靠屏幕边框时,箭头居于Popup中央,指向target中央 2.程序靠边框时,Popup自动偏移,箭头仍然指向target控件的中央,这样比较美观和谐 并且,当target控件比较靠下时,Popup控件会自动翻转到ta 阅读全文

posted @ 2023-07-25 14:25 lopengye 阅读(431) 评论(0) 推荐(0)

2023年7月24日

Source tree突然打不开解决办法

摘要: 找到C:\Users\用户名\AppData\Local\Atlassian文件夹,删除多余的文件夹 阅读全文

posted @ 2023-07-24 13:19 lopengye 阅读(137) 评论(0) 推荐(0)

2023年7月13日

WPF border解决超出圆角边界的方法

摘要: 使用Border并设置圆角,Border内部的其他元素会超出圆角而导致灾难级的视觉体验,通过设置Border的clip属性,来解决这个问题 <Border BorderThickness="1" BorderBrush="Black" CornerRadius="8"> <Border.Clip> 阅读全文

posted @ 2023-07-13 10:41 lopengye 阅读(1586) 评论(0) 推荐(0)

2022年12月1日

后台线程快速频繁刷新UI

摘要: await this._dispatcher.BeginInvoke(new Action(() => { //更新UI代码 })); 阅读全文

posted @ 2022-12-01 14:12 lopengye 阅读(51) 评论(0) 推荐(0)

2022年4月26日

WPF ListBox等列表控件隔行换色

摘要: <Style x:Key="NormalListBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}"> <Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Proper 阅读全文

posted @ 2022-04-26 13:52 lopengye 阅读(561) 评论(0) 推荐(0)

导航