摘要: var data = new object[] { new { sn = SN, mac = Mac } }; var jobj = await Task.Run(() => { try { using (HttpClient client = new HttpClient()) { var url 阅读全文
posted @ 2021-09-29 18:08 吃奶嘴的路飞 阅读(47) 评论(0) 推荐(0)
摘要: new SolidColorBrush((Color)ColorConverter.ConvertFromString("#27212B")) 阅读全文
posted @ 2021-09-16 10:12 吃奶嘴的路飞 阅读(213) 评论(0) 推荐(0)
摘要: 某些时候命令绑定可能会存在刷新不及时,往往需要点击一次程序才能激活,特此记录下解决方案 System.Windows.Input.CommandManager.InvalidateRequerySuggested(); 阅读全文
posted @ 2021-08-13 09:41 吃奶嘴的路飞 阅读(49) 评论(0) 推荐(0)
摘要: 控制台、app等桌面应用程序(兼容系统自启) 1 System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) web BS架构 System.AppDomain.CurrentDomain.Base 阅读全文
posted @ 2021-07-16 10:09 吃奶嘴的路飞 阅读(81) 评论(0) 推荐(0)
摘要: 1 <Window x:Class="CommandDemo.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com 阅读全文
posted @ 2021-07-15 10:46 吃奶嘴的路飞 阅读(128) 评论(0) 推荐(0)
摘要: /// <summary> /// 获取随机数种子 /// </summary> /// <returns></returns> private int GetRandomSeed() { byte[] seedBuffer = Guid.NewGuid().ToByteArray(); retur 阅读全文
posted @ 2021-07-13 17:14 吃奶嘴的路飞 阅读(45) 评论(0) 推荐(0)
摘要: 1 /// <summary> 2 /// 将指定父级的下级索引元素,显示在视野下,使其可见 3 /// </summary> 4 /// <param name="control">父级</param> 5 /// <param name="i">需要可见的子集索引</param> 6 priva 阅读全文
posted @ 2021-06-24 10:02 吃奶嘴的路飞 阅读(40) 评论(0) 推荐(0)
摘要: 某些时候,需要验证控件之间是否存在重叠的情况,可以借助 System.Windows.Rect.IntersectsWith 来验证;如果需要获取重叠的部分,则使用 System.Windows.Rect.Intersect 来实现! <Window x:Class="轨迹规划Demo.MainWi 阅读全文
posted @ 2021-06-15 16:50 吃奶嘴的路飞 阅读(126) 评论(0) 推荐(0)
摘要: 场景:线程里面构建MVVM实体类,实体类包含 Brush 属性时,构建 SolidColorBrush 需要UI线程,否则会报 “必须在与 DependencyObject 相同的线程上创建 DependencySource” MVVM实体类 1 using System; 2 using Syst 阅读全文
posted @ 2021-03-22 17:51 吃奶嘴的路飞 阅读(670) 评论(0) 推荐(0)
摘要: private TreeViewItem FindTreeItem(TreeViewItem item, Func<TreeViewItem, bool> compare) { if (item == null) { return null; } var pd = compare?.Invoke(i 阅读全文
posted @ 2021-03-12 15:03 吃奶嘴的路飞 阅读(36) 评论(0) 推荐(0)