![]() |
VOOZH | about |
dotnet add package CgdataBase.WPF --version 1.9.34
NuGet\Install-Package CgdataBase.WPF -Version 1.9.34
<PackageReference Include="CgdataBase.WPF" Version="1.9.34" />
<PackageVersion Include="CgdataBase.WPF" Version="1.9.34" />Directory.Packages.props
<PackageReference Include="CgdataBase.WPF" />Project file
paket add CgdataBase.WPF --version 1.9.34
#r "nuget: CgdataBase.WPF, 1.9.34"
#:package CgdataBase.WPF@1.9.34
#addin nuget:?package=CgdataBase.WPF&version=1.9.34Install as a Cake Addin
#tool nuget:?package=CgdataBase.WPF&version=1.9.34Install as a Cake Tool
一个轻量级的 WPF 基础库,基于 提供更贴近桌面端 UI 的能力:常用转换器、控件/行为、窗口与系统集成辅助,以及一套可直接复用的基础样式资源。
Install-Package CgdataBase.WPF
dotnet add package CgdataBase.WPF
FocusBehavior:提供 IsFocused 附加属性,用于在 XAML/MVVM 中触发控件聚焦,并支持 TextBox 光标定位到末尾。UIElementHelper:常用 UI 相关的辅助方法(见 )。AsyncObservableCollection<T>:支持跨线程更新的 ObservableCollection<T>(自动切回创建时的 SynchronizationContext),避免后台线程更新集合导致 UI 异常。WindowController:窗口显示信息(尺寸/位置/状态)加载与自动保存;提供 EscToExit、ShowWindow 等常用窗口行为。AutoStartController:写入/删除 HKCU\Software\Microsoft\Windows\CurrentVersion\Run 实现开机自启配置。ClipboardEx / ClipboardFormat:基于 Win32 API 的剪贴板增强操作与格式常量。ListViewController、RegistryController:ListView 与注册表相关的常用封装(见 )。TitleTextBox:带标题区域的 TextBox。ToggleButton:自定义 ToggleButton 样式/行为封装。VirtualizingWrapPanel:支持虚拟化的 WrapPanel(实现 IScrollInfo),适合大量数据项的“平铺”场景。WpfChart:基于 Grid 的柱形图控件,支持 ItemsSource 绑定并带动画效果。所有转换器都继承自 ConverterBase<T>,可在 XAML 中以 MarkupExtension 形式直接使用。
BooleanToVisibilityConverter、BooleanReverseConverter、BooleanReverseToVisibilityConverter、BooleanToVisibleHiddenConverter、BooleanReverseToVisibleHiddenConverterEnumToDescriptionConverterFileSizeConverter、NetworkSpeedConverter、MultiplyConverter、IndexConverterObjectToJsonConverter、ObjectToBooleanConverter、ObjectToVisibilityConverterStyles/BaseStyle.xaml:基础控件样式集合(Button、TextBox、ListView、Window 等)。Styles/Theme1.xaml:一套可选主题(覆盖部分控件样式)。Styles/Margin*.xaml:常用 Margin 资源集合。<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/CgdataBase.WPF;component/Styles/BaseStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
<Window
xmlns:conv="clr-namespace:CgdataBase.WPF.Converters;assembly=CgdataBase.WPF">
<Grid>
<TextBlock Visibility="{Binding IsBusy, Converter={conv:BooleanToVisibilityConverter}}" />
</Grid>
</Window>
using CgdataBase.WPF.Controllers;
public AsyncObservableCollection<string> Items { get; } = new();
public async Task LoadAsync()
{
await Task.Run(() =>
{
for (var i = 0; i < 100; i++)
{
Items.Add($"Item {i}");
}
});
}
using CgdataBase.WPF.Controllers;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
WindowController.UpdateWindowConfig(this, typeof(MainWindow));
WindowController.EscToExit(this);
}
}
<ItemsControl xmlns:cg="clr-namespace:CgdataBase;assembly=CgdataBase.WPF"
ItemsSource="{Binding Items}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<cg:VirtualizingWrapPanel ItemWidth="120" ItemHeight="36" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 net6.0-windows7.0 is compatible. net7.0-windows net7.0-windows was computed. net8.0-windows net8.0-windows was computed. net8.0-windows7.0 net8.0-windows7.0 is compatible. net9.0-windows net9.0-windows was computed. net10.0-windows net10.0-windows was computed. net10.0-windows7.0 net10.0-windows7.0 is compatible. |
Showing the top 1 NuGet packages that depend on CgdataBase.WPF:
| Package | Downloads |
|---|---|
|
CgdataBase.WPF.Common
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.34 | 105 | 6/15/2026 |
| 1.9.33 | 103 | 6/9/2026 |
| 1.9.32 | 108 | 6/3/2026 |
| 1.9.30 | 123 | 5/11/2026 |
| 1.9.29 | 115 | 5/2/2026 |
| 1.9.28 | 113 | 4/28/2026 |
| 1.9.26 | 109 | 4/27/2026 |
| 1.9.21 | 124 | 4/15/2026 |
| 1.9.19 | 118 | 4/8/2026 |
| 1.9.16 | 109 | 4/7/2026 |
| 1.9.12 | 121 | 4/3/2026 |
| 1.9.11 | 133 | 3/25/2026 |
| 1.9.8 | 115 | 3/23/2026 |
| 1.9.7 | 111 | 3/23/2026 |
| 1.9.6 | 124 | 3/20/2026 |
| 1.9.5 | 120 | 3/19/2026 |
| 1.9.4 | 119 | 3/18/2026 |
| 1.9.3 | 160 | 1/6/2026 |
| 1.9.2 | 246 | 12/5/2025 |
| 1.9.1 | 303 | 11/22/2025 |