随笔分类 -  WPF

1 2 3 4 5 ··· 9 下一页
摘要:我们经常要遍历FlowDocument文档 查找元素,具体的写法之一 : 打印出文档的结构 private void TransformImagesTo642(FlowDocument flowDocument) { TextPointer navigator = flowDocument.Cont 阅读全文
posted @ 2024-04-26 06:37 小林野夫 阅读(48) 评论(0) 推荐(0)
摘要:存入数据库。 public string toxaml() { // Stream s = new MemoryStream(); // 其他的什么Stream类型都没问题 XamlWriter.Save( MemoryStream s=new MemoryStream(); TextRange d 阅读全文
posted @ 2024-04-25 19:38 小林野夫 阅读(99) 评论(0) 推荐(0)
摘要:cs文件: using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; using System. 阅读全文
posted @ 2024-04-22 01:29 小林野夫 阅读(285) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/xuliming/articles/StringFormat.html WPF中Binding使用StringFormat格式化字符串方法 货币格式 <TextBlock Text="{Binding Price, StringFormat= 阅读全文
posted @ 2024-04-20 12:50 小林野夫 阅读(570) 评论(0) 推荐(0)
摘要:原文:https://www.cnblogs.com/Cindys/archive/2012/09/11/2680501.html 空样式按钮 <Style x:Key="EmptyButtonStyle" TargetType="Button"> <Setter Property="Padding 阅读全文
posted @ 2024-04-18 16:03 小林野夫 阅读(104) 评论(0) 推荐(0)
摘要:Code: / Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Wi 阅读全文
posted @ 2024-04-18 01:55 小林野夫 阅读(54) 评论(0) 推荐(0)
摘要:TreeView展开所有节点 <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="True"></Setter> </Style> 阅读全文
posted @ 2024-04-17 10:20 小林野夫 阅读(549) 评论(0) 推荐(0)
摘要:ContextMenu样式 对应的xaml代码: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/w 阅读全文
posted @ 2024-04-17 10:18 小林野夫 阅读(88) 评论(0) 推荐(0)
摘要:好看的boder 阴影 <Border BorderThickness="1" Grid.Column="2" Grid.Row="1"> <Border BorderThickness="1" Grid.Column="2" Grid.Row="1" Margin="5" BorderBrush= 阅读全文
posted @ 2024-04-17 08:40 小林野夫 阅读(47) 评论(0) 推荐(0)
摘要:原文链接:https://www.cnblogs.com/larissa-0464/p/10227483.html 数据绑定: 更新内容:补充在MVVM模式上的TreeView控件数据绑定的代码。 xaml代码: <TreeView Name="syntaxTree" ItemsSource="{B 阅读全文
posted @ 2024-04-15 01:02 小林野夫 阅读(689) 评论(0) 推荐(0)
摘要:使用方法 <!--可以独立使用--> 使用要点: 1、 必须在窗体的无参构造函数 初始化位置 添加 this.SizeChanged += cMNButton.SizeChanged_ChangedIcon;-2、必须在窗体的无参构造函数 初始化位置 设置图标颜色(默认白色) cMNButton.M 阅读全文
posted @ 2024-04-13 03:18 小林野夫 阅读(52) 评论(0) 推荐(0)
摘要:使用方法: View <Window x:Class="IndividualQAlibrary.MVVM.Views.AddQAView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http: 阅读全文
posted @ 2024-04-13 03:10 小林野夫 阅读(445) 评论(0) 推荐(0)
摘要:在编辑RichTextBox内容时,我们看不到其文档的源码内容,因为我们没有像在Web开发中那样有浏览器自带的翻译功能可以使用(相关内容http://blog.sina.com.cn/s/blog_685790700100l61i.html)。 将会用到两个对象 System.Windows.Mar 阅读全文
posted @ 2024-04-10 19:24 小林野夫 阅读(175) 评论(0) 推荐(0)
摘要:,可以通过以下步骤实现: 首先,确保你已经在项目中引用了WPF工具包。可以通过在Visual Studio中的项目引用中添加对WPF工具包的引用来完成。 在你的MVVM模式中,创建一个名为"InsertTextCommand"的命令类,用于处理插入文本的逻辑。这个命令类应该实现ICommand接口, 阅读全文
posted @ 2024-04-06 17:25 小林野夫 阅读(220) 评论(0) 推荐(0)

1 2 3 4 5 ··· 9 下一页
原文链接:https://www.cnblogs.com/cdaniu/