![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
WPF
XinShun
这个作者很懒,什么都没留下…
展开
-
WPF Canvas缩放后显示滚动条
1、参考:https://social.msdn.microsoft.com/Forums/vstudio/en-US/0820008b-4ccd-4285-bcb7-129f5d8ff75d/canvas-zoom-by-mouse-wheel-but-scroll-bar-not-working-?forum=wpfhttps://www.cnblogs.com/wywnet/p/3993161.html主要使用:canvas.LayoutTransform = st;而不是:c原创 2021-07-28 14:53:47 · 1177 阅读 · 0 评论 -
WPF中对系统光标进行旋转平移操作
1、主要是实现对WPF中的光标进行旋转2、代码如下//https://stackoverflow.com/questions/18351872/how-to-convert-system-windows-input-cursor-to-imagesource//https://wpf.2000things.com/2012/12/17/713-setting-the-cursor-to-an-image-of-an-uielement-while-dragging/public class C原创 2021-07-21 11:55:12 · 433 阅读 · 0 评论 -
WPF中的Canvas存为Bitmap
1、网上查找到的方法,但当Canvas的VisualOffset不为0时,会有偏移double dpi = 96d;var size = this.RenderSize;var vf = this.VisualOffset;RenderTargetBitmap bmp = new RenderTargetBitmap((int)size.Width, (int)size.Height, dpi, dpi, PixelFormats.Pbgra32);bmp.Render(this);stri原创 2021-07-15 16:55:49 · 678 阅读 · 0 评论 -
WPF password加水印
1、增加扩展属性{ public static readonly DependencyProperty PasswordProperty = DependencyProperty.RegisterAttached("Password", typeof(string), typeof(PasswordHelper), new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged)); public stati原创 2021-06-23 14:30:58 · 552 阅读 · 0 评论 -
Caliburn.Micro使用Autofac
using Autofac;using Caliburn.Micro;namespace ST.ERMS.AutFac{ public class AutFacContainer : BootstrapperBase { /// <summary> /// /// </summary> private IContainer container; /// <summary&.原创 2021-06-23 11:33:08 · 468 阅读 · 0 评论 -
WPF使用Behavior创建文本框水印
1、参考https://www.cnblogs.com/nocanstillbb/p/10709380.html https://www.jianshu.com/p/2c4fe0e31e332、引用Microsoft.Xaml.Behaviors.Wpf这个Nuget包,代码using Microsoft.Xaml.Behaviors;public class WatermarkBehavior : Behavior<TextBox> { ...原创 2021-06-23 10:08:36 · 295 阅读 · 0 评论