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

浙公网安备 33010602011771号