├── .gitignore
├── README.md
└── WPFControls
├── .idea
└── .idea.WPFControls
│ └── .idea
│ ├── .gitignore
│ ├── encodings.xml
│ ├── indexLayout.xml
│ └── vcs.xml
├── ButtonPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ButtonPlus.csproj
├── ButtonPlus.csproj.user
├── ButtonStyle.xaml
├── CustomToggleControl.cs
├── HeightToCornerRadiusConverter.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
└── ToggleStyle.xaml
├── ColorPicker
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ColorPicker.csproj
├── ColorPicker.csproj.user
├── ColorSelectorControl.xaml
├── ColorSelectorControl.xaml.cs
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── ComboBoxPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ComboBoxPlus.csproj
├── ComboBoxPlus.csproj.user
├── ComboboxStyle.xaml
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── CustomListView
├── CustomListView.csproj
└── Program.cs
├── DarkMode
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── CheckDarkModeControl.xaml
├── CheckDarkModeControl.xaml.cs
├── DarkMode.csproj
├── DarkMode.csproj.user
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Managers
│ └── ThemeManager.cs
└── Themes
│ ├── DarkModeDictionary.xaml
│ └── LightModeDictionary.xaml
├── DragWrapListBox
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── DragWrapListBox.csproj
├── DragWrapListBox.csproj.user
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── FadeInFadeOut
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── FadeInFadeOut.csproj
├── FadeInFadeOut.csproj.user
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── FloatWindow
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── FloatWindow.csproj
├── FloatWindow.csproj.user
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── GlobalLanguage
├── App.config
├── App.xaml
├── App.xaml.cs
├── GlobalLanguage.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── README.md
├── Strings
│ ├── MainWindow.Designer.cs
│ ├── MainWindow.resx
│ └── MainWindow.zh.resx
└── Style
│ └── ComboBoxStyle.xaml
├── HelperTools
├── AssemblyInfo.cs
├── Helper
│ └── FilePathHelper.cs
├── HelperTools.csproj
└── HelperTools.csproj.user
├── ImageDisplayer
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ButtonStyle.xaml
├── HeightToCornerRadiusConverter.cs
├── ImageDisplayer.csproj
├── ImageDisplayer.csproj.user
├── ImageDisplayerControl.xaml
├── ImageDisplayerControl.xaml.cs
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── ListSettings
├── ListSettings.csproj
└── Model.cs
├── ListViewPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ListPlus.csproj
├── ListPlus.csproj.user
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── LoadingControl
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── LoadingControl.csproj
├── LoadingControl.csproj.user
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── MefExample.Core
├── MefExample.Core.csproj
└── PluginService.cs
├── MefExample.Main
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MefExample.Main.csproj
├── MefExample.Main.csproj.user
└── PluginRepository.cs
├── MefExample.PluginOne
├── AssemblyInfo.cs
├── MefExample.PluginOne.csproj
├── MefExample.PluginOne.csproj.user
├── PluginExampleControl.xaml
└── PluginExampleControl.xaml.cs
├── MefExample.PluginTwo
├── AssemblyInfo.cs
├── MefExample.PluginTwo.csproj
├── MefExample.PluginTwo.csproj.user
├── PluginExampleControl.xaml
└── PluginExampleControl.xaml.cs
├── MenuBar
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MenuBar.csproj
└── MenuBar.csproj.user
├── MultiPageWrapListBox
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ButtonStyle.xaml
├── HeightToCornerRadiusConverter.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MultiPageWrapListBox.csproj
├── MultiPageWrapListBox.csproj.user
├── MultiPageWrapListBoxControl.xaml
└── MultiPageWrapListBoxControl.xaml.cs
├── MvvmPasswordBox
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MvvmPasswordBox.csproj
└── MvvmPasswordBox.csproj.user
├── PasswordBox
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Converter
│ ├── AntiBoolToVisibilityConverter.cs
│ ├── AntiStringToVisibilityConverter.cs
│ ├── BoolToVisibilityConverter.cs
│ └── StringToVisibilityConverter.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── PasswordBoxControl.xaml
├── PasswordBoxControl.xaml.cs
├── PasswordBoxPlus.csproj
├── PasswordBoxPlus.csproj.user
├── PasswordHelper.cs
└── Style
│ ├── EyeCheckBoxStyle.xaml
│ ├── RoundCornerPasswordBoxStyle.xaml
│ └── RoundCornerTextBoxStyle.xaml
├── PasswordBoxPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── PasswordBoxPlus.csproj
├── PasswordBoxPlus.csproj.user
├── PasswordBoxPlusHelper.cs
├── WatermarkTextBoxControl.xaml
└── WatermarkTextBoxControl.xaml.cs
├── RadioButtonPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── RadioButtonPlus.csproj
├── RadioButtonPlus.csproj.user
├── RadioButtonStyle.xaml
└── TCIRadioButton.cs
├── RountedEventExample
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── RountedEventExample.csproj
└── RountedEventExample.csproj.user
├── SerializationReplyListBox
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── NotifyObject.cs
├── ReplyListManager.cs
├── SerializationReplyListBox.csproj
├── SerializationReplyListBox.csproj.user
├── SerializationReplyListBox.xaml
└── SerializationReplyListBox.xaml.cs
├── Settings.Demo
├── App.config
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MultiData.cs
├── Properties
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Settings.Demo.csproj
└── Settings.Demo.csproj.user
├── SettingsListView
├── App.config
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── ButtonStyle.xaml
├── FileHistoryManager.cs
├── HeightToCornerRadiusConverter.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Settings.cs
├── SettingsListView.csproj
├── SettingsListView.csproj.user
├── SettingsListViewControl.xaml
└── SettingsListViewControl.xaml.cs
├── Shortcut
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── BoolToVisibilityConverter.cs
├── KeyboardHook.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MainWindowViewModel.cs
├── Shortcut.csproj
└── Shortcut.csproj.user
├── Slider
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Slider.csproj
├── Slider.csproj.user
├── TickSlideControl.xaml
└── TickSlideControl.xaml.cs
├── SortableListView
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── SortableListView.csproj
└── SortableListView.csproj.user
├── SqlDemo
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Database1.mdf
├── Database1_log.ldf
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── SqlDemo.csproj
└── SqlDemo.csproj.user
├── StateChange
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── StateChange.csproj
└── StateChange.csproj.user
├── TabControl
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── TabControl.csproj
├── TabControl.csproj.user
├── TabControlStyle.xaml
└── TabItemStyle.xaml
├── TabControls
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── TabControls.csproj
└── TabControls.csproj.user
├── TextBoxPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Converter
│ ├── BoolToCollapsedConverter.cs
│ └── BoolToVisibleConverter.cs
├── LimitedNumberBoxWithUnitControl.xaml
├── LimitedNumberBoxWithUnitControl.xaml.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── NumberBoxDropDownControl.xaml
├── NumberBoxDropDownControl.xaml.cs
├── NumberBoxPlus.csproj
├── NumberBoxPlus.csproj.user
├── NumericUpDownControl.xaml
├── NumericUpDownControl.xaml.cs
├── PageTurningControl.xaml
├── PageTurningControl.xaml.cs
├── TextBoxWithUnitControl.xaml
└── TextBoxWithUnitControl.xaml.cs
├── TitleBar
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Assets
│ ├── Resources
│ │ └── icon.png
│ └── Styles
│ │ ├── ButtonStyleDictionary.xaml
│ │ └── WindowStyle.xaml
├── Converters
│ ├── CaptionHeightConverter.cs
│ ├── WindowStateToPathConverter.cs
│ └── WindowStateToThicknessConverter.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── TitleBar.csproj
└── TitleBar.csproj.user
├── ToggleButtonPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── ToggleButtonPlus.csproj
├── ToggleButtonPlus.csproj.user
└── ToggleButtonStyle.xaml
├── TrayApp
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MainWindowViewModel.cs
├── NotifyIconWrapper.cs
├── Resources
│ └── Icon.ico
├── TrayApp.csproj
└── TrayApp.csproj.user
├── TreeViewPlus
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
└── MainWindow.xaml.cs
├── TreeviewPlus
├── TreePlus.csproj
└── TreePlus.csproj.user
├── WPFControls.sln
├── WPFControls.sln.DotSettings.user
├── WPFControls
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── WPFControls.csproj
└── WPFControls.csproj.user
└── WrapListBox
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── WrapListBox.csproj
├── WrapListBox.csproj.user
├── WrapListBoxControl.xaml
└── WrapListBoxControl.xaml.cs
/.gitignore:
--------------------------------------------------------------------------------
1 | WPFControls/*/obj/*
2 | WPFControls/.vs/*
3 | WPFControls/*/bin/*
4 | *.dll
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WPFControls
2 |
3 | WPF的组件示例。
4 |
5 | ## 暗黑模式
6 |
7 | ## 菜单栏
8 |
9 | ## 自定义标题
10 |
11 | ## 托盘菜单
12 |
13 | ## 状态切换
14 |
15 | ## Mef Example
16 |
17 | ## Dragablz Example
18 |
19 | ## 下拉输入框
20 |
21 | ## Numeric UpDown
22 |
23 | ## 可操作的ListView(在做了)
24 |
25 | ## 可操作的TreeView(在做了)
26 |
27 | ...还有其他的以后介绍
28 |
--------------------------------------------------------------------------------
/WPFControls/.idea/.idea.WPFControls/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # 默认忽略的文件
2 | /shelf/
3 | /workspace.xml
4 | # Rider 忽略的文件
5 | /projectSettingsUpdater.xml
6 | /modules.xml
7 | /contentModel.xml
8 | /.idea.WPFControls.iml
9 | # 基于编辑器的 HTTP 客户端请求
10 | /httpRequests/
11 | # Datasource local storage ignored files
12 | /dataSources/
13 | /dataSources.local.xml
14 |
--------------------------------------------------------------------------------
/WPFControls/.idea/.idea.WPFControls/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WPFControls/.idea/.idea.WPFControls/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WPFControls/.idea/.idea.WPFControls/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ButtonPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/ButtonPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/ButtonPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 | Designer
15 |
16 |
17 | Designer
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/CustomToggleControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Controls;
7 |
8 | namespace ButtonPlus
9 | {
10 | public class CustomToggleControl:Button
11 | {
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/HeightToCornerRadiusConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace ButtonPlus
11 | {
12 | class HeightToCornerRadiusConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | double height = (double)value;
17 | double cornerRadius = height / 2;
18 |
19 | return new CornerRadius(cornerRadius, cornerRadius, cornerRadius, cornerRadius);
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotSupportedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ButtonPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/ButtonPlus/ToggleStyle.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ColorPicker
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/ColorPicker.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 | true
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/ColorPicker.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/ColorPicker/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ColorPicker
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ComboBoxPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/ComboBoxPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/ComboBoxPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 | Designer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/WPFControls/ComboBoxPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ComboBoxPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/CustomListView/CustomListView.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/CustomListView/Program.cs:
--------------------------------------------------------------------------------
1 | // See https://aka.ms/new-console-template for more information
2 | Console.WriteLine("Hello, World!");
3 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace DarkMode
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/CheckDarkModeControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/CheckDarkModeControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace DarkMode
17 | {
18 | ///
19 | /// CheckDarkModeControl.xaml 的交互逻辑
20 | ///
21 | public partial class CheckDarkModeControl : UserControl
22 | {
23 | private string _themeStatusMsg = string.Empty;
24 | public string ThemeStatusMsg
25 | {
26 | get => _themeStatusMsg;
27 | set => _themeStatusMsg = value;
28 | }
29 |
30 | public CheckDarkModeControl(bool isDarkMode = true)
31 | {
32 | InitializeComponent();
33 | this.DataContext= this;
34 | if (isDarkMode)
35 | {
36 | ThemeStatusMsg = "Dark Mode";
37 | }
38 | else
39 | {
40 | ThemeStatusMsg= "Light Mode";
41 | }
42 | }
43 |
44 | private void SureButton_Click(object sender, RoutedEventArgs e)
45 | {
46 | Window parentWindow = Window.GetWindow(this);
47 | parentWindow.Close();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/DarkMode.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/DarkMode.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/Managers/ThemeManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Threading;
8 |
9 | namespace DarkMode.Managers
10 | {
11 | class ThemeManager
12 | {
13 | public static void SetTheme(bool isDark)
14 | {
15 | string uri = isDark ? "Themes/DarkModeDictionary.xaml" : "Themes/LightModeDictionary.xaml";
16 | ResourceDictionary newDict = new ResourceDictionary();
17 | newDict.Source = new Uri(uri, UriKind.Relative);
18 |
19 | // 从应用程序资源中获取所有已经合并的资源字典
20 | var dictionaries = Application.Current.Resources.MergedDictionaries;
21 |
22 | // 移除旧的字典
23 | var oldDict = dictionaries.FirstOrDefault(d => d.Source != null && d.Source.OriginalString.Contains("ModeDictionary.xaml"));
24 | if (oldDict != null)
25 | {
26 | dictionaries.Remove(oldDict);
27 | }
28 |
29 | // 添加新的字典
30 | dictionaries.Add(newDict);
31 |
32 | // 刷新UI以使更改生效
33 | Application.Current.Dispatcher.Invoke(() =>
34 | {
35 | foreach (Window window in Application.Current.Windows)
36 | {
37 | window.Dispatcher.Invoke(() => { }, System.Windows.Threading.DispatcherPriority.Background);
38 | }
39 | });
40 | }
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/Themes/DarkModeDictionary.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WPFControls/DarkMode/Themes/LightModeDictionary.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace DragWrapListBox
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/DragWrapListBox.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/DragWrapListBox.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/DragWrapListBox/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace DragWrapListBox
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace FadeInFadeOut
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/FadeInFadeOut.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/FadeInFadeOut.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/FadeInFadeOut/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FadeInFadeOut
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace FloatWindow
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/FloatWindow.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/FloatWindow.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/WPFControls/FloatWindow/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FloatWindow
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | WindowStartupLocation = WindowStartupLocation.Manual;
27 | this.Left= SystemParameters.MaximizedPrimaryScreenWidth - 200;
28 | this.Top= 100;
29 | }
30 |
31 | private void Main_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
32 | {
33 | DragMove();
34 | }
35 |
36 | private void Main_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
37 | {
38 | this.Close();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/GlobalLanguage.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | enable
6 | true
7 | 8
8 | net461
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | True
17 | True
18 | MainWindow.resx
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | PublicResXFileCodeGenerator
27 | MainWindow.Designer.cs
28 |
29 |
30 | MainWindow.resx
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | namespace GlobalLanguage.Properties {
11 |
12 |
13 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
14 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
15 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
16 |
17 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
18 |
19 | public static Settings Default {
20 | get {
21 | return defaultInstance;
22 | }
23 | }
24 |
25 | [global::System.Configuration.UserScopedSettingAttribute()]
26 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
27 | [global::System.Configuration.DefaultSettingValueAttribute("")]
28 | public string Culture {
29 | get {
30 | return ((string)(this["Culture"]));
31 | }
32 | set {
33 | this["Culture"] = value;
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/README.md:
--------------------------------------------------------------------------------
1 | # Global Language
2 | ## Description
3 |
4 | 提供一种适用于 WPF 的全球化语言方案。本 Demo 添加资源文件后使用了 Rider 的 Localization Manager 工具添加了 zh Culture,然后添加了一些示例文案资源。也可以使用 Visual Studio 添加和编辑资源文件。
5 |
6 | ## Usage
7 |
8 | 1. 创建 Strings 文件夹,在其中创建资源文件 MainWindow.resx。创建 ResourceManager 实例,传入资源文件的命名空间和资源文件名。
9 |
10 | ```csharp
11 | var LanguageManager= new ResourceManager("GlobalLanguage.Strings.MainWindow", Assembly.GetExecutingAssembly());
12 | ```
13 |
14 | 2. 设置语言,使用 CultureInfo 类的 CurrentCulture和CurrentUICulture 属性设置语言。
15 |
16 | ```csharp
17 | Thread.CurrentThread.CurrentUICulture = new CultureInfo(CurrentCulture);
18 | Thread.CurrentThread.CurrentCulture = new CultureInfo(CurrentCulture);
19 | ```
20 |
21 | 3. 使用 ResourceManager 实例的 GetString 方法获取资源文件中的文案。
22 |
23 | ```csharp
24 | LanguageManager.GetString("Title");
25 | ```
26 | 也可以在 xaml 中直接使用资源文件中的文案,需要先在 xaml 中引入资源文件的命名空间。
27 |
28 | ```xaml
29 | xmlns:strings="clr-namespace:GlobalLanguage.Strings"
30 |
31 |
32 | ```
33 | 在 xaml 中使用静态资源的方式,需要将资源文件的自定义生成工具设置为 PublicResXFileCodeGenerator,否则会报错。
34 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/Strings/MainWindow.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | text/microsoft-resx
11 |
12 |
13 | 1.3
14 |
15 |
16 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
17 |
18 |
19 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
20 |
21 |
22 | Warning
23 |
24 |
25 | Language
26 |
27 |
28 | Restart the app to apply the change of language.
29 |
30 |
31 | Hello World!
32 |
33 |
--------------------------------------------------------------------------------
/WPFControls/GlobalLanguage/Strings/MainWindow.zh.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 | text/microsoft-resx
4 |
5 |
6 | 1.3
7 |
8 |
9 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
10 |
11 |
12 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
13 |
14 |
15 | 警告
16 |
17 |
18 | 语言
19 |
20 |
21 | 重启程序以应用语言更改。
22 |
23 |
24 | 世界,你好!
25 |
26 |
--------------------------------------------------------------------------------
/WPFControls/HelperTools/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/HelperTools/HelperTools.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Library
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/HelperTools/HelperTools.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ImageDisplayer
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/HeightToCornerRadiusConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace ButtonPlus
11 | {
12 | class HeightToCornerRadiusConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | double height = (double)value;
17 | double cornerRadius = height / 2;
18 |
19 | return new CornerRadius(cornerRadius, cornerRadius, cornerRadius, cornerRadius);
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotSupportedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/ImageDisplayer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/ImageDisplayer.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 | Designer
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WPFControls/ImageDisplayer/ImageDisplayerControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WPFControls/ListSettings/ListSettings.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ListViewPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/ListPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/ListPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/WPFControls/ListViewPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ListPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace LoadingControl
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/LoadingControl.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/LoadingControl.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/LoadingControl/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace LoadingControl
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Core/MefExample.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Core/PluginService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.ComponentModel.Composition;
4 |
5 | namespace MefExample.Core
6 | {
7 | public class PluginService
8 | {
9 | [InheritedExport(typeof(IPluginService))]
10 | public interface IPluginService
11 | {
12 | string InitPlugin();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Main/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Main/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace MefExample.Main
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Main/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Main/MefExample.Main.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Main/MefExample.Main.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.Main/PluginRepository.cs:
--------------------------------------------------------------------------------
1 | using MefExample.Core;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.Composition;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace MefExample.Main
10 | {
11 | class PluginRepository
12 | {
13 | [ImportMany("IPluginService")]
14 | private IEnumerable PluginServices { get; set; }
15 | // For more convenience we will copy the available plugins in a List<>
16 | public List PluginServiceList { get; set; }
17 |
18 | ///
19 | /// Constructor
20 | ///
21 | ///
22 | public PluginRepository(IEnumerable pluginServices)
23 | {
24 | PluginServiceList = new List();
25 | foreach (var service in pluginServices)
26 | PluginServiceList.Add(service);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginOne/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginOne/MefExample.PluginOne.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginOne/MefExample.PluginOne.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginOne/PluginExampleControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginTwo/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginTwo/MefExample.PluginTwo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows
5 | enable
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginTwo/MefExample.PluginTwo.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WPFControls/MefExample.PluginTwo/PluginExampleControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/MenuBar/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/MenuBar/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace MenuBar
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/MenuBar/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/MenuBar/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace MenuBar
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/MenuBar/MenuBar.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/MenuBar/MenuBar.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace MultiPageWrapListBox
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/HeightToCornerRadiusConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace ButtonPlus
11 | {
12 | class HeightToCornerRadiusConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | double height = (double)value;
17 | double cornerRadius = height / 2;
18 |
19 | return new CornerRadius(cornerRadius, cornerRadius, cornerRadius, cornerRadius);
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotSupportedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/MultiPageWrapListBox.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/MultiPageWrapListBox/MultiPageWrapListBox.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 | Designer
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace MvvmPasswordBox
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace MvvmPasswordBox
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/MvvmPasswordBox.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/MvvmPasswordBox/MvvmPasswordBox.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace PasswordBoxPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/Converter/AntiBoolToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace PasswordBoxPlus.Converter
11 | {
12 | [ValueConversion(typeof(bool), typeof(Visibility))]
13 | class AntiBoolToVisibilityConverter : IValueConverter
14 | {
15 | #region IValueConverter Members
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if ((bool)value == false)
19 | {
20 | return Visibility.Visible;
21 | }
22 | else
23 | {
24 | return Visibility.Hidden;
25 | }
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
29 | {
30 | return null;
31 | }
32 | #endregion
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/Converter/AntiStringToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace PasswordBoxPlus.Converter
11 | {
12 | [ValueConversion(typeof(string), typeof(Visibility))]
13 | class AntiStringToVisibilityConverter : IValueConverter
14 | {
15 | #region IValueConverter Members
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if ((value as string) != string.Empty)
19 | {
20 | return Visibility.Visible;
21 | }
22 | else
23 | {
24 | return Visibility.Collapsed;
25 | }
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
29 | {
30 | return null;
31 | }
32 | #endregion
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/Converter/BoolToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace PasswordBoxPlus.Converter
11 | {
12 | [ValueConversion(typeof(bool), typeof(Visibility))]
13 | public class BoolToVisibilityConverter : IValueConverter
14 | {
15 | #region IValueConverter Members
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if ((bool)value == true)
19 | {
20 | return Visibility.Visible;
21 | }
22 | else
23 | {
24 | return Visibility.Hidden;
25 | }
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
29 | {
30 | return null;
31 | }
32 | #endregion
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/Converter/StringToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace PasswordBoxPlus.Converter
11 | {
12 | [ValueConversion(typeof(string), typeof(Visibility))]
13 | class StringToVisibilityConverter : IValueConverter
14 | {
15 | #region IValueConverter Members
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if ((value as string) == string.Empty)
19 | {
20 | return Visibility.Visible;
21 | }
22 | else
23 | {
24 | return Visibility.Collapsed;
25 | }
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
29 | {
30 | return null;
31 | }
32 | #endregion
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PasswordBoxPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/PasswordBoxPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBox/PasswordBoxPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 | Designer
23 |
24 |
25 | Designer
26 |
27 |
28 | Designer
29 |
30 |
31 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace PasswordBoxPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PasswordBoxPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/PasswordBoxPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/PasswordBoxPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/PasswordBoxPlusHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace PasswordBoxPlus
8 | {
9 | internal class PasswordBoxPlusHelper
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/WatermarkTextBoxControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/PasswordBoxPlus/WatermarkTextBoxControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace PasswordBoxPlus
17 | {
18 | ///
19 | /// WatermarkTextBoxControl.xaml 的交互逻辑
20 | ///
21 | public partial class WatermarkTextBoxControl : UserControl
22 | {
23 | public WatermarkTextBoxControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace RadioButtonPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace RadioButtonPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/RadioButtonPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/RadioButtonPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 | Designer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/WPFControls/RadioButtonPlus/TCIRadioButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace RadioButtonPlus
10 | {
11 | public class TCIRadioButton:RadioButton
12 | {
13 | public static readonly DependencyProperty TitleProperty =
14 | DependencyProperty.Register("Title", typeof(string), typeof(TCIRadioButton), new PropertyMetadata(string.Empty));
15 |
16 | public string Title
17 | {
18 | get => (string)GetValue(TitleProperty);
19 | set => SetValue(TitleProperty, value);
20 | }
21 |
22 | public static readonly DependencyProperty DescriptionProperty =
23 | DependencyProperty.Register("Description", typeof(string), typeof(TCIRadioButton), new PropertyMetadata(string.Empty));
24 |
25 | public string Description
26 | {
27 | get => (string)GetValue(DescriptionProperty);
28 | set => SetValue(DescriptionProperty, value);
29 | }
30 |
31 | public static readonly DependencyProperty TextWidthProperty =
32 | DependencyProperty.Register("TextWidth", typeof(double), typeof(TCIRadioButton), new PropertyMetadata());
33 |
34 | public double TextWidth
35 | {
36 | get => (double)GetValue(TextWidthProperty);
37 | set => SetValue(TextWidthProperty, value);
38 | }
39 |
40 | static TCIRadioButton()
41 | {
42 | DefaultStyleKeyProperty.OverrideMetadata(typeof(TCIRadioButton), new FrameworkPropertyMetadata(typeof(TCIRadioButton)));
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace RountedEventExample
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace RountedEventExample
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | private void YesNoCancelButton_Click(object sender, RoutedEventArgs e)
29 | {
30 | FrameworkElement sourceFrameworkElement = e.Source as FrameworkElement;
31 | switch (sourceFrameworkElement.Name)
32 | {
33 | case "YesButton":
34 | // YesButton logic.
35 | break;
36 | case "NoButton":
37 | // NoButton logic.
38 | break;
39 | case "CancelButton":
40 | // CancelButton logic.
41 | break;
42 | }
43 | e.Handled = true;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/RountedEventExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/RountedEventExample/RountedEventExample.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 | using System.Data;
3 | using System.Windows;
4 |
5 | namespace SerializationReplyListBox
6 | {
7 | ///
8 | /// Interaction logic for App.xaml
9 | ///
10 | public partial class App : Application
11 | {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 | using System.Windows.Data;
5 | using System.Windows.Documents;
6 | using System.Windows.Input;
7 | using System.Windows.Media;
8 | using System.Windows.Media.Imaging;
9 | using System.Windows.Navigation;
10 | using System.Windows.Shapes;
11 |
12 | namespace SerializationReplyListBox
13 | {
14 | ///
15 | /// Interaction logic for MainWindow.xaml
16 | ///
17 | public partial class MainWindow : Window
18 | {
19 | public MainWindow()
20 | {
21 | InitializeComponent();
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/NotifyObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Runtime.CompilerServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace SerializationReplyListBox
10 | {
11 | public class NotifyObject: INotifyPropertyChanged
12 | {
13 | public event PropertyChangedEventHandler? PropertyChanged;
14 | protected void UpdateProper(ref T properValue,
15 | T newValue,
16 | [CallerMemberName] string properName = "")
17 | {
18 |
19 | properValue = newValue;
20 | OnPropertyChanged(properName);
21 |
22 | }
23 |
24 | protected void OnPropertyChanged([CallerMemberName] string propertyName = "") =>
25 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/ReplyListManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace SerializationReplyListBox
9 | {
10 | public enum ReplyTypes
11 | {
12 |
13 | }
14 |
15 | public interface IBaseElement
16 | {
17 | public string Name { get; set; }
18 | public string Date { get; set; }
19 |
20 | }
21 |
22 | public interface IReply: IBaseElement
23 | {
24 | public ReplyTypes ReplyType { get; set; }
25 | }
26 |
27 | public interface IMainElement: IBaseElement where TReply: class, IReply
28 | {
29 | public string Content { get; set; }
30 |
31 | public ObservableCollection Replies { get; set; }
32 | }
33 |
34 | public class ReplyListManager: NotifyObject
35 | {
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/SerializationReplyListBox.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0-windows
6 | enable
7 | enable
8 | true
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/SerializationReplyListBox.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/SerializationReplyListBox.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/SerializationReplyListBox/SerializationReplyListBox.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace SerializationReplyListBox
17 | {
18 | ///
19 | /// SerializationReplyListBox.xaml 的交互逻辑
20 | ///
21 | public partial class SerializationReplyListBox : UserControl
22 | {
23 | public SerializationReplyListBox()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Settings.Demo
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Settings.Demo
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/MultiData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Settings.Demo
9 | {
10 | public class MultiData
11 | {
12 | public string Msg = string.Empty;
13 | public Color Color;
14 | }
15 |
16 | public class MultiDataList: List
17 | {
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/Settings.Demo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 | True
13 | True
14 | Settings.settings
15 |
16 |
17 |
18 |
19 |
20 | SettingsSingleFileGenerator
21 | Settings.Designer.cs
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WPFControls/Settings.Demo/Settings.Demo.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace SettingsListView
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/HeightToCornerRadiusConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows;
9 |
10 | namespace ButtonPlus
11 | {
12 | class HeightToCornerRadiusConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | double height = (double)value;
17 | double cornerRadius = height / 2;
18 |
19 | return new CornerRadius(cornerRadius, cornerRadius, cornerRadius, cornerRadius);
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotSupportedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/Settings.cs:
--------------------------------------------------------------------------------
1 | namespace SettingsListView.Properties {
2 |
3 |
4 | // This class allows you to handle specific events on the settings class:
5 | // The SettingChanging event is raised before a setting's value is changed.
6 | // The PropertyChanged event is raised after a setting's value is changed.
7 | // The SettingsLoaded event is raised after the setting values are loaded.
8 | // The SettingsSaving event is raised before the setting values are saved.
9 | internal sealed partial class Settings {
10 |
11 | public Settings() {
12 | // // To add event handlers for saving and changing settings, uncomment the lines below:
13 | //
14 | // this.SettingChanging += this.SettingChangingEventHandler;
15 | //
16 | // this.SettingsSaving += this.SettingsSavingEventHandler;
17 | //
18 | }
19 |
20 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
21 | // Add code to handle the SettingChangingEvent event here.
22 | }
23 |
24 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
25 | // Add code to handle the SettingsSaving event here.
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/SettingsListView.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/SettingsListView.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 | Designer
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/SettingsListViewControl.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/WPFControls/SettingsListView/SettingsListViewControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace SettingsListView
17 | {
18 | ///
19 | /// Interaction logic for SettingsListViewControl.xaml
20 | ///
21 | public partial class SettingsListViewControl : UserControl
22 | {
23 | public SettingsListViewControl()
24 | {
25 | InitializeComponent();
26 | this.DataContext = FileHistoryManager.Instance;
27 | }
28 |
29 | private void UserControl_Loaded(object sender, RoutedEventArgs e)
30 | {
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Shortcut
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/BoolToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Data;
9 |
10 | namespace Shortcut
11 | {
12 |
13 | internal class BoolToVisibilityConverter : IValueConverter
14 | {
15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | if ((bool)value == true)
18 | {
19 | return Visibility.Visible;
20 | }
21 | else
22 | {
23 | return Visibility.Hidden;
24 | }
25 | }
26 |
27 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
28 | {
29 | throw new NotImplementedException();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Shortcut
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/Shortcut.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WPFControls/Shortcut/Shortcut.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/Slider/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/Slider/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Slider
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/Slider/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/Slider/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/Slider/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Slider
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/Slider/Slider.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/Slider/Slider.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Code
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace SortableListView
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace SortableListView
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/SortableListView.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/SortableListView/SortableListView.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace SqlDemo
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/Database1.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiuAoran/WPFControls/2f7043dbf9fda962f740383e3762b4a9376405d9/WPFControls/SqlDemo/Database1.mdf
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/Database1_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiuAoran/WPFControls/2f7043dbf9fda962f740383e3762b4a9376405d9/WPFControls/SqlDemo/Database1_log.ldf
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace SqlDemo
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/SqlDemo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/SqlDemo/SqlDemo.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/StateChange/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/StateChange/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace StateChange
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/StateChange/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/StateChange/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace StateChange
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | private void RadioButton_Click(object sender, RoutedEventArgs e)
29 | {
30 | VisualStateManager.GoToElementState(StatusBorder, (sender as RadioButton)?.Content.ToString(), true);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/WPFControls/StateChange/StateChange.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/StateChange/StateChange.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/TabControl/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WPFControls/TabControl/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TabControl
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/TabControl/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/TabControl/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace TabControl
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/TabControl/TabControl.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/TabControl/TabControl.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 | Designer
15 |
16 |
17 | Designer
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TabControls
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace TabControls
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/TabControls.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WPFControls/TabControls/TabControls.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace NumberBoxPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace NumberBoxPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/NumberBoxPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/NumberBoxPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 | Code
15 |
16 |
17 | Code
18 |
19 |
20 | Code
21 |
22 |
23 |
24 |
25 | Designer
26 |
27 |
28 | Designer
29 |
30 |
31 | Designer
32 |
33 |
34 | Designer
35 |
36 |
37 | Designer
38 |
39 |
40 | Designer
41 |
42 |
43 |
--------------------------------------------------------------------------------
/WPFControls/TextBoxPlus/TextBoxWithUnitControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace NumberBoxPlus
17 | {
18 | ///
19 | /// TextBoxWithUnitControl.xaml 的交互逻辑
20 | ///
21 | public partial class TextBoxWithUnitControl : UserControl
22 | {
23 | // The dependency property which will be accessible on the UserControl
24 | public static readonly DependencyProperty UnitProperty =
25 | DependencyProperty.Register("Unit", typeof(string), typeof(TextBoxWithUnitControl), new UIPropertyMetadata(String.Empty));
26 |
27 | public string Unit
28 | {
29 | get { return (string)GetValue(UnitProperty); }
30 | set { SetValue(UnitProperty, value); }
31 | }
32 |
33 | public TextBoxWithUnitControl()
34 | {
35 | InitializeComponent();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TitleBar
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/Assets/Resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiuAoran/WPFControls/2f7043dbf9fda962f740383e3762b4a9376405d9/WPFControls/TitleBar/Assets/Resources/icon.png
--------------------------------------------------------------------------------
/WPFControls/TitleBar/Converters/CaptionHeightConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 |
9 | namespace TitleBar.Converters
10 | {
11 | class CaptionHeightConverter : IMultiValueConverter
12 | {
13 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return (double)values[0] + (double)values[1];
16 | }
17 |
18 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
19 | {
20 | return null;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/Converters/WindowStateToPathConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Data;
9 | using System.Windows.Media;
10 |
11 | namespace TitleBar.Converters
12 | {
13 | [ValueConversion(typeof(WindowState), typeof(Geometry))]
14 | class WindowStateToPathConverter : IValueConverter
15 | {
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | var ws = (WindowState)value;
19 | if (ws == WindowState.Normal)
20 | {
21 | return Geometry.Parse("M 13.5,10.5 H 22.5 V 19.5 H 13.5 Z");
22 | }
23 | else
24 | {
25 | return Geometry.Parse("M 13.5,12.5 H 20.5 V 19.5 H 13.5 Z M 15.5,12.5 V 10.5 H 22.5 V 17.5 H 20.5");
26 | }
27 | }
28 |
29 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
30 | {
31 | return null;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/Converters/WindowStateToThicknessConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Data;
9 |
10 | namespace TitleBar.Converters
11 | {
12 | [ValueConversion(typeof(WindowState), typeof(Thickness))]
13 | class WindowStateToThicknessConverter : IValueConverter
14 | {
15 |
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | var ws = (WindowState)value;
19 | if (ws == WindowState.Maximized)
20 | {
21 | return new Thickness(6);
22 | }
23 | else
24 | {
25 | // left, right and bottom borders are still drawn by the system
26 | return new Thickness(0, 1, 0, 0);
27 | }
28 | }
29 |
30 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
31 | {
32 | return null;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection.Metadata;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace TitleBar
18 | {
19 | ///
20 | /// Interaction logic for MainWindow.xaml
21 | ///
22 | public partial class MainWindow : Window
23 | {
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | private void Icon_MouseDown(object sender, MouseButtonEventArgs e)
30 | {
31 |
32 | }
33 |
34 | private void MinimizeButton_Click(object sender, RoutedEventArgs e)
35 | {
36 | SystemCommands.MinimizeWindow(this);
37 | }
38 |
39 | private void MaximizeRestoreButton_Click(object sender, RoutedEventArgs e)
40 | {
41 | if (this.WindowState == WindowState.Maximized)
42 | {
43 | SystemCommands.RestoreWindow(this);
44 | }
45 | else
46 | {
47 | SystemCommands.MaximizeWindow(this);
48 | }
49 | }
50 |
51 | private void CloseButton_Click(object sender, RoutedEventArgs e)
52 | {
53 | SystemCommands.CloseWindow(this);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/TitleBar.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Never
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WPFControls/TitleBar/TitleBar.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 | Designer
15 |
16 |
17 | Designer
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ToggleButtonPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ToggleButtonPlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/ToggleButtonPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/ToggleButtonPlus/ToggleButtonPlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 | Designer
15 |
16 |
17 |
--------------------------------------------------------------------------------
/WPFControls/TrayApp/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/TrayApp/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TrayApp
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/TrayApp/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/TrayApp/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace TrayApp
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/TrayApp/Resources/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiuAoran/WPFControls/2f7043dbf9fda962f740383e3762b4a9376405d9/WPFControls/TrayApp/Resources/Icon.ico
--------------------------------------------------------------------------------
/WPFControls/TrayApp/TrayApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 | true
9 | enable
10 | Resources\Icon.ico
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WPFControls/TrayApp/TrayApp.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/TreeViewPlus/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/TreeViewPlus/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TreeViewPlus
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/TreeViewPlus/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/TreeViewPlus/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/TreeViewPlus/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace TreePlus
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/TreeviewPlus/TreePlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/TreeviewPlus/TreePlus.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls.sln.DotSettings.user:
--------------------------------------------------------------------------------
1 |
2 | True
3 |
4 |
5 |
6 | True
7 | False
--------------------------------------------------------------------------------
/WPFControls/WPFControls/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace WPFControls
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace WPFControls
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls/WPFControls.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/WPFControls/WPFControls.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Designer
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WPFControls/WrapListBox/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WPFControls/WrapListBox/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace WrapListBox
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WPFControls/WrapListBox/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/WPFControls/WrapListBox/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/WPFControls/WrapListBox/WrapListBox.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | enable
7 | true
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WPFControls/WrapListBox/WrapListBox.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Designer
7 |
8 |
9 |
10 |
11 | Code
12 |
13 |
14 |
15 |
16 | Designer
17 |
18 |
19 | Designer
20 |
21 |
22 |
--------------------------------------------------------------------------------