随笔分类 -  WPF

摘要:挫折时,要像大树一样,被砍了,还能再长;也要像杂草一样,虽让人践踏,但还能勇敢地活下去--Aaronyang的博客(www.ayjs.net)-www.8mi.me=============时隔两年后再看WPF==========因为以前的经验,所以继承FrameworkElement,我就简写继承... 阅读全文
posted @ 2015-01-04 11:08 AYUI框架 阅读(1434) 评论(5) 推荐(5) 编辑
摘要:本人尊重别人劳动成果,感觉写的很好,拿过来分享一下,本文不是原文,而是个人的理解,学习和分享声明:原文:http://blog.csdn.net/qing2005/article/details/6523002一、基本工作1.新建WPF应用程序 TreeViewLoadingAsync2.新建文件夹DB,把准备好的 Access 示例数据库Sample.mdb拷贝到DB文件夹下 此时会弹出 数据源配置向导 窗口,点下一步,勾选表和视图,点击完成,此时app.config数据库连接字符串都已经生成好了 数据库就一张表3.用linq获得基本数据在DB文件夹下新建一个DepartmentHelper 阅读全文
posted @ 2012-08-24 15:45 AYUI框架 阅读(3565) 评论(2) 推荐(0) 编辑
摘要:1.ObjectDataProvider <ObjectDataProvider x:Key="odp" ObjectType="{x:Type local:Calculator}" MethodName="Add"> <ObjectDataProvider.MethodParameters> <system:String>0</system:String> <system:String>0</system:String> </Obj... 阅读全文
posted @ 2012-08-24 10:06 AYUI框架 阅读(231) 评论(0) 推荐(0) 编辑
摘要: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框架 阅读(1066) 评论(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框架 阅读(8445) 评论(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框架 阅读(1230) 评论(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框架 阅读(4850) 评论(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框架 阅读(1311) 评论(2) 推荐(0) 编辑
摘要:private TextBox tb; public MainWindow() { InitializeComponent(); } private void TextBox_LostFocus(object sender, RoutedEventArgs e) { tb = (TextBox)sender; DoubleAnimation ta = new DoubleAnimation(); ta.From = 0.5; ... 阅读全文
posted @ 2012-05-11 18:56 AYUI框架 阅读(1292) 评论(1) 推荐(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框架 阅读(562) 评论(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) 编辑
摘要:转载于http://xiaogangblog.com/archives/595<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="DataGrid"> <!--网格线颜色--> <Setter Property="Ca 阅读全文
posted @ 2012-05-04 14:08 AYUI框架 阅读(612) 评论(2) 推荐(0) 编辑
摘要:<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <ListBox Name="lb" Width="100" Height="100" Background="Red" SelectionMode="Single&qu 阅读全文
posted @ 2012-05-03 16:29 AYUI框架 阅读(703) 评论(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) 编辑
摘要:/// <summary> /// Window1.xaml 的交互逻辑 /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); this.rectangle1.PreviewMouseMove += new MouseEventHandler(rectangle1_PreviewMouseMove); this.canvas2.DragO... 阅读全文
posted @ 2012-04-20 18:03 AYUI框架 阅读(463) 评论(3) 推荐(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框架 阅读(1014) 评论(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框架 阅读(453) 评论(0) 推荐(0) 编辑
摘要:LOG4NET用法Log4net的优点:几乎所有的大型应用都会有自己的用于跟踪调试的API。因为一旦程序被部署以后,就不太可能再利用专门的调试工具了。然而 一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。日志具有以下优点:它可以提供应用程序运行时的精确环境,可供开发人员尽快找到应用程序中的Bug;一旦在程序中加入了 Log 输出代码,程序运行过程中就能生成并输出日志信息而无需人工干预。另外,日志信息可以输出到不同的地方。Log4net就是为这样一个目的设计的,用于.NET开发环境的日志记录包。Log4net的结构log4net 有四种主要的组件,分别是Logger(记录器), 阅读全文
posted @ 2012-04-19 14:04 AYUI框架 阅读(623) 评论(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) 编辑