随笔分类 -  WPF

摘要:闪烁原因: SizeChanged 时调整 Top、MaxHeight等属性,WPF 会在布局更新时尝试重新计算窗口大小,系统认为窗口“可能要调整大小”,触发SetWindowPos,然后又回头触发SizeChanged,Win32 → WPF → Win32 形成拉锯,出现闪烁 / 抖动现象。 解 阅读全文
posted @ 2026-02-02 20:20 小犟 阅读(9) 评论(0) 推荐(0)
摘要:1.查找Visual级别控件类型名称 public List<Visual> FindVisualChildren(DependencyObject dpObj) { List<Visual> childrenList = new List<Visual>(); int childrenCount 阅读全文
posted @ 2025-11-27 16:57 小犟 阅读(9) 评论(0) 推荐(0)
摘要:xaml: <Window x:Class="WpfApp3Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com 阅读全文
posted @ 2025-11-04 16:06 小犟 阅读(9) 评论(0) 推荐(0)
摘要:xaml: <Window x:Class="WpfApp3Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com 阅读全文
posted @ 2025-11-04 15:33 小犟 阅读(66) 评论(0) 推荐(0)