合集-wpf

摘要:TextWrapping="Wrap" 不显示滚动条 ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" 阅读全文
posted @ 2024-08-13 15:24 echo-efun 阅读(78) 评论(0) 推荐(0)
摘要://view和viewmodel绑定 DataContext = LogViewModel.Instance; //指具体绑定对象 阅读全文
posted @ 2024-08-13 15:45 echo-efun 阅读(54) 评论(0) 推荐(0)
摘要:https://learn.microsoft.com/zh-cn/dotnet/core/porting/ 阅读全文
posted @ 2024-08-14 14:18 echo-efun 阅读(23) 评论(0) 推荐(0)
摘要:<Viewbox Stretch="Fill"> 布局内容 </Viewbox> 阅读全文
posted @ 2024-08-20 18:56 echo-efun 阅读(48) 评论(0) 推荐(0)
摘要:Invoke是同步更新,会阻塞所在工作者线程,而BeginInvoke是异步更新,不会阻塞当前线程 阅读全文
posted @ 2024-08-26 13:38 echo-efun 阅读(34) 评论(0) 推荐(0)
摘要:拖放通常指一种数据传输的方法:使用鼠标(或类似其他设备)选择一个或多个对象,将其拖至用户界面(UI)中的目标位置 1.拖放操作通常涉及两个参与方 *拖动对象、拖放目标 *拖动对象和拖放目标可能是相同应用程序或不同应用程序中的UI元素 *在 Internet 区域中 OLE 拖放无效 *拖放属于广义的 阅读全文
posted @ 2024-09-25 10:38 echo-efun 阅读(160) 评论(0) 推荐(0)
摘要:1.创建拖放对象 1.1创建一个圆自定义控件,UI代码如下(Circle.xaml): <UserControl x:Class="WpfApp1.Circle" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xm 阅读全文
posted @ 2024-09-25 11:01 echo-efun 阅读(378) 评论(0) 推荐(0)
摘要:private System.Threading.Mutex mutex; public App() { this.Startup += new StartupEventHandler(App_Startup); } private void App_Startup(object sender, S 阅读全文
posted @ 2024-09-26 17:30 echo-efun 阅读(171) 评论(0) 推荐(0)
摘要:类继承INotifyPropertyChanged接口,然后把List的类型改为ObservableCollection 如下 private ObservableCollection<string> reagentNameList = new ObservableCollection<string 阅读全文
posted @ 2024-09-29 15:30 echo-efun 阅读(74) 评论(0) 推荐(0)
摘要:WindowState="Maximized" //窗口最大化 WindowStyle="None" //不使用wpf自带标题栏 阅读全文
posted @ 2024-09-30 15:32 echo-efun 阅读(78) 评论(0) 推荐(0)
摘要:找不到字典时设置如下 <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Themes/1.xaml"/> <ResourceDictionary Source="/The 阅读全文
posted @ 2024-09-30 16:59 echo-efun 阅读(307) 评论(0) 推荐(0)
摘要:textbox中UpdateSourceTrigger=PropertyChanged,设置此属性后,输入非零整数无问题,输入小数有问题, 更改为UpdateSourceTrigger=LostFocus后,输入小数无问题 阅读全文
posted @ 2024-11-15 14:02 echo-efun 阅读(79) 评论(0) 推荐(0)
摘要:1.绑定新建类文件(使用BindableBase方式) public class sample:BindableBase { private double blendPreVolume; /// <summary> /// 混匀前吸体积 /// </summary> public double Bl 阅读全文
posted @ 2025-03-06 09:29 echo-efun 阅读(53) 评论(0) 推荐(0)
摘要:一、现象 wpf 文本框不能输入小数点 二、原因 WPF的Textbox绑定在.NET4.5+中的默认行为变更 从.NET 4.5开始,TextBox.Text的绑定默认启用了FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchroniz 阅读全文
posted @ 2025-10-11 10:14 echo-efun 阅读(60) 评论(0) 推荐(0)
摘要:<XmlDataProvider x:Key="ExpenseDataSource" XPath="Expenses"> <x:XData> <Expenses xmlns=""> <Person Name="Mike" Department="Legal"> <Expense ExpenseTyp 阅读全文
posted @ 2026-03-30 16:52 echo-efun 阅读(5) 评论(0) 推荐(0)
摘要:在 .NET Framework 中,DataObject 类是实现数据传输机制的核心组件,它为拖放、剪贴板等操作提供了与格式无关的数据传输方式。它主要有两个实现,分别位于不同的命名空间:System.Windows.Forms.DataObject——这个类主要用于 Windows 窗体(WinF 阅读全文
posted @ 2026-03-30 18:36 echo-efun 阅读(35) 评论(0) 推荐(0)
摘要:微软官方例程 https://learn.microsoft.com/zh-cn/dotnet/desktop/wpf/advanced/walkthrough-enabling-drag-and-drop-on-a-user-control public Circle(Circle c) { In 阅读全文
posted @ 2026-03-31 10:44 echo-efun 阅读(11) 评论(0) 推荐(0)
摘要:wpf例程合集https://github.com/microsoft/WPF-Samples/tree/main 阅读全文
posted @ 2026-03-31 11:57 echo-efun 阅读(14) 评论(0) 推荐(0)
摘要:示例代码如下: <Window x:Class="SDKSamples.MultiWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.c 阅读全文
posted @ 2026-03-31 15:29 echo-efun 阅读(5) 评论(0) 推荐(0)
摘要:1、导入本地命名空间 <Window x:Class="DemoApplication.MainWindow" xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="https://schemas.mi 阅读全文
posted @ 2026-03-31 16:50 echo-efun 阅读(6) 评论(0) 推荐(0)
摘要:微软官网链接https://learn.microsoft.com/zh-cn/previous-versions/dotnet/netframework-4.0/ms750559(v=vs.100) 阅读全文
posted @ 2026-03-31 17:11 echo-efun 阅读(4) 评论(0) 推荐(0)
摘要:1、xaml不能直接承载winform窗体,可以承载usercontrol等控件 2、.net framework目前成功实现wpf中加载winform usercontrol控件,.net项目暂未能成功实现 3、.net framework实现关键步骤 3.1、添加引用 WindowsFormsI 阅读全文
posted @ 2026-04-01 09:57 echo-efun 阅读(9) 评论(0) 推荐(0)
摘要:1、shape介绍 1.1、形状Shape包括Ellipse、Line、Path、Polygon、Polyline、Rectangle 1.2、Shape对象派生于UIElement 1.3、Shape对象共享属性 *Stroke——绘制形状的轮廓方式(如边框颜色) *StrokeThickness 阅读全文
posted @ 2026-04-01 14:20 echo-efun 阅读(7) 评论(0) 推荐(0)
摘要:<Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <C 阅读全文
posted @ 2026-04-01 16:26 echo-efun 阅读(3) 评论(0) 推荐(0)