上一页 1 ··· 3 4 5 6 7 8 9 10 下一页

2018年3月9日

C# wpf 阻止*和|的输入

摘要: private void texBox_KeyDown(object sender, KeyEventArgs e) { if (Keyboard.Modifiers == ModifierKeys.Shift) { if(Keyboard.IsKeyDown(Key.D8)) { e.Handle 阅读全文

posted @ 2018-03-09 15:51 Shine-Zhong 阅读(200) 评论(0) 推荐(0) 编辑

2018年1月22日

wpf 查找children的方法

摘要: var newValue = (bool)args.NewValue; HZWaitLoadingEx source = (HZWaitLoadingEx)sender; ControlTemplate ct = source.Template; ContentPresenter busyconte 阅读全文

posted @ 2018-01-22 14:37 Shine-Zhong 阅读(696) 评论(0) 推荐(0) 编辑

2018年1月18日

wpf XAML 设计器异常,提示NullReferenceException 未将对象引用设置到对象例

摘要: 设计了一个控件,然后在使用该控件的界面上,出现上图,这个应该是设计器的bug,解决办法 不要在界面上直接写Load事件 在cs构造函数里手动注册,并且在控件的构造函数里增加判断 if (DesignerProperties.GetIsInDesignMode(this)) { return; } / 阅读全文

posted @ 2018-01-18 18:09 Shine-Zhong 阅读(557) 评论(1) 推荐(1) 编辑

2018年1月4日

wpf 用户自定义事件传参

摘要: //自定义传参 ,对外联系的参数 public class ImageZoomChangedEventArgs : RoutedEventArgs { /// /// 放大倍数,1:原始尺寸 /// public int Zoom { get; set; } public ImageZoomChanged... 阅读全文

posted @ 2018-01-04 15:28 Shine-Zhong 阅读(621) 评论(0) 推荐(0) 编辑

wpf image 指定Stretch="None" 不拉伸的时候,仍然拉伸的解决办法

摘要: I think TI82 is right on this issue. The image become bigger than you expect because its dpi doesn't match the dpi of your system setting. A simply wo 阅读全文

posted @ 2018-01-04 11:50 Shine-Zhong 阅读(621) 评论(0) 推荐(0) 编辑

2017年12月15日

当父级绑定了DataContext之内的数据源时,子级想重新绑回DataContext

摘要: <Grid x:Name="NewDeploymentObjectPanel" Background="White" DataContext="{Binding Detail}"> <Grid Grid.Row="13" DataContext="{Binding DataContext, Rela 阅读全文

posted @ 2017-12-15 09:43 Shine-Zhong 阅读(162) 评论(0) 推荐(0) 编辑

2017年12月6日

wpf 千位符 格式化字符串

摘要: StringFormat={}{0:N2}}//格式话字符串,增加千位符,2保留小数点后2位 StringFormat={}{0:N0}}//格式话字符串,增加千位符,无小数点后 阅读全文

posted @ 2017-12-06 10:36 Shine-Zhong 阅读(208) 评论(0) 推荐(0) 编辑

2017年12月1日

wpf 如果列表加载超多数据变的卡顿时,使用VirtualizingStackPanel

摘要: 如果列表加载超多数据变的卡顿时 <ListBox > <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Vertical" />//加这句 </ItemsPanelTemplate> 阅读全文

posted @ 2017-12-01 09:49 Shine-Zhong 阅读(824) 评论(0) 推荐(0) 编辑

2017年11月21日

wpf DataTemplate ColumnDefinition width equal

摘要: <Grid.ColumnDefinitions> <ColumnDefinition SharedSizeGroup="col1" /> <ColumnDefinition SharedSizeGroup="col2" /> </Grid.ColumnDefinitions> <ListBox Gr 阅读全文

posted @ 2017-11-21 16:01 Shine-Zhong 阅读(180) 评论(0) 推荐(0) 编辑

2017年10月17日

wpf 自定义控件展开popup,点击popup之外的部分,popup不能自动关闭

摘要: 比如textbox点击展开popup,这样popup也是不能自动关闭的。可能是textbox获得了焦点。 可是使用textblock,或者ToggleButton来代替textbox点击展开popup。可以有奇效 阅读全文

posted @ 2017-10-17 17:50 Shine-Zhong 阅读(1231) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 下一页

导航