随笔分类 -  WPF企业工作技巧

这是 书本上很难学到的东西,在这里我能介绍一些第三方的工具 快速开发wpf,让你与众不同
摘要:1. binding 后面的stringFormat的写法----连接字符串 <TextBlock Text="{Binding Path=Qty, StringFormat=Quantity: \{0\}}" />2. [ValueConversion(typeof(decimal), typeof(string))] public class PriceConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, Cul 阅读全文
posted @ 2012-05-23 09:19 AYUI框架 阅读(1068) 评论(0) 推荐(1) 编辑
摘要:本样式 含有 触发器 和 动画 模板 ,多条件触发器,还有布局本人博客园地址 http://www.cnblogs.com/Fresh-Air/前台样式 ,我精心设计的 <Style x:Key="RDOButton" TargetType="{x:Type RadioButton}"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> & 阅读全文
posted @ 2012-05-17 14:59 AYUI框架 阅读(8452) 评论(14) 推荐(5) 编辑
摘要:<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" Loaded="Window_Loaded"& 阅读全文
posted @ 2012-05-17 10:35 AYUI框架 阅读(1234) 评论(0) 推荐(0) 编辑
摘要:本文转载 http://blog.csdn.net/imbiz/article/details/5648682练习使用API。实现以下功能:1. 设定热键2. 检测当前活动窗口3. 向活动窗口发送信息4. 取消注册热键[c-sharp]view plaincopyusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms; 阅读全文
posted @ 2012-05-12 23:04 AYUI框架 阅读(697) 评论(0) 推荐(0) 编辑
摘要:SendKeys.Send 方法.NET Framework 4其他版本 .NET Framework 4.5.NET Framework 3.5.NET Framework 3.0.NET Framework 2.0向活动应用程序发送击键。命名空间: System.Windows.Forms程序集:System.Windows.Forms(在 System.Windows.Forms.dll 中)语法C#C++F#VB复制public static void Send( string keys)参数keys类型:System.String要发送的击键字符串。异常异常条件InvalidOper 阅读全文
posted @ 2012-05-12 23:01 AYUI框架 阅读(4890) 评论(0) 推荐(0) 编辑
摘要:打开文件夹:1System.Diagnostics.Process.Start(FilePath);打开文件夹中某个文件:1System.Diagnostics.Process.Start(FilePath+"/"+FileName);打开文件夹并选中单个文件:1System.Diagnostics.Process.Start("Explorer","/select,"+ FilePath+"\\"+FileName);或1System.Diagnostics.Process.Start("Explore 阅读全文
posted @ 2012-05-12 21:54 AYUI框架 阅读(1318) 评论(2) 推荐(0) 编辑
摘要:1. wordpad 打开写字板,保存RTF格式文件用的2. notepad 打开记事本文件3. mspaint 画图软件4. sqlwb 打开sqlserver2005程序5. ssms 打开sqlserver2008或者sqlserver2012程序6. devenv 打开visual studio 软件7. calc 打开 计算器8. winword 打开mircosoft office word9. cmd 进入dos界面其他开始-运行-命令大全 1. gpedit.msc-----组策略 3. Nslookup-------IP地址侦测器 4. explorer-------打开资源 阅读全文
posted @ 2012-05-10 17:35 AYUI框架 阅读(563) 评论(0) 推荐(0) 编辑
摘要:总共四个步骤,就能解决后台在执行某一项工作,前台提示等待,完成后,提示消失这样的效果1. 显示个在显示数据之前的提示(例如一个层的显示或者一张gif图片显示) this.提示元素.Visibility = Visibility.Visible; //显示读取数据状态提示2. 创建一个线程,参数为你正在执行的那个方法,并执行它 Thread thread = new Thread(new ThreadStart(执行方法)); thread.Start();3. 执行方法的内容 =基本内容+ Dispatcher.BeginInvoke(System.Windows.... 阅读全文
posted @ 2012-05-08 11:22 AYUI框架 阅读(418) 评论(0) 推荐(0) 编辑
摘要:#region 身份证算法 ///<summary> ///身份证验证 ///</summary> ///<paramname="Id">身份证号</param> ///<returns></returns> public bool CheckIDCard(string Id) { if (Id.Length == 18) { bool check = CheckIDCard18(Id); ... 阅读全文
posted @ 2012-05-03 15:38 AYUI框架 阅读(709) 评论(0) 推荐(0) 编辑
摘要:BrushConverter converter = new BrushConverter(); Brush newFill = (Brush)converter.ConvertFromString("#000000"); e1.Fill = newFill; 阅读全文
posted @ 2012-04-20 16:35 AYUI框架 阅读(435) 评论(0) 推荐(0) 编辑
摘要:给你个demo吧前台页面很简单<Window x:Class="ProgressBarDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid 阅读全文
posted @ 2012-04-20 11:36 AYUI框架 阅读(1015) 评论(0) 推荐(0) 编辑
摘要:<TextBox Name="txt1" Width="250" AutoWordSelection="True" CharacterCasing="Upper" IsEnabled="{Binding Path=IsStreetNameHasText}" IsTabStop="{Binding Path=IsStreetNameHasText}" > <TextBox.Text> ... 阅读全文
posted @ 2012-04-20 11:19 AYUI框架 阅读(455) 评论(0) 推荐(0) 编辑
摘要:LOG4NET用法Log4net的优点:几乎所有的大型应用都会有自己的用于跟踪调试的API。因为一旦程序被部署以后,就不太可能再利用专门的调试工具了。然而 一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。日志具有以下优点:它可以提供应用程序运行时的精确环境,可供开发人员尽快找到应用程序中的Bug;一旦在程序中加入了 Log 输出代码,程序运行过程中就能生成并输出日志信息而无需人工干预。另外,日志信息可以输出到不同的地方。Log4net就是为这样一个目的设计的,用于.NET开发环境的日志记录包。Log4net的结构log4net 有四种主要的组件,分别是Logger(记录器), 阅读全文
posted @ 2012-04-19 14:04 AYUI框架 阅读(628) 评论(1) 推荐(0) 编辑
摘要:1 /// <summary> 2 /// Finds a Child of a given item in the visual tree. 3 /// </summary> 4 /// <param name="parent">A direct parent of the queried item.</param> 5 /// <typeparam name="T">The type of the queried item.</typeparam> 6 /// <param 阅读全文
posted @ 2012-04-19 14:01 AYUI框架 阅读(884) 评论(0) 推荐(0) 编辑
摘要:1 <!--下拉框样式--> 2 <Style x:Key="ComboBoxFocusVisual"> 3 <Setter Property="Control.Template"> 4 <Setter.Value> 5 <ControlTemplate> 6 <Rectangle Margin="4,4,21,4" SnapsToDevicePixels="true" Stroke="{DynamicRe... 阅读全文
posted @ 2012-04-19 09:41 AYUI框架 阅读(11378) 评论(1) 推荐(5) 编辑
摘要:把图片地址换一下就行了,一个上为选中的样子,一张是选中后的图片我先给你看看我的图片吧我就这两张图片,回去试试吧,用法你懂的,不懂得Q我,QQ875556003 阅读全文
posted @ 2012-04-19 09:27 AYUI框架 阅读(4100) 评论(2) 推荐(1) 编辑
摘要:定位 在目标元素下渐变滑出,过几秒后自动滑动消失 <Storyboard x:Key="StatusTip"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="tbStatusTip"> <EasingDoubleKeyFrame KeyTime="0" Value="0"/> <EasingDoub 阅读全文
posted @ 2012-04-13 10:17 AYUI框架 阅读(1121) 评论(0) 推荐(1) 编辑
摘要:<ListBox> <!-- 数据 --> <ListBoxItem>AAAA</ListBoxItem> <ListBoxItem>BB</ListBoxItem> <ListBoxItem>CCCC</ListBoxItem> <!-- 设置ListBoxItem样式 --> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <!-- 设置控件模板 --> 阅读全文
posted @ 2012-04-11 01:10 AYUI框架 阅读(8222) 评论(0) 推荐(2) 编辑
摘要:<ComboBox ...> <ComboBox.Resources> <sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">0</sys:Double> </ComboBox.Resources></ComboBox>去除combobox的下三角形符号命名空间: xmlns:sys="clr-namespace:System;assembly=mscorlib" 阅读全文
posted @ 2012-04-09 13:57 AYUI框架 阅读(532) 评论(0) 推荐(0) 编辑
摘要:1. treeview的Item获取var g = this.tree.ItemContainerGenerator;TreeViewItem item = g.ContainerFromItem(this.tree.SelectedItem) as TreeViewItem;if (item != null) item.IsExpanded = true;2.ListBoxvar g = listbox实例.ItemContainerGenerator;ListBoxItem item = g.ContainerFromIndex(listbox实例.SelectedIndex) as Li 阅读全文
posted @ 2012-04-09 10:38 AYUI框架 阅读(573) 评论(0) 推荐(0) 编辑