摘要:
public static List<T> ToListModel<T>(this DataTable dt) { if (dt.Rows.Count <= 0) return null; string typeName = typeof(T).Name; using (MemoryStream m 阅读全文
摘要:
直接上代码: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); WindowStyle = WindowStyle.None; if (IsWindows8x()) { Re 阅读全文
摘要:
效果图: cs: 1 /// <summary> 2 /// ColorPick.xaml 的交互逻辑 3 /// </summary> 4 public partial class ColorPick : UserControl 5 { 6 ChangeSource _changeSource; 阅读全文
摘要:
<Window DataContext="{Binding MyViewModelInstance}"> <ListBox ItemsSource="{Binding MyDataItems}"> <ListBox.ContextMenu> <ContextMenu DataContext="{Bi 阅读全文
摘要:
public static string GetFileMD5(string filePath) { using (FileStream fs = new FileStream(filePath, FileMode.Open)) { System.Security.Cryptography.MD5C 阅读全文
摘要:
先看效果图: 黑色是需要经过的点; 黄色为控制点; 绿色为两点之间的中点。 方式一: 方式二: <Canvas x:Name="canvas2"/> 方法一代码,【这是别人的代码,时间久了忘记原出处了】: Path path; public void UpdateRoad(List<Point> l 阅读全文
摘要:
private void Tb_PreviewKeyDown(object sender, KeyEventArgs e) { bool isNumber = e.Key >= Key.D0 && e.Key <= Key.D9 || e.Key >= Key.NumPad0 && e.Key <= 阅读全文
摘要:
/// <sumary>/// 接收方/// </sumary>public void StartClient() { var factory = new NMSConnectionFactory(new Uri("activemq:failover:(tcp://localhost:61616/? 阅读全文
摘要:
#region MyRegion private IntPtr programIntPtr = IntPtr.Zero; bool inited { get; set; } public void Init() { try { if (inited) return; // 通过类名查找一个窗口,返回 阅读全文
摘要:
1 public class DragMoveBehavior : Behavior<UIElement> { Window window; Canvas parent; bool isDown; Point prePosition = new Point(); public Type Target 阅读全文