随笔分类 -  C#随笔

摘要:.NET Framework 4.8 运行时 安装提示已经安装了更高版本的话 就安装前一个 开发者工具包 安装成功后,重启电脑还是提示要求netframework4.8 该项目文件.csproj,4.8改成4.8.1 再次加载,会有选项 升级到4.8(4.8比4.8.1版本高??????) 选中升级 阅读全文
posted @ 2025-07-17 11:56 dyfisgod 阅读(46) 评论(0) 推荐(0)
摘要:很奇怪的问题,原因不明,多见于 <ContentControl Grid.Row="3" Grid.Column="2" cal:View.Model="{Binding Content}"/> 此种绑定场景下,对Content进行不同viewmodel的赋值,来达到切换界面内容的目的 解决办法: 阅读全文
posted @ 2025-02-18 11:57 dyfisgod 阅读(79) 评论(0) 推荐(0)
摘要:xaml部分主要代码: <Canvas x:Name="cvRuler" Margin="0" Background="WhiteSmoke" TextBlock.Foreground="Black"/> 后台主要代码 1 //画标尺 2 private void DrawRule() 3 { 4 阅读全文
posted @ 2024-12-02 17:04 dyfisgod 阅读(169) 评论(0) 推荐(0)
摘要:{Binding EnableCO2,Source={x:Static local:CommonClass.Instance} CommonClass.Instance:单例静态对象 EnableCO2:该对象的属性 阅读全文
posted @ 2024-11-15 11:08 dyfisgod 阅读(43) 评论(0) 推荐(0)
摘要:1 GMapRoute route = new GMapRoute(pointLatLngs) 2 { 3 Tag="route", 4 Shape=new Path() { Stroke= Brushes.DarkRed, StrokeDashArray= new DoubleCollection 阅读全文
posted @ 2024-11-01 11:05 dyfisgod 阅读(31) 评论(0) 推荐(0)
摘要:莫名其妙的问题,莫名其妙的解决办法…… 1 const double SCATTERSIZE = 5;//不设置不显示散点,搞不懂 2 3 const double SCATTERVALUE = 0;//不设置不显示散点,搞不懂 4 5 var scatterPoint = new ScatterP 阅读全文
posted @ 2024-10-28 13:45 dyfisgod 阅读(68) 评论(0) 推荐(0)
摘要:1 var rows = new int[] { 1, 2, 3, 4, 5, 6, 10 }; 2 if ((rows.Contains(10) ? true : false) && false) 3 { 4 //不会进入,因为true&&false=false 5 } 6 if (rows.Co 阅读全文
posted @ 2024-01-04 16:45 dyfisgod 阅读(26) 评论(0) 推荐(0)
摘要:1 <UserControl.Resources> 2 <PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation> 3 <ContextMenu x:Key="Cont 阅读全文
posted @ 2023-01-31 10:46 dyfisgod 阅读(71) 评论(0) 推荐(0)
摘要:参照此问题:https://www.cnblogs.com/mdumpling/p/9142410.html 写了个C#版本的,简单试了试,应该没问题 1 /// <summary> 2 /// 验证图是否为普通树 3 /// </summary> 4 /// <param name="n">图的节 阅读全文
posted @ 2021-11-16 11:07 dyfisgod 阅读(32) 评论(0) 推荐(0)
摘要:针对同一目录不重复打开新窗口 两种方法: 第一种,仅打开目录 1 static public class Win32Help 2 { 3 public enum ShowCommands : int 4 { 5 SW_HIDE = 0, 6 SW_SHOWNORMAL = 1, 7 SW_NORMA 阅读全文
posted @ 2020-12-24 15:28 dyfisgod 阅读(468) 评论(0) 推荐(0)
摘要:基于https://www.cnblogs.com/zhuqil/archive/2010/06/26/a-practical-state-machine-example.html 文中描述 修复的基于4.5的例子主要功能:开门 开锁 超时上锁 手动上锁 https://files.cnblogs. 阅读全文
posted @ 2020-11-17 11:51 dyfisgod 阅读(179) 评论(0) 推荐(0)
摘要:Keys formsKey = ...; Key wpfKey = ...; wpfKey = KeyInterop.KeyFromVirtualKey((int)formsKey); formsKey = (Keys)KeyInterop.VirtualKeyFromKey(wpfKey); 阅读全文
posted @ 2020-08-03 14:41 dyfisgod 阅读(672) 评论(0) 推荐(0)
摘要:static public class Win32Helper{ /// <summary> /// 释放命令行管理程序分配的ITEMIDLIST结构 /// Frees an ITEMIDLIST structure allocated by the Shell. /// </summary> / 阅读全文
posted @ 2020-06-29 14:53 dyfisgod 阅读(546) 评论(0) 推荐(0)
摘要:WPF的xaml中特殊字符表示 转自https://www.cnblogs.com/Laggage/p/10425423.html 直接看表,描述很清晰 字符 转义字符 备注 & (ampersand) &amp; 这个没什么特别的,几乎所有的地方都需要使用转义字符 > (greater-than 阅读全文
posted @ 2020-04-17 16:55 dyfisgod 阅读(186) 评论(0) 推荐(0)
摘要:IsEditable="True" 使Text绑定生效 IsReadOnly="True" 使Text不可编辑 哈哈哈哈哈^-^ 阅读全文
posted @ 2020-04-07 15:14 dyfisgod 阅读(961) 评论(0) 推荐(0)
摘要:集合A是集合B的子集(被包括或相同) 阅读全文
posted @ 2020-01-03 14:40 dyfisgod 阅读(1224) 评论(0) 推荐(0)
摘要:public class MotorType1 { public class MotorType2 { public class MotorType3 { /// /// 电机类型 /// ... 阅读全文
posted @ 2019-12-05 15:08 dyfisgod 阅读(492) 评论(0) 推荐(0)
摘要:最合适的还是上面的写法 转义符&#123;不好使的 要么 空格{ 要么 全角{ 要么binding 阅读全文
posted @ 2019-12-04 09:24 dyfisgod 阅读(173) 评论(0) 推荐(0)
摘要:1 class Program 2 { 3 const int u = 10000; 4 5 static void Main(string[] args) 6 { 7 Console.WriteLine("各点距离矩阵如下:"); 8 Console... 阅读全文
posted @ 2019-11-05 17:17 dyfisgod 阅读(432) 评论(0) 推荐(0)
摘要:父控件 PreviewMouseDown子控件 MouseDown 阅读全文
posted @ 2019-10-21 15:43 dyfisgod 阅读(969) 评论(0) 推荐(0)