### Install ShadUI NuGet Package (CLI) Source: https://github.com/accntech/shad-ui/blob/main/README.md Installs the latest version of the ShadUI NuGet package using the .NET CLI. This is the primary method for adding ShadUI to your Avalonia project. ```powershell dotnet add package ShadUI ``` -------------------------------- ### ShadUI Dialog System Setup and Usage (C#) Source: https://context7.com/accntech/shad-ui/llms.txt Demonstrates how to set up and use the DialogManager for creating simple alerts, custom dialogs with view models, and managing dialog dismissal. Requires DI setup and registration of custom dialog views. ```csharp // Setup: Register DialogManager as singleton in DI services.AddSingleton(); // Register custom dialog views with their DataContext types var dialogManager = serviceProvider.GetRequiredService(); dialogManager.Register(); dialogManager.Register(); // Add DialogHost to your window's Hosts collection // // // // Simple alert dialog _dialogManager .CreateDialog( "Are you absolutely sure?", "This action cannot be undone. This will permanently delete your account.") .WithPrimaryButton("Continue", () => DeleteAccount()) .WithCancelButton("Cancel") .WithMaxWidth(512) .Dismissible() .Show(); // Destructive style dialog _dialogManager .CreateDialog( "Delete all data?", "This will permanently remove all your data from our servers.") .WithPrimaryButton("Delete", () => DeleteAllData(), DialogButtonStyle.Destructive) .WithCancelButton("Cancel") .WithMaxWidth(512) .Dismissible() .Show(); // Dialog with multiple buttons _dialogManager .CreateDialog("Save changes?", "You have unsaved changes.") .WithPrimaryButton("Save", async () => await SaveAsync()) .WithSecondaryButton("Don't Save", () => DiscardChanges()) .WithCancelButton("Cancel") .Show(); // Custom dialog with view model var loginViewModel = new LoginViewModel(); _dialogManager.CreateDialog(loginViewModel) .Dismissible() .WithSuccessCallback(vm => _toastManager.CreateToast("Sign in successful") .WithContent($"Welcome back, {vm.Email}!") .ShowSuccess()) .WithCancelCallback(() => _toastManager.CreateToast("Sign in cancelled") .ShowWarning()) .Show(); // Close dialog from within the view model public void OnLoginSuccess() { _dialogManager.Close(this, new CloseDialogOptions { Success = true }); } public void OnCancel() { _dialogManager.Close(this, new CloseDialogOptions { Success = false }); } // Prevent/allow dialog dismissal programmatically _dialogManager.PreventDismissal(); // Disable clicking outside to close _dialogManager.AllowDismissal(); // Re-enable dismissal ``` -------------------------------- ### Install Specific ShadUI NuGet Package Version (CLI) Source: https://github.com/accntech/shad-ui/blob/main/README.md Installs a specific version or a preview version of the ShadUI NuGet package using the .NET CLI. This allows for controlled updates or testing of specific releases. ```powershell dotnet add package ShadUI --version [version] ``` -------------------------------- ### ShadUI Window Control Example Source: https://context7.com/accntech/shad-ui/llms.txt This XAML defines a customizable ShadUI Window with options for title bar customization, logo, menu, and macOS traffic light positioning. It also includes a DialogHost for managing dialogs within the window. ```xml ``` -------------------------------- ### Apply Theme Colors via Dynamic Resources Source: https://context7.com/accntech/shad-ui/llms.txt Access the ShadUI color system using DynamicResource references in XAML. This allows for consistent application of background, foreground, and semantic theme colors across various UI components. ```xml ``` -------------------------------- ### Shad-UI Badge Control Source: https://context7.com/accntech/shad-ui/llms.txt A badge component for displaying status indicators, counts, or labels, available in multiple variants (Default, Secondary, Destructive, Outline) as shown in XAML. It's useful for highlighting information. ```xml ``` -------------------------------- ### Shad-UI Avatar Control Source: https://context7.com/accntech/shad-ui/llms.txt An avatar component implemented in XAML, capable of displaying user images from a source URL or falling back to initials if the image fails to load. It supports customizable size and corner radius. ```xml ``` -------------------------------- ### Shad-UI Card Control Source: https://context7.com/accntech/shad-ui/llms.txt A versatile card component in XAML with distinct header, content, and footer sections. It supports shadow effects and integrates various input controls like TextBoxes and ComboBoxes. ```xml Create project Deploy your new project in one-click. Next.js React Vue.js ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.