摘要: 这个控件没有水印属性,依然使用依赖属性解决 public class DatePickerHelper { public static object GetWatermark(DependencyObject obj) { return (ob... 阅读全文
posted @ 2014-08-25 19:39 wxing67 阅读(524) 评论(0) 推荐(0) 编辑
摘要: PasswordBox的Password属性因为安全原因不支持直接绑定,可以使用依赖属性实现。直接插入代码public class PasswordBoxHelper { public static readonly DependencyProperty PasswordProp... 阅读全文
posted @ 2014-08-25 19:33 wxing67 阅读(3155) 评论(0) 推荐(0) 编辑
摘要: public int weekofyear(DateTime dtime) { int weeknum = 0; DateTime firstDay = new DateTime(dtime.Year, 1, 1); i... 阅读全文
posted @ 2014-07-23 09:43 wxing67 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 方法一使用mvvmlight:xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4" 方法二:xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Win.. 阅读全文
posted @ 2013-09-14 09:29 wxing67 阅读(2622) 评论(0) 推荐(0) 编辑
摘要: public static class PredicateBuilder { public static Expression> True() { return f => true; } public static Expression> False() { return f => false; } public static Expression Compose(this Expression first, Expression second, Func merge) { // build paramete... 阅读全文
posted @ 2013-09-06 14:17 wxing67 阅读(443) 评论(0) 推荐(0) 编辑
摘要: private void SendEmail(object sender, RoutedEventArgs e) { if (!PingIpOrDomainName("www.google.com")) { mainViewModel.MessageText = "Network impassability!";return; } string pattern = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"; ... 阅读全文
posted @ 2013-07-22 10:55 wxing67 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 同学们,看下面的代码段就明白了:一对多:public ICollection GetReportLookup(IEnumerable specialityID){var list = _Repo.All(p => specialityID.Contains(p.Speciality.Id)).ToList();return list;}多对一:public ICollection GetReportLookup(Guid specialityID){var list = _Repo.All(p => p.Specialitys.Contains(specialityID)).ToL 阅读全文
posted @ 2013-07-15 17:16 wxing67 阅读(353) 评论(1) 推荐(0) 编辑
摘要: new WindowInteropHelper(this).Handle 阅读全文
posted @ 2013-07-05 17:46 wxing67 阅读(202) 评论(0) 推荐(0) 编辑
摘要: BitmapSource bitmap = null;int degreeBrightness = 0;int degreeContrast = 0;private void SetBrightness(int degree){degree = degree * 255 / 100;WriteableBitmap wb = new WriteableBitmap(bitmap);uint[] PixelData = new uint[wb.PixelWidth * wb.PixelHeight];wb.CopyPixels(PixelData, 4 * wb.PixelWidth, 0);fo 阅读全文
posted @ 2013-07-05 15:58 wxing67 阅读(2293) 评论(0) 推荐(0) 编辑
摘要: 有代码才有真相:public static string ConnectionServerOra { get { try { RegistryKey rk = Registry.LocalMachine; RegistryKey sk = rk.OpenSubKey(@"SOFTWARE\HL Software\BaseDb"); string net = sk.G... 阅读全文
posted @ 2012-10-29 17:01 wxing67 阅读(571) 评论(0) 推荐(0) 编辑