ALampy.XamlFontPicker.Avalonia
2.0.1
dotnet add package ALampy.XamlFontPicker.Avalonia --version 2.0.1
NuGet\Install-Package ALampy.XamlFontPicker.Avalonia -Version 2.0.1
<PackageReference Include="ALampy.XamlFontPicker.Avalonia" Version="2.0.1" />
<PackageVersion Include="ALampy.XamlFontPicker.Avalonia" Version="2.0.1" />
<PackageReference Include="ALampy.XamlFontPicker.Avalonia" />
paket add ALampy.XamlFontPicker.Avalonia --version 2.0.1
#r "nuget: ALampy.XamlFontPicker.Avalonia, 2.0.1"
#:package ALampy.XamlFontPicker.Avalonia@2.0.1
#addin nuget:?package=ALampy.XamlFontPicker.Avalonia&version=2.0.1
#tool nuget:?package=ALampy.XamlFontPicker.Avalonia&version=2.0.1
ALampy.XamlFontPicker
A Xaml control for picking fonts, with a built-in font dialog, supporting WPF and Avalonia.
WPF:
Namespace:ALampy.XamlFontPicker.WPF(CLR) orxmlns:fp="https://github.com/ArcticLampyrid/XamlFontPicker"(XAML)Avalonia:
Namespace:ALampy.XamlFontPicker.Avalonia(CLR) orxmlns:fp="using:ALampy.XamlFontPicker.Avalonia"(XAML)
This project is co-maintained by 萤火 (ALampy) and AI companion 小雪 (Koyuki). ❄️
Install
WPF
- Package Manager
Install-Package ALampy.XamlFontPicker.WPF - .NET CLI
dotnet add package ALampy.XamlFontPicker.WPF
Avalonia
- Package Manager
Install-Package ALampy.XamlFontPicker.Avalonia - .NET CLI
dotnet add package ALampy.XamlFontPicker.Avalonia
Usage (WPF)
- See
ALampy.XamlFontPicker.WPF.Sample
Usage (Avalonia 11)
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fp="using:ALampy.XamlFontPicker.Avalonia">
<StackPanel>
<fp:FontPicker x:Name="FontPicker1" Width="400" />
</StackPanel>
</Window>
// Subscribe to selection changes
_fontPicker.GetObservable(FontPicker.SelectedFontInfoProperty)
.Subscribe(fontInfo => Console.WriteLine(fontInfo));
// Or open dialog directly
var dialog = new FontDialog();
var result = await dialog.ShowDialog<bool>(this);
if (result)
{
var fontInfo = dialog.SelectedFontInfo;
}
Preview
<StackPanel Orientation="Vertical">
<Button x:Name="OpenFontDialogButton" Click="OpenFontDialogButton_Click">OpenFontDialog</Button>
<fp:FontPicker x:Name="FontPicker1"/>
</StackPanel>
private void OpenFontDialogButton_Click(object sender, RoutedEventArgs e)
{
FontPicker1.OpenFontDialog();
}
Development
Utilities
WpfSampleScreenshot
A utility for taking screenshots of WPF samples, which can be used in quick preview. This utility is run in Docker container with Wine, so it can be used on non-Windows platforms as well. But some features may work sightly differently from native Windows environment.
./Utils/WpfSampleScreenshot/run.sh
AvaloniaSampleScreenshot
A utility for taking screenshots of Avalonia samples in Docker on Arch Linux. It uses headless X11 (Xvfb) + a lightweight WM (herbstluftwm) and multi-stage image build, aligned with the WPF screenshot pipeline but without Wine.
./Utils/AvaloniaSampleScreenshot/run.sh
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Avalonia (>= 11.3.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.