随笔分类 - WPF
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Windows; usin
阅读全文
摘要:public static Point[] GetIntersectionPoints(Geometry g1, Geometry g2) { Geometry og1 = g1.GetWidenedPathGeometry(new Pen(Brushes.Black, 1.0)); Geometr
阅读全文
摘要:wpf根据硬件 可以做出三档的渲染 dx7以下 第0档 不支持硬件加速 dx7-dx9 第1档, 不支持所有硬件加速,但支持一部分 dx9 以上 支持所有硬件加速 可以用编程的方式取代 当前设备处于哪一个渲染级别
阅读全文
摘要:in the case you can do it to fix:
阅读全文
摘要:Products = new ObservableCollection<Product>(products); ProductOptions = new ObservableCollection<ProductOption>(options); ProductsView = CollectionVi
阅读全文
摘要:xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" xmlns:swd="clr-namespace:System.Windows.Data;assembly=PresentationFramework" <Col
阅读全文
摘要:void window_KeyDown(object sender,KeyEventArgs e) { if(e.Key == Key.F11) { Window.ResizeMode = ResizeMode.NoResize; Window.WindowState = WindowState.N
阅读全文
摘要:1.在scrollview 中的frameworkelement可以使用 FE.BringIntoView(); 滚动到此控件. 2.该 方法能一个重载 Bottom.BringIntoView(new Rect(0, 0, 5, 5)); 当控件比scrollview尺寸大时,可以让scrollv
阅读全文
摘要:private void StackPanel_MouseMove(object sender, MouseEventArgs e) { Debug.WriteLine("Move"); Point spRel = e.GetPosition((IInputElement)e.OriginalSou
阅读全文
摘要:private void Parallel(object sender, RoutedEventArgs e) { Task.Run(() => ChangeColour(Brushes.Red)); } private void Standard(object sender, RoutedEventArgs e) { ChangeColour(Brushes.Green);...
阅读全文
摘要:private IntPtr WidProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == 0x112) { if (wParam.ToInt32() == 0xF0...
阅读全文
摘要:https://blog.walterlv.com/post/windows-high-dpi-development.html https://blog.csdn.net/ZslLoveMiwa/article/details/81294311 https://blog.csdn.net/blea
阅读全文
摘要:Install-Package Microsoft.Xaml.Behaviors.Wpf
阅读全文
摘要:private void Button_Click(object sender, RoutedEventArgs e) { string savePth = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "richtextboxData.data"); ...
阅读全文
摘要:public class VirtualizingWrapPanel : VirtualizingPanel, IScrollInfo { #region Fields UIElementCollection _children; ItemsControl _itemsControl; IItemContaine...
阅读全文
摘要:1. 声明静态事件 2.静态属性 setter 3. xmal 这里比较重要, 要加括号 不然不能正常通知 甚至编译时异常 T-T 4. 只有.net frameWork 4.5以上才有这个功能,
阅读全文
摘要:#region WPF发送和接收win32消息 public const int WM_GETTEXT = 0x0D; public const int WM_SETTEXT = 0x0C; public const int WM_SIZEING = 0x0214; public const int WM_COPYDATA = 0x...
阅读全文
摘要:这是一个比较偏的功能,看了其他的很多博客都没有介绍,最后看自己试出来了. 先上效果图 目前还不知道怎么把蚂蚁线中的 图形从 dashed(-) 改成arrow(箭头) 或其他图形. 如果谁有优雅的方法请麻烦分享一下 ^ ^
阅读全文
摘要:JS调用C#代码 HTML代码: WPF代码中的C#代码: WPF和JavaScript之间的通信需要完全信任,因此您需要添加以下代码: 也经常这么干 c#调用 JS方法 myscripts.js:
阅读全文
摘要:Event handlers leak This type of leak occurs when subscribing an object (let's call it listener) to an event of some other object (let's call it sourc
阅读全文