wpf
文章平均质量分 81
lhx527099095
这个作者很懒,什么都没留下…
展开
-
ControlTemplate in WPF —— ComboBox
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sch原创 2012-09-20 10:49:54 · 5156 阅读 · 0 评论 -
ControlTemplate in WPF —— ListBox
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> --> <Style x:Key="{x:原创 2012-09-20 10:51:05 · 2245 阅读 · 0 评论 -
ControlTemplate in WPF —— ItemsControl
<ItemsControl Margin="10" ItemsSource="{Binding Source={StaticResource myTodoList}}"> <!--The ItemsControl has no default visual appearance. Use the Template property to specify原创 2012-09-20 10:52:07 · 1711 阅读 · 0 评论 -
ControlTemplate in WPF —— TabControl
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sch原创 2012-09-20 10:53:14 · 2518 阅读 · 0 评论 -
ControlTemplate in WPF —— Expander
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ControlTemplate x:原创 2012-09-20 10:56:56 · 1976 阅读 · 0 评论 -
有了它wpf的style可以任你发挥了
前段时间一直在做wpf的UI开发,每次想做些控件style定制的时候都很头疼很多控件不知道他的controltemplate是什么样的为了方便大家写style 特别奉上wpf的style大全从此,妈妈再也不用担心我的wpf,哪里不会点哪里,so easy!下载地址wpf controltemplate demoShared in all filewindow原创 2012-09-20 11:01:50 · 12080 阅读 · 3 评论 -
WPF中模板(ControlTemplate and DataTemplate)
WPF中的模板是一个特别重要的概念,对于做UI开发的同学来说熟悉ControlTemplate(控件模板) 和DataTemplate(数据模板)是必须掌握的技能,否则就只能做个拖控件的菜鸟。下面就着重介绍下这两类模板的概念和使用。1.ControlTemplate 就是我们常说的控件模板,主要用途是更改控件的外观,比如你要修改一个Button的形状是圆形的,改变背景颜色,定制动画效果等等原创 2012-09-21 13:58:27 · 9373 阅读 · 0 评论 -
WPF loading遮罩层 LoadingMask
大家可能很纠结在异步query数据的时候想在wpf程序中显示一个loading的遮罩吧今天就为大家介绍下遮罩的制作源码下载 点击此处先上张效果图看看 如果不如您的法眼 可以移步了 或者有更好的效果 可以留言给我 废话不多说 直接贴代码 一个usercontrol<UserControl x:Class="LoadingMask_Demo.Loadin原创 2012-09-23 11:29:59 · 23458 阅读 · 12 评论 -
WPF线程模型
大家可能会有这样的经历,在做UI开发的时候,遇到一些比较耗时的操作,界面会被卡住(阻塞),用户没有办法操作界面,从而给用户体验打了一个大大的折扣。这样的操作大部分是在取大量数据,或者是在一些文件存取等费时的操作上。那么怎么解决这个问题呢,这个时候就需要使用多线程的编程技术,将UI线程从复杂的任务中解放出来,从而使用户获得更好的用户体验。首先我们必须了解一些基本的概念:在WPF的应用程序中有原创 2012-09-25 18:51:15 · 3497 阅读 · 2 评论 -
WPF 列表控件隔行变色
不知道大家在做wpf项目的过程中有没有碰到过需要列表或者表格显示的时候隔行变色的需求 如下图以往做web的时候还是比较容易实现的 给个table写个style就行了下面介绍下在wpf中如何实现以上效果废话不多说 直接上代码前台代码:<Window x:Class="AlternateColor.MainWindow" xmlns="http:原创 2012-10-18 10:02:38 · 8703 阅读 · 0 评论 -
WPF 数据绑定
WPF中的数据绑定非常的灵活,使用起来也是十分的简单,这里我不扯什么理论知识了发个链接 想仔细研究的同学 可以自己去慢慢看MSDN http://msdn.microsoft.com/zh-cn/library/ms752347(v=vs.100).aspx本文主要是针对那些个想迅速了解数据绑定 直接上手的同学所写,废话不多说 上代码<Window x:Class="Dat原创 2012-10-19 11:36:07 · 4539 阅读 · 0 评论 -
WPF拖拽
写一个比较简单的拖拽实例给那些和我一样正在学习wpf的菜鸟们,代码比较粗糙,注意精华部分就行了 其他的可以自动忽略。前台一个itemscontrol空间 里面绑定了一排列表,随便拖动一个到右边的框里,会显示拖动的项目的文字,只是阐述原理,其他的你还可以做很多额外的东东,自己发挥吧。<Window x:Class="TestPro.MainWindow" xmlns="htt原创 2012-09-24 11:58:54 · 3501 阅读 · 0 评论 -
WPF 多国语言 localization
因为项目是多国语言的,所以用到了wpf的多国语言相关知识,其实也比较简单,分享给大家,自己也做个备忘。基本步骤如下:1.让界面上所有能够出现的label都使用动态资源(DynamicResource)这样我们在切换语言的时候程序界面上的字符才会自动切换,这里我们举个简单的TextBlock的例子,原本也许你会直接写但是如果需要国际化,那么你需要这样写把原本har原创 2013-10-08 20:49:16 · 4333 阅读 · 0 评论 -
ControlTemplate in WPF —— Shared in all file
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">--> <Style x:Key="VerticalHIC"原创 2012-09-20 11:00:19 · 2092 阅读 · 0 评论 -
ControlTemplate in WPF ——ScrollBar
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> --> --> <Style x:Ke原创 2012-09-20 10:58:27 · 1200 阅读 · 0 评论 -
WPF中的图片文件、byte[]、BitmapImage的操作
public MainWindow() { InitializeComponent(); byte[] b = GetPictureData(@"F:\WPF\TestSolution\TestReatByteFromDB\Images\123.png"); BitmapImage myimg = ByteAr原创 2012-09-27 09:48:24 · 12396 阅读 · 0 评论 -
WPF触发器(Trigger、DataTrigger、EventTrigger)
WPF中有种叫做触发器的东西(记住不是数据库的trigger哦)。它的主要作用是根据trigger的不同条件来自动更改外观属性,或者执行动画等操作。WPFtrigger的主要类型有:Trigger、MultiTrigger、DataTrigger、MultiDataTrigger、EventTrigger几种。从字面意思上我们想大家已经知道个大概,接下来我将还会用实例代码逐一进行介绍。trig原创 2012-09-28 18:09:55 · 47591 阅读 · 3 评论 -
WPF TreeGrid(树形展开的表格)
一直都想要个树形展开的表格 像这样的今天心血来潮就简单做了个TreeGrid 喜欢的同学可以下载下去自己研究下,其实也比较简单主要就是TreeView TreeViewItem再配合GridViewHeaderRowPresenter、GridViewRowPresenter、GridViewColumnCollection定制style基本上就可以实现以上效果本文中涉及大原创 2012-10-11 17:03:07 · 23995 阅读 · 10 评论 -
ControlTemplate in WPF —— TextBox
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> --> --> <Sette原创 2012-09-20 10:48:34 · 1942 阅读 · 0 评论 -
ControlTemplate in WPF —— TreeView
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> --> <Style x:Key="{x:原创 2012-09-20 10:52:44 · 2570 阅读 · 1 评论 -
ControlTemplate in WPF —— DatePicker
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <!--In this example, an implecit st原创 2012-09-20 10:54:01 · 3280 阅读 · 0 评论 -
ControlTemplate in WPF —— Window
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> --> <Style x:Key="原创 2012-09-20 10:55:13 · 2258 阅读 · 0 评论 -
ControlTemplate in WPF —— Calendar
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sch原创 2012-09-20 11:00:52 · 3781 阅读 · 0 评论 -
ControlTemplate in WPF —— DataGrid
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="{x:Type B原创 2012-09-20 11:01:39 · 3169 阅读 · 0 评论 -
ControlTemplate in WPF —— Checkbox
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sch原创 2012-09-20 10:45:14 · 1430 阅读 · 0 评论 -
ControlTemplate in WPF —— RadioButton
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> -->原创 2012-09-20 10:46:56 · 1564 阅读 · 0 评论 -
ControlTemplate in WPF —— Menu
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sch原创 2012-09-20 10:57:38 · 2542 阅读 · 0 评论 -
WPF给图片加水印
public class WatermarkHelper { string _waterImgPath; BitmapSource _waterPic; string _prefix = null; // constructors public WatermarkHelper(string waterImgF原创 2013-10-11 21:57:58 · 2651 阅读 · 0 评论