随笔分类 -  wpf

摘要:有两种方式可以实现在模板中元素绑定到父对象 1、<ContentPresenter Margin=”{TemplateBinding Padding}”/> 2、Color=”{Binding RelativeSource={RelativeSource TemplatedParent},Path= 阅读全文
posted @ 2019-08-26 14:30 beautifulday 阅读(1068) 评论(0) 推荐(0) 编辑
摘要:<ControlTemplate x:Key="MenuItemControlTemplate1" TargetType="{x:Type MenuItem}"> <Grid SnapsToDevicePixels="True"> <Border x:Name="OuterBorder" Borde 阅读全文
posted @ 2019-08-22 10:12 beautifulday 阅读(1895) 评论(0) 推荐(0) 编辑
摘要:一、当需要添加图片、音频、视屏的资源到wpf项目里是,可以直接把文件添加到项目里 右击add->existing item. 1、如果想将外部文件编异常目标成为二进制资源,在文件的属性窗口 Build ACtion 设置为Resource。 把 Copy to output directory属性设 阅读全文
posted @ 2019-08-21 14:24 beautifulday 阅读(381) 评论(1) 推荐(0) 编辑
摘要:<GeometryDrawing x:Key="GeometryDrawingText"> <GeometryDrawing.Geometry> <RectangleGeometry Rect="0,0,5,3"></RectangleGeometry> </GeometryDrawing.Geom 阅读全文
posted @ 2019-07-25 11:32 beautifulday 阅读(2039) 评论(0) 推荐(0) 编辑
摘要:使用wpf drawingImage绘图是,会出现很奇怪的坐标问题,这个问题困扰很久 当在DrawingGroup中绘图的时候,坐标始终会从(0,0)开始无论设置多少值,奇怪一比 解决方法:首先在DrawingGroup里面添加一个透明的图形,然后再绘制实际图形 RectangleGeometry 阅读全文
posted @ 2019-07-25 09:27 beautifulday 阅读(909) 评论(0) 推荐(0) 编辑
摘要:LocalNewsControl() { var descriptor = DependencyPropertyDescriptor.FromProperty(ActualWidthProperty, typeof(TextBlock)); if (descriptor != null) descr 阅读全文
posted @ 2019-04-16 13:22 beautifulday 阅读(2295) 评论(0) 推荐(0) 编辑
摘要:对于水平分割线,需要将verticalAlignment属性设置为Center 对于垂直分割线,需要将horizontalAlignment属性设置为center 切记切记,不然很苦逼。。。。 阅读全文
posted @ 2019-04-12 17:06 beautifulday 阅读(1398) 评论(0) 推荐(2) 编辑
摘要:一、首先看看文件的组织架构 module1 module2生成dll某块。Shell来显示管理模块 二,看看关键bootstrapper类 using System;using System.Collections.Generic;using System.Linq;using System.Tex 阅读全文
posted @ 2017-09-05 15:05 beautifulday 阅读(677) 评论(0) 推荐(0) 编辑
摘要:wpf使用依赖属性完成数据绑定、动画、属性变更通知、样式化等。对于数据绑定。绑定到.NET属性源上的UI元素的属性必须是依赖属性 .net的一般属性定义如下 private int val; public int Value { get { return val; } set { val = val 阅读全文
posted @ 2016-03-20 21:37 beautifulday 阅读(696) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示