WPF
文章平均质量分 84
OneOnce
这个作者很懒,什么都没留下…
展开
-
WPF异常捕捉
public partial class App : Application{ public App() { Application.Current.DispatcherUnhandledException += Application_DispatcherUnhandledException; // UI线程异常捕获 AppDomain.Curr原创 2017-05-17 17:30:32 · 550 阅读 · 0 评论 -
C# XML转Json
Json使用第三方的LightJson辅助类:public static class TextUtil{ public static bool IsContainString(string input) { if (string.IsNullOrEmpty(input)) {原创 2017-09-20 17:36:34 · 2490 阅读 · 0 评论 -
WPF 自定义TextBox(WPF带图片,占位符,清除按钮的TextBox)改造版
效果:Style:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ctrls="clr-namespace原创 2017-08-10 20:05:49 · 3905 阅读 · 2 评论 -
WPF进程接收启动参数
1. 定义一个类,实现Main静态方法public class AppEntrance{ [STAThread] public static void Main(string[] args) { App app = new App(); app.Run(); }}2. 为了把参数传递到MainWindow,需给MainWind原创 2017-08-25 17:53:14 · 2202 阅读 · 0 评论 -
WPF ComboBox
效果Sytle<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ctrls="clr-namespace:Image原创 2017-08-14 13:23:48 · 4746 阅读 · 0 评论 -
WPF PasswordBox点击眼睛查看明文样式
效果:WPF PasswordBox样式(占位符,清除按钮 )其他资源查看上一篇:Style: <Border x:Name="PART_Root"原创 2017-08-15 16:50:44 · 7806 阅读 · 5 评论 -
WPF PasswordBox样式(占位符,清除按钮 )
有些部分是从别人那拿过来的。效果:Style:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"原创 2017-08-15 14:17:13 · 4840 阅读 · 0 评论 -
WPF ScrollViewer样式
效果scrollviewer Style:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"原创 2017-08-14 13:19:09 · 1488 阅读 · 0 评论 -
WPF ImageButton升级版
Style<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ImageButtonTe原创 2017-08-09 16:51:29 · 1565 阅读 · 4 评论 -
WPF子弹头复选框(BulletCheckBox)
style<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly原创 2017-08-10 16:11:41 · 969 阅读 · 0 评论 -
WPF播放GIF
GifMediaControl:public class GifMediaControl : MediaElement{ public GifMediaControl() { this.Loaded += GifMediaControlLoaded; } private void GifMediaControlLoaded(object原创 2017-08-17 15:17:25 · 613 阅读 · 0 评论 -
WPF Virtualizing Panel
VirtualizingWrapPanel:public class VirtualizingWrapPanel : VirtualizingPanel, IScrollInfo{ #region Fields UIElementCollection _children; ItemsControl _itemsControl; IItemContaine转载 2017-08-17 15:12:23 · 1236 阅读 · 0 评论 -
WPF ListView显示GridLine(可选), 通过附加属性修改
效果见上一篇。Style:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"原创 2017-08-17 11:38:47 · 1087 阅读 · 0 评论 -
WPF自定义TextBox(可选:图片, 占位符)
public class ImageTextBox : TextBox { private const double PLACEHOLDER_FONTSIZE_DEF = 10.0; private const double NUMERATOR = 1.0; private const double DENOMINATOR = 5.0;原创 2017-07-23 21:48:49 · 906 阅读 · 0 评论 -
WPF ListView显示GridLine(可选)
有的代码是大神提供的,只是整理了一下效果修改GridLine是否可见,以及线宽:CollapsedCollapsedVisible-->Visible--> 210,0,-1,040#80365080#80FFFFFFStyle:<Window x:Class="ListViewTest.Ma原创 2017-08-16 18:09:37 · 2330 阅读 · 0 评论 -
WPF操作SQLite
IDE:VS2017 community通过NuGet获取SQLiteSQLite增、删、改、查:using System;using System.Collections.Generic;using System.Data.SQLite;using System.Linq;using System.Text;using System.Threading.Task原创 2017-05-19 11:22:13 · 2925 阅读 · 0 评论 -
WPF本地化(多语言)语言解决方案
工程目录结构:LocalizedLangExtension.csusing System;using System.Collections.Generic;using System.ComponentModel;using System.Diagnostics;using System.Globalization;using System.Linq;using原创 2017-05-17 11:37:28 · 2632 阅读 · 1 评论 -
WPF ImageButton
创建CustomControlGeneric.xaml<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr原创 2017-06-12 14:11:11 · 2675 阅读 · 1 评论