随笔分类 - .Net-WPF
WPF的知识
摘要:一、为什么称MVVM被滥用 1、什么是MVVM? MVVM是Model-View-ViewModel的简写。它本质上就是MVC的改进版。MVVM模式有助于将应用程序的业务和表示逻辑与用户界面 (UI) 清晰分离。 保持应用程序逻辑和UI之间的清晰分离有助于解决许多开发问题,并使应用程序更易于测试、维
阅读全文
摘要:1、HelixToolkit 2、Microsoft.Direct3D.D3D12 3、SharpDX.Direct3D12 与 SharpDX
阅读全文
摘要:dockPanel1.LastChildFill=true;
阅读全文
摘要:txt1.ClipToBounds=true;
阅读全文
摘要:代码如下: <Window x:Class="WpfApp1.Test1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/20
阅读全文
摘要:代码: <Path Margin="0" Width="14" Height="14" Stretch="Fill" Fill="#40568d" Data="M344 576v-192L56 624l288 240v-192h240a384 384 0 1 0 0-768H152v96h432a2
阅读全文
摘要:<ListView.Resources> <Style TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Visibility" Value="Collapsed"/> </Style> </ListView.Resource
阅读全文
摘要:private void trvw_MouseDown(object sender, MouseButtonEventArgs e) { if (e.Source is TreeViewItem treeViewItem) { if (e.RightButton == MouseButtonStat
阅读全文
摘要:一、原代码: XAML: <TreeView x:Name="trvwProjectList" Margin="0,0,0,0" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" BorderBrush="DarkGray"
阅读全文
摘要:示例: <Button Margin="10,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Content="按钮_具有右键菜单"> <Button.ContextMenu> <ContextMenu StaysOpen="tr
阅读全文
摘要:App.xaml: <Application x:Class="ZhiBiXiaoBai.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.
阅读全文
摘要:一、原因: ‘_’在WPF中用于表示访问键。 二、对策: 建立新样式,并关闭lable对快捷键的自动处理:RecognizesAccessKey="True"=》"False",如下: <!-- 不对下划线进行处理 --> <Style x:Key="LabelStyle1" TargetType=
阅读全文
摘要:public partial class App : Application { /// <summary> /// 异常处理 /// </summary> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(
阅读全文
摘要:Window window1 = new Window(); window1.Title = "新窗口"; window1.Background = Brushes.LightBlue; // SolidColorBrush brush1 = new SolidColorBrush(Colors.Y
阅读全文
摘要:Log4Net官方文档 1.创建MS SQL Server日志表 CREATE TABLE [dbo].[Log] ( [Id] [int] IDENTITY (1, 1) NOT NULL, [Date] [datetime] NOT NULL, [Thread] [varchar] (255)
阅读全文
摘要:一、阿里巴巴图标矢量库(https://www.iconfont.cn/) 1、创建字体工程 2、往工程里添加图标 3、生成并下载字体文件 点击上图的“下载到本地”按钮。 4、window下安装字体库并查看查看对应的unicode码 ① 双击“iconfont.ttf”文件安装字体: ② 打开“控制
阅读全文
摘要:TextBox样式(放到<Window.Resources/>里): <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/> <SolidColorBrush x:Key="TextBox.MouseOver.Border
阅读全文
摘要:一、样式一:方型 1、样式代码: <Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}"> <Setter Property="Background" Value="#FF26405B"/> <Setter Property="Temp
阅读全文
摘要:代码如下: <Style x:Key="ButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Cursor" Value="Hand"/> <Setter Property="Template"> <Setter.Value> <C
阅读全文
摘要:取值(字符串): string str = new TextRange(richtextbox.Document.ContentStart, richtextbox.Document.ContentEnd).Text; 赋值: // 方式一 string srt="12356457"; Paragr
阅读全文