### Create and Configure NumberBox in C# Source: https://context7.com/amwx/fluentavalonia/llms.txt Instantiate and configure a NumberBox programmatically in C#. This example shows setting properties like header, range, value, and enabling expression input. ```csharp NumberBox nb = new NumberBox { Header = "Font size", Minimum = 8, Maximum = 72, Value = 14, SmallChange = 1, LargeChange = 4, IsWrapEnabled = false, AcceptsExpression = true, // user can type "12 + 4" SpinButtonPlacementMode = NumberBoxSpinButtonPlacementMode.Compact, ValidationMode = NumberBoxValidationMode.InvalidInputOverwritten }; nb.ValueChanged += (s, e) => Console.WriteLine($"Old: {e.OldValue} New: {e.NewValue}"); ``` -------------------------------- ### NavigationView Control Setup (XAML) Source: https://context7.com/amwx/fluentavalonia/llms.txt Configure a NavigationView control with menu items, pane settings, and navigation frame. Supports hierarchical items, headers, and separators. ```xml ``` -------------------------------- ### Using StandardUICommand in CommandBar Source: https://github.com/amwx/fluentavalonia/blob/master/samples/FAControlsGallery/Pages/SampleCode/StandardUICommand.xaml.txt Integrate StandardUICommand into a CommandBar's primary and secondary commands. This example shows a 'Add' button and uses a static resource for the 'DeleteCommand'. ```xaml ``` -------------------------------- ### Untargeted TeachingTip Example Source: https://github.com/amwx/fluentavalonia/blob/master/samples/FAControlsGallery/Pages/SampleCode/TeachingTip2.xaml.txt This XAML defines an untargeted TeachingTip. It can be shown programmatically or via a button click. ```XAML ``` -------------------------------- ### Format NumberBox Input Source: https://github.com/amwx/fluentavalonia/blob/master/samples/FAControlsGallery/Pages/SampleCode/NumberBox3.cs.txt Assign a custom lambda expression to the NumberFormatter property to control how input is displayed. This example formats the input to two decimal places. ```csharp var nm = this.FindControl("FormattedNumBox"); nm.NumberFormatter = (input) => { double increment = 1/0.25; return (Math.Round(input * increment, MidpointRounding.AwayFromZero) / increment).ToString("F2"); }; ``` -------------------------------- ### Basic SettingsExpander with Items Source: https://github.com/amwx/fluentavalonia/blob/master/samples/FAControlsGallery/Pages/SampleCode/SettingsExpander2.xaml.txt Demonstrates a SettingsExpander with a header, icon, description, and multiple SettingsExpanderItems. Some items include descriptions and one has a footer with a Button. ```XAML ``` -------------------------------- ### SettingsExpanderPageViewModel Initialization Source: https://github.com/amwx/fluentavalonia/blob/master/samples/FAControlsGallery/Pages/SampleCode/SettingsExpander3.cs.txt Initializes the ViewModel with a list of settings items, including RecentImagesSettingsItem and FooterButtonSettingsItem. This sets up the data structure for the settings expander UI. ```csharp public class SettingsExpanderPageViewModel : ViewModelBase { public SettingsExpanderPageViewModel() { Items = new List { new RecentImagesSettingsItem() { Header = "Recent images", }, new FooterButtonSettingsItem() { Header = "Choose a photo" } }; } public List Items { get; } } ``` -------------------------------- ### Configure InfoBar in FluentAvalonia (XAML) Source: https://context7.com/amwx/fluentavalonia/llms.txt Defines an InfoBar using XAML with a title, message, severity, and an action button. The bar is initially open and closable by the user. ```xml