binding-mewui-data

Solid

Binds MewUI controls to data using ObservableValue and ValueBinding. Use when implementing reactive UI updates, building ViewModels, or connecting controls to data sources.

Web & Frontend 40 stars 6 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
54
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

## ObservableValue<T> Reactive value container: ```csharp // Create var name = new ObservableValue<string>("Initial"); var count = new ObservableValue<int>(0); var enabled = new ObservableValue<bool>(true); // Read/Write string current = name.Value; name.Value = "New"; // Triggers Changed event // Subscribe via Changed event name.Changed += () => Console.WriteLine($"Changed to: {name.Value}"); // With coercion (value constraint) var percent = new ObservableValue<double>(50, coerce: v => Math.Clamp(v, 0, 100)); percent.Value = 150; // Becomes 100 ``` --- ## Fluent Binding ```csharp var vm = new MyViewModel(); new StackPanel().Children( // One-way (source → UI) new Label().BindText(vm.Message), // Two-way (source ↔ UI) new TextBox().BindText(vm.Name), new CheckBox().BindIsChecked(vm.IsEnabled), new Slider().BindValue(vm.Volume), // With converter new Label().BindText(vm.Count, c => $"Count: {c}"), // Common bindings new Button().BindIsEnabled(vm.CanSubmit).BindIsVisible(vm.ShowButton) ) ``` --- ## ViewModel Pattern ```csharp public class PersonViewModel { public ObservableValue<string> FirstName { get; } = new(""); public ObservableValue<string> LastName { get; } = new(""); public ObservableValue<string> FullName { get; } = new(""); public ObservableValue<bool> IsValid { get; } = new(false); public PersonViewModel() { FirstName.Changed += Update; LastName.Changed += Update; } ...

Details

Author
christian289
Repository
christian289/dotnet-with-claudecode
Created
7 months ago
Last Updated
6 days ago
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Featured

maui-data-binding

Guidance for .NET MAUI XAML and C# data bindings — compiled bindings, INotifyPropertyChanged / ObservableObject, value converters, binding modes, multi-binding, relative bindings, fallbacks, and MVVM best practices. USE FOR: setting up compiled bindings with x:DataType, implementing INotifyPropertyChanged or CommunityToolkit ObservableObject, creating IValueConverter / IMultiValueConverter, choosing binding modes, configuring BindingContext, relative bindings, binding fallbacks, StringFormat, code-behind SetBinding with lambdas, and enforcing XC0022/XC0025 warnings. DO NOT USE FOR: CollectionView item templates and layouts (use maui-collectionview), Shell navigation data passing (use maui-shell-navigation), dependency injection (use maui-dependency-injection), or animations triggered by property changes (use .NET MAUI animation APIs).

463 Updated 2 days ago
managedcode
Data & Documents Featured

mvvm

Implement the Model-View-ViewModel pattern in .NET applications with proper separation of concerns, data binding, commands, and testable ViewModels using MVVM Toolkit. USE FOR: implementing UI separation with Model-View-ViewModel; using MVVM Toolkit (CommunityToolkit.Mvvm) for ViewModels; designing testable UI architecture. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

463 Updated 2 days ago
managedcode
Web & Frontend Solid

building-mewui-apps

Creates MewUI applications with proper setup, windows, theming, and controls. Use when starting a new MewUI project, understanding application lifecycle, using built-in controls, or styling with themes.

40 Updated 6 days ago
christian289