摘要: img_backpic.Source = new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute)); UriKind有3种类型:RelativeOrAbsolute/Absolute/Relative,这里测试用了RelativeOrAbs 阅读全文
posted @ 2022-12-30 16:59 户的博客 阅读(275) 评论(0) 推荐(1) 编辑
摘要: 有一个功能需要在后台修改App.xaml中的<Application.Resources>的Style App.xaml中如下 <Style x:Key="firstColor" TargetType="Border"> <Setter Property="Background" Value="{D 阅读全文
posted @ 2022-12-30 16:41 户的博客 阅读(858) 评论(0) 推荐(1) 编辑
摘要: 根据类名获取Type 有用到一个方法参数是Type type,这里知道类名,找了两个方法 方法一(已测试): typeof(ClassName); 方法二(未测试): System.Reflection.Assembly.Load("程序集名称").GetType("FullClassName"); 阅读全文
posted @ 2022-12-30 16:15 户的博客 阅读(458) 评论(0) 推荐(0) 编辑
摘要: wpf获取ListBox的选中项,SelectionMode="Extended",可以选中多个,直接用 Aaa[] selects = (Aaa[])this.lb_id.SelectedItems 报错,可用写法: Aaa[] selects = this.lb_id.SelectedItems 阅读全文
posted @ 2022-12-30 11:15 户的博客 阅读(258) 评论(0) 推荐(0) 编辑