- 博客(10)
- 资源 (3)
- 收藏
- 关注
原创 WPF单实例
1.使用Mutex方式public partial class App : Application{ Mutex mutex; protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); string mutexName = "SingleI
2012-06-27 10:39:28 2499
原创 自定义Command
创建好Command,CommandSource和一个接口类型。 public interface IClearControl { bool IsChanged { get; } void Clear(); } public class ClearCommand : ICommand { public bo
2012-06-13 16:53:23 1233
原创 关于Command
首先,谈一下Menu菜单的Commad <TextBox BorderBrush="Black" BorderThickness="2" Margin="25" TextWrapping="Wrap"> The MenuItem will not be enabled unt
2012-06-12 17:08:01 716
原创 使用EventLog写Windows系统日志
public static void WriteLog(string message) { try { EventLog log = new EventLog("MyLog"); // 首先应判断日志来源是否存在,一个日志来源只能同时与一个事件绑定 if (!EventLog.Sourc
2012-06-08 16:35:57 3076
原创 获取TIF中的图片
//此处修改文件路径 using (Tiff tif = Tiff.Open(@"c:\1.tif", "r")) { for (short i = 0; i < tif.NumberOfDirectories(); i++) { tif.SetDirectory(i); // Find the width an
2012-06-07 16:14:28 2256
原创 ValidationRule
XAML private void ValidationError(object sender, RoutedEventArgs e) { if (Validation.GetErrors(slider).Count > 0) { txt.ToolTip = Validation.GetErrors(txt)[0].ErrorContent;
2012-06-07 14:59:19 1657
原创 ObjectDataProvider实现Add
public class Calc { /// /// Add /// /// /// /// /// 此处参数为int型,所以需要Converter把TextBox中的数据string类型 /// 转换成int型,否则不会成功调用该方法
2012-06-06 23:06:33 1327
原创 DataContext向下传递性
StackPanel1's DataContext private void btnChild_Click(object sender, RoutedEventArgs e)
2012-06-05 17:14:24 806
原创 C#调用CMD命令
Process process = new Process { StartInfo = { FileName = "cmd.exe", UseShellExecute = false, RedirectStandardInput = true,
2012-06-05 14:12:10 649
原创 C#使用Log4Net
配置文件: --> AssemblyInfo添加:[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension = "co
2012-06-04 17:55:37 947
Windows Presentation Foundation and the Model View ViewModel Pattern
2012-03-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人