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