11 2022 档案

摘要:wpf控件的MouseEnter事件中设置5秒后隐藏控件 System.Timers.Timer timer = new System.Timers.Timer(5 * 1000);//5秒 timer.Elapsed += new System.Timers.ElapsedEventHandler 阅读全文
posted @ 2022-11-23 14:07 户的博客 阅读(304) 评论(0) 推荐(0) 编辑
摘要:转载:调用线程无法访问此对象,因为另一个线程拥有该对象。 wpf控件MouseEnter绑定了事件,用Timer设置一段时间后执行时报异常 解决方法: this.Dispatcher.Invoke((Action)delegate () { //实现 }); 或 App.Current.Dispat 阅读全文
posted @ 2022-11-23 13:55 户的博客 阅读(1073) 评论(0) 推荐(0) 编辑
摘要:16进制、rgb格式、提供的颜色示例: xxx.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFFF")); xxx.Background = new SolidColorBrush(Col 阅读全文
posted @ 2022-11-23 11:47 户的博客 阅读(1192) 评论(0) 推荐(0) 编辑
摘要:音乐播放列表,鼠标右键点击列表时,出现添加到歌单,做成每次右键点击时,后台新增选项了(也可以前台绑定数据源每次增删改后更新数据源) TextBlock text = new TextBlock(); text.Text = "添加到歌单-" + list.Name; text.MouseDown + 阅读全文
posted @ 2022-11-23 11:46 户的博客 阅读(206) 评论(0) 推荐(0) 编辑
摘要:参考:http://www.360doc.com/content/17/1113/11/24811_703389993.shtml // 1)子页面后台定义委托 (namespace下class外) //定义委托 internal delegate void ColorChange(object s 阅读全文
posted @ 2022-11-23 11:45 户的博客 阅读(742) 评论(0) 推荐(0) 编辑
摘要:想做成选择颜色后,更换窗体主题颜色 1、在App.xaml中记录当前颜色 <Application.Resources> <SolidColorBrush x:Key="color1" Color="White"></SolidColorBrush> </Application.Resources> 阅读全文
posted @ 2022-11-22 01:16 户的博客 阅读(2346) 评论(0) 推荐(0) 编辑
摘要:数据源list,设置ListBoxItem实现 <Page.Resources> <Style TargetType="ListBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Lis 阅读全文
posted @ 2022-11-22 01:15 户的博客 阅读(330) 评论(0) 推荐(0) 编辑
摘要:JsonConvert.SerializeObject(list); 这样转换时,发现结果为[{},{},{},{},{}],因为list对象和对象属性访问级别设为了internal,修改为public后正常 阅读全文
posted @ 2022-11-06 13:00 户的博客 阅读(552) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示