MattEqualsCoder.DynamicForms.Avalonia
0.0.3-rc.1
This is a prerelease version of MattEqualsCoder.DynamicForms.Avalonia.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MattEqualsCoder.DynamicForms.Avalonia --version 0.0.3-rc.1
NuGet\Install-Package MattEqualsCoder.DynamicForms.Avalonia -Version 0.0.3-rc.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MattEqualsCoder.DynamicForms.Avalonia" Version="0.0.3-rc.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MattEqualsCoder.DynamicForms.Avalonia --version 0.0.3-rc.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MattEqualsCoder.DynamicForms.Avalonia, 0.0.3-rc.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MattEqualsCoder.DynamicForms.Avalonia as a Cake Addin #addin nuget:?package=MattEqualsCoder.DynamicForms.Avalonia&version=0.0.3-rc.1&prerelease // Install MattEqualsCoder.DynamicForms.Avalonia as a Cake Tool #tool nuget:?package=MattEqualsCoder.DynamicForms.Avalonia&version=0.0.3-rc.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dynamic Forms
Dynamic UI builder for WPF and Avalonia. By creating a ViewModel with attributes attached to properties and events and passing that ViewModel into the DynamicFormControl, you can have the control build a form with various different controls to accommodate a wide variety of data types.
You can create the above via the below code:
ViewModel
public class BasicViewModel
{
[DynamicFormFieldText]
public string BasicExampleText => "DynamicForms allows you to use property and event attributes to build a form dynamically for both WPF and Avalonia.";
[DynamicFormFieldTextBox("Basic Text Box")]
public string TextBoxOne { get; set; } = "";
[DynamicFormFieldComboBox("Basic Combo Box", comboBoxOptionsProperty: nameof(ComboBoxOptions))]
public string ComboBoxOne { get; set; } = "Test 3";
[DynamicFormFieldButton("View YAML")]
public event EventHandler? ButtonPress;
public string[] ComboBoxOptions => ["Test 1", "Test 2", "Test 3"];
}
Window C#
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var model = new BasicViewModel();
model.ButtonPress += (sender, args) =>
{
Console.WriteLine("Button pressed");
};
DataContext = model;
}
}
Window XAML
<control:DynamicFormControl Data="{Binding}" Margin="5" />
Usage
- Create multiple projects
- Shared library for view model classes
- WPF application
- Avalonia application
- Install nuget packages
- Shared library: MattEqualsCoder.DynamicForms.Core
- WPF application: MattEqualsCoder.DynamicForms.WPF
- Avalonia application: MattEqualsCoder.DynamicForms.Avalonia
- Add controls to WPF and Avalonia windows
Documentation
You can view additional documentation about using it here.
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- MattEqualsCoder.AvaloniaControls (>= 0.9.13)
- MattEqualsCoder.DynamicForms.Core (>= 0.0.3-rc.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.1 | 116 | 7/15/2024 |
1.0.0 | 65 | 7/15/2024 |
0.0.3-rc.5 | 181 | 6/4/2024 |
0.0.3-rc.4 | 77 | 5/21/2024 |
0.0.3-rc.3 | 71 | 5/12/2024 |
0.0.3-rc.2 | 90 | 4/29/2024 |
0.0.3-rc.1 | 98 | 4/21/2024 |
0.0.2 | 104 | 4/8/2024 |
0.0.1-rc.1 | 66 | 4/6/2024 |