wpf GeometryDrawing 绘制文字

<GeometryDrawingx:Key="GeometryDrawingText"><GeometryDrawing.Geometry><RectangleGeometryRect="0,0,5,3"></RectangleGeometry></GeometryDrawing.Geometry><GeometryDrawing.Brush><VisualBrush><VisualBrush.Visual><!--<StackPanel>--><TextBlockText="12.36"FontSize="0.01"FontWeight="Light"Foreground="White"></TextBlock><!--</StackPanel>--></VisualBrush.Visual></VisualBrush></GeometryDrawing.Brush></Geo...

wpf DrawingImage 奇葩问题

使用wpfdrawingImage绘图是,会出现很奇怪的坐标问题,这个问题困扰很久当在DrawingGroup中绘图的时候,坐标始终会从(0,0)开始无论设置多少值,奇怪一比解决方法:首先在DrawingGroup里面添加一个透明的图形,然后再绘制实际图形RectangleGeometryrectTest=newRectangleGeometry();rectTest.Rect=newRect(0,0,0.0001,0.0001);GeometryDrawinggeometryDrawingrectTest=newGeometryDrawing();geometryDrawingrectTest.Pen=newPen(Brushes.Transparent,0.000001);geometryDrawingrectTest.Geometry=rectTest;drawingGroupKLine.Children.Add(geometryDrawingrectTest);然后问题就解决了,具体为什么还不知道,对此有深入研究的童鞋,可以留言讨论...

wpf ActualWidth为0解决方法

LocalNewsControl(){vardescriptor=DependencyPropertyDescriptor.FromProperty(ActualWidthProperty,typeof(TextBlock));if(descriptor!=null)descriptor.AddValueChanged(myTextBlock,ActualWidth_ValueChanged);}privatevoidActualWidth_ValueChanged(objecta_sender,EventArgsa_e){//Modifyyouscrollthingshere...}...

wpf GridSplitter左右托不了或者拖拽异常

对于水平分割线,需要将verticalAlignment属性设置为Center对于垂直分割线,需要将horizontalAlignment属性设置为center  切记切记,不然很苦逼。。。。...

wpf prism加载独立模块实例

 一、首先看看文件的组织架构module1module2生成dll某块。Shell来显示管理模块二,看看关键bootstrapper类usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespacewpfPrismTest{   usingSystem.ComponentModel.Composition;   usingMicrosoft.Practices.Prism.MefExtensions;   usingSystem.Windows;   usingMicrosoft.Practices.Prism.Modularity;   usingSystem.ComponentModel.Composition.Hosting;   ...

wpf使用devexpress RibbonControl实现导航窗体

实现如下效果 <Windowxmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" x:Class="HTInvestmentManageSystem.MainWi...

wpf ProgressBar使用

 wpf   progressBar使用起来有些麻烦,直接设置value的值还不行而是通过委托来执行setValue方法       //CreateaDelegatethatmatchestheSignatureoftheProgressBar'sSetValuemethod       privatedelegatevoidUpdateProgressBarDelegate(System.Windows.DependencyPropertydp,Objectvalue);privatevoidProcess()       {           //ConfiguretheProgressBar  &nbs...
代码星球 代码星球·2020-08-05

wpf xmal基础

1、名称空间的引用比如想使用System.Windows.Controls名称空间首先需要把改名称空间所在的程序集presentationFramework.dll引用到项目里然后在根元素的起始标签中写上一句:xmlns:c="clr-namespace:System.Windows.Controls;assembly=PresentationFramework" ...
代码星球 代码星球·2020-08-05

wpf控件

1,Expander2、Decoration(修饰控件)常用的修饰控件有Border,Viewbox,andBulletDecorator等borderviewBoxBulletDecorator运行结果如下 ...
代码星球 代码星球·2020-08-05

推荐一篇很好的介绍wpf dependency property的文章

http://www.codeproject.com/Articles/140620/WPF-Tutorial-Dependency-Property...

WPF集合

DependencyProperty依赖属性http://www.cnblogs.com/HelloMyWorld/archive/2013/02/21/2920149.html AttachedProperties附加属性http://www.cnblogs.com/HelloMyWorld/archive/2013/02/21/2921355.html ...
代码星球 代码星球·2020-07-12

WPF数据绑定Binding(二)

 WPF数据绑定Binding(二)1.UI控件直接的数据绑定        UI对象间的绑定,也是最基本的形式,通常是将源对象Source的某个属性值绑定 (拷贝) 到目标对象Destination的某个属性上。源属性可以是任意类型,但目标属性必须是依赖属性(DependencyProperty)。通常情况下我们对于UI对象间的绑定源属性和目标属性都是依赖属性 (有些属性不是) ,因为依赖属性有垂直的内嵌变更通知机制,WPF可以保持目标属性和源属性的同步。布局文件绑定源码:<StackPanelOrientation="Vertical"><SliderName="slider1"Margin="1010100"Minimum="9"Maximum="50"Value="12"TickFrequency="5"></Slider><TextBlockName="txtB_info"Text="上海世博会"Margi...
代码星球 代码星球·2020-07-12

WPF数据绑定---Binding学习笔记(一)

 WPF里分三种BindingBinding, PriorityBinding,MultiBinding,这三种Binding的基类都是BindingBase,而BindingBase又继承于MarkupExtension1.Binding 中 绑定到其他控件ElementName  Binding绑定是模式设置Mode 2. source= {binding}和source={bindingRelativeSource={RelativeSourceself},Path=DataContext}效果相同理解:{binding}不设定明确的绑定的source,这样binding就去从本控件类为开始根据可视树的层次结构自下而上查找不为空的Datacontext属性的值。        {bindingRelativeSource={RelativeSourceself},Path=DataContext}中Relati...

WPF登录界面及程序主界面设计

   本博文为WPF编写的管理系统登录界面,及几个管理系统主界面设计  先上图看一下效果 主界面:  图一:登录界面     图片二.登录数据准备中现在开始上源码:登录界面前台源码:<Windowx:Class="WPFLoginDemo.LoginWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="登录"Height="300"Width="400"WindowStartupLocation="CenterScreen"WindowStyle="None"FocusManager.FocusedElement="{BindingElementName=txt_userName}"Loaded="Window_Loaded"><G...

命令行编译 WPF

在开发调试代码WPF时,经常需要在修改完成代码后,点击Rebuild,然后到指定文件夹下点击打开对应的.exe验证程序是否正确,可以通过以下命名实现修改程序后,点击一个.bat文件,直接完成上面的操作,实现一键编译打开.exe  实现步骤:1.通过命令行的方式Rebuild 微软官方的命令如下:devenvSolutionName/rebuildSolnConfigName[/projectProjName][/projectconfigProjConfigName]SolnConfigName必需。 用于重新生成在 SolutionName 中命名的解决方案的解决方案配置名称。SolutionName必需。 解决方案文件的完整路径和名称。/project ProjName可选。 解决方案中项目文件的路径和名称。 可以输入从 SolutionName 文件夹到项目文件的相对路径、项目的显示名称或项目文件的完整路径和名称。/projectconfig Proj...
代码星球 代码星球·2020-06-13
首页上一页...23456...下一页尾页