### Installation
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Install SukiUI via NuGet package manager for Avalonia desktop applications.
```APIDOC
## Installation
Install SukiUI via NuGet package manager for Avalonia desktop applications.
```bash
dotnet add package SukiUI --version 6.0.0
```
```
--------------------------------
### Show ContextMenu Example
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/contextmenu.md
Demonstrates how to attach a ContextMenu to a GlassCard control. This example showcases various MenuItem types, including enabled, disabled, icon-enabled, separators, and nested submenus.
```xml
```
--------------------------------
### Stepper ViewModel Example
Source: https://context7.com/kikipoulet/sukiui/llms.txt
A C# ViewModel example for the SukiUI Stepper control, demonstrating how to manage the current step and define the available steps.
```csharp
// ViewModel for stepper
public class WizardViewModel
{
[ObservableProperty]
private int _currentStep = 0;
public IEnumerable Steps { get; } = new[]
{
"Select Files",
"Configure Options",
"Review",
"Complete"
};
}
```
--------------------------------
### BusyArea Loading Overlay Examples
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Shows how to use the SukiUI BusyArea control to display a loading overlay on content areas. Examples include overlaying a DataGrid and a form with input fields and a save button.
```xml
```
```xml
```
--------------------------------
### Basic SettingsLayout Example
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/settingslayout.md
Demonstrates how to use the SettingsLayout control to organize multiple settings sections. Each section has a header and content area.
```xml
```
--------------------------------
### Custom SKSL Shader Example
Source: https://context7.com/kikipoulet/sukiui/llms.txt
An example of a custom SKSL shader for SukiUI's GPU-accelerated backgrounds, demonstrating uniform usage.
```glsl
// Custom SKSL shader example (MyCustomShader.sksl)
// Available uniforms: iTime, iDark, iAlpha, iResolution, iPrimary, iAccent, iBase
vec4 main(vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
vec3 color = mix(iPrimary, iAccent, uv.x);
color = mix(color, iBase, 0.5);
return vec4(color, iAlpha);
}
```
--------------------------------
### Basic CheckBox Examples
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/checkbox.md
Demonstrates how to create CheckBox controls with different configurations. Use 'IsChecked' to set the initial state. Enable 'IsThreeState' for indeterminate states.
```xml
```
```xml
```
```xml
```
--------------------------------
### Basic ToggleButton Usage
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/togglebutton.md
Demonstrates the basic implementation of a ToggleButton. No specific setup or imports are required beyond standard SukiUI integration.
```xml
```
--------------------------------
### Basic AutoCompleteBox with ItemsSource
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/autocompletebox.md
This example demonstrates how to set up a basic AutoCompleteBox by providing a collection of strings to its ItemsSource property. This allows the control to offer suggestions as the user types.
```xml
USA 1USA 2USA 3FranceEnglandGermanyBelgiumChina
```
--------------------------------
### Add SukiUI Dock Package
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Install the SukiUI Dock package using the .NET CLI. This is required to use SukiUI's theming with the Dock library.
```bash
dotnet add package SukiUI.Dock
```
--------------------------------
### Default SukiUI App.axaml Configuration
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/faq/custom-font.md
This is the default App.axaml file structure for a SukiUI project, showing the initial SukiTheme setup.
```xml
```
--------------------------------
### Code-Behind DialogHost Setup in AXAML
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/dialog.md
Implement a SukiDialogHost in your AXAML view and assign a name for code-behind access.
```xml
```
--------------------------------
### Expander Examples in XML
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/data/expander.md
Demonstrates the usage of the Expander control with different ExpandDirections: Down, Up, Right, and Left. Ensure content is appropriately structured within the Expander.
```xml
Some Down ContentSome Up ContentSome Right ContentSome Left Content
```
--------------------------------
### GlassCard Layout Control Examples
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Demonstrates different styles and configurations for the GlassCard component, including standard, colored, opaque, interactive, and animation-disabled variants.
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
--------------------------------
### SukiWindow Example
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Replace the standard Window with SukiWindow for themed chrome, customizable backgrounds, logos, menus, and title bar controls.
```xml
```
--------------------------------
### MVVM Toast Host Setup in View
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Integrate a toast host into your SukiWindow's Hosts collection, binding its Manager to your ViewModel's ISukiToastManager instance.
```xml
```
--------------------------------
### InfoBar Control Example
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/notification/infobar.md
Use this XAML snippet to display an InfoBar. Configure its title, opacity, closability, open state, severity, and message.
```xml
```
--------------------------------
### InfoBar Notification Examples
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Demonstrates the SukiUI InfoBar control for displaying inline notifications with different severity levels (Information, Success, Warning, Error) and configurations for visibility and closability.
```xml
```
```xml
```
```xml
```
```xml
```
--------------------------------
### Get SukiTheme Instance
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/basic.md
Obtain the singleton instance of SukiTheme to manage your application's theming.
```csharp
SukiTheme theme = SukiTheme.GetInstance();
```
--------------------------------
### SukiSideMenu Navigation Example
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Implement primary navigation using SukiSideMenu, featuring a collapsible sidebar, search, and page content management. Define menu items with icons and associated views.
```xml
```
--------------------------------
### Non-MVVM Toast Host Setup in AXAML
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Set up a toast host directly in your AXAML view, assigning it a Name for code-behind access.
```xml
```
--------------------------------
### Reference SukiUI.Dock in App.axaml
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/dock.md
Include this StyleInclude in your App.axaml file to enable SukiUI Docking controls. Ensure the Nuget package is installed.
```xml
```
--------------------------------
### Slider and ToggleSwitch Controls
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Examples of using Slider for value selection and ToggleSwitch for boolean state toggling.
```xml
```
```xml
```
--------------------------------
### Show ProgressBar
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/progress/progressbar.md
Example of how to use the ProgressBar control in XAML. Bind IsIndeterminate, ShowProgressText, and Value to your view model properties.
```xml
```
--------------------------------
### Basic TabControl Example
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/navigation/tabcontrol.md
Use TabControl to organize content into selectable tabs. Each TabItem represents a single tab with its own header and content area.
```xml
```
--------------------------------
### Display SukiUI Loading Indicator
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/progress/loading.md
Use the `` tag to display a loading indicator. No additional setup is required.
```xml
```
--------------------------------
### MVVM DialogHost Setup in XAML
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/dialog.md
Set up a SukiDialogHost in your XAML view and bind its Manager to your ViewModel's DialogManager property for MVVM integration.
```xml
```
--------------------------------
### Base RadioButton Example
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/radiobutton.md
Demonstrates the basic usage of the RadioButton control. Use the GroupName property to group radio buttons, ensuring only one can be selected within that group. Set IsChecked to true to pre-select an option.
```xml
```
--------------------------------
### SukiUI Button Styles
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Showcases various button styles available in SukiUI, including standard, flat, rounded, outlined, basic, accent, and large variants. Also includes an example of a button with a loading state.
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
--------------------------------
### Access Site Data in Markdown - VitePress
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/api-examples.md
Use the `useData()` hook within a `
## Results
### Theme Data
{{ theme }}
### Page Data
{{ page }}
### Page Frontmatter
{{ frontmatter }}
```
--------------------------------
### Create and Use Custom Color Theme
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme-color.md
Define a new color theme with a name, primary color, and secondary color, register it, and then switch to it.
```csharp
var PurpleTheme = new SukiColorTheme("Purple", Colors.Purple, Colors.DarkBlue);
SukiTheme.GetInstance().AddColorTheme(PurpleTheme);
SukiTheme.GetInstance().ChangeColorTheme(PurpleTheme);
```
--------------------------------
### TextBox with Watermark
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/textbox.md
Displays a watermark text within the TextBox when it is empty, guiding the user on expected input.
```xml
```
--------------------------------
### Switch to Light Theme in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme.md
Use this method to explicitly set the application's base theme to light. Ensure SukiTheme is initialized.
```csharp
SukiTheme.GetInstance().ChangeBaseTheme(ThemeVariant.Light);
```
--------------------------------
### Syntax Highlighting with Line Highlight
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/markdown-examples.md
Demonstrates syntax highlighting with Shiki, including line highlighting on the 4th line.
```js
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
--------------------------------
### Basic Dialog Display
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/dialog.md
Use the CreateDialog() extension method on an ISukiDialogManager instance to begin constructing a dialog, then call TryShow() to display it.
```csharp
MainWindow.DialogManager.CreateDialog()
.TryShow();
```
--------------------------------
### Use SukiWindow as MainWindow
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/getting-started/launch.md
Replace the base Window class with SukiWindow in both MainWindow.axaml and MainWindow.axaml.cs to utilize SukiUI's windowing features. Ensure the correct namespace is imported.
```xml
```
```csharp
using SukiUI.Controls;
namespace SukiTest;
public partial class MainWindow : SukiWindow
{
public MainWindow()
{
InitializeComponent();
}
}
```
--------------------------------
### App.axaml Configuration
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Include SukiUI theme styles in your application's App.axaml file to enable the theming system.
```APIDOC
## App.axaml Configuration
Include SukiUI theme styles in your application's App.axaml file to enable the theming system.
```xml
```
```
--------------------------------
### SettingsLayout Structure
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Organizes settings into responsive sections using SettingsLayout, adapting to window width.
```xml
```
--------------------------------
### Show Action Toast with Update Progress
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Demonstrates creating a toast with title, content, and two action buttons. The 'Update' button triggers a progress toast. Requires `toastManager`, `ProgressBar`, `Timer`, and `Dispatcher.UIThread`.
```csharp
private void ShowActionToast()
{
toastManager.CreateToast()
.WithTitle("Update Available")
.WithContent("Information, Update v1.0.0.0 is Now Available.")
.WithActionButtonNormal("Later", _ => { }, true)
.WithActionButton("Update", _ => ShowUpdatingToast(), true)
.Queue();
}
```
```csharp
private void ShowUpdatingToast()
{
var progress = new ProgressBar() { Value = 0, ShowProgressText = true };
var toast = toastManager.CreateToast()
.WithTitle("Updating...")
.WithContent(progress)
.Queue();
var timer = new Timer(20);
timer.Elapsed += (_, _) =>
{
Dispatcher.UIThread.Invoke(() =>
{
progress.Value += 1;
if (progress.Value < 100) return;
timer.Dispose();
toastManager.Dismiss(toast);
});
};
timer.Start();
}
```
--------------------------------
### Switch to Specific Color Theme
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme-color.md
Change the application's color theme to a predefined theme like Red. Ensure the theme is available.
```csharp
SukiTheme.GetInstance().ChangeColorTheme(SukiColor.Red);
```
--------------------------------
### Custom Container Syntax
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/markdown-examples.md
Shows the markdown syntax for creating custom info, tip, warning, danger, and details containers.
```md
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
```
--------------------------------
### Loading Toast with Progress
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Display a toast indicating a loading state, optionally with a progress bar. The toast can be updated and dismissed programmatically.
```csharp
var progressBar = new ProgressBar { Value = 0, ShowProgressText = true };
var loadingToast = ToastManager.CreateToast()
.WithTitle("Downloading...")
.WithContent(progressBar)
.WithLoadingState(true)
.Queue();
// Update progress and dismiss when complete
progressBar.Value = 100;
ToastManager.Dismiss(loadingToast);
```
--------------------------------
### Switch to Dark Theme in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme.md
Use this method to explicitly set the application's base theme to dark. Ensure SukiTheme is initialized.
```csharp
SukiTheme.GetInstance().ChangeBaseTheme(ThemeVariant.Dark);
```
--------------------------------
### Basic Toast Queueing
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Queue a simple toast for display using the ISukiToastManager instance.
```csharp
MainWindow.ToastManager.CreateToast()
.Queue();
```
--------------------------------
### Access Site Data in Vue Component - VitePress
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/api-examples.md
The `useData()` hook can also be used in Vue components within a VitePress project. Import it in a `
## Results
### Theme Data
{{ theme }}
### Page Data
{{ page }}
### Page Frontmatter
{{ frontmatter }}
```
--------------------------------
### Basic Combobox Usage
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/combobox.md
Demonstrates how to bind a Combobox to a data source and a selected item. Ensure the ItemsSource and SelectedItem are correctly bound to your ViewModel properties.
```xml
```
--------------------------------
### SukiUI Theme Management API
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Programmatically control light/dark themes, color themes, and manage custom themes at runtime using the SukiTheme singleton instance. Subscribe to theme change events.
```csharp
using SukiUI;
using Avalonia.Styling;
using Avalonia.Media;
// Get the singleton theme instance
SukiTheme theme = SukiTheme.GetInstance();
// Switch to dark theme
theme.ChangeBaseTheme(ThemeVariant.Dark);
// Switch to light theme
theme.ChangeBaseTheme(ThemeVariant.Light);
// Toggle between light and dark
theme.SwitchBaseTheme();
// Change to a predefined color theme
theme.ChangeColorTheme(SukiColor.Red);
// Cycle through available color themes
theme.SwitchColorTheme();
// Create and register a custom color theme
var purpleTheme = new SukiColorTheme("Purple", Colors.Purple, Colors.DarkBlue);
theme.AddColorTheme(purpleTheme);
theme.ChangeColorTheme(purpleTheme);
// Subscribe to theme change events
theme.OnBaseThemeChanged += variant =>
{
Console.WriteLine($"Theme changed to: {variant}");
};
theme.OnColorThemeChanged += colorTheme =>
{
Console.WriteLine($"Color theme changed to: {colorTheme.DisplayName}");
};
```
--------------------------------
### Displaying a Toast with Title and Content
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Construct and display a toast with a specified title and content using the fluent builder pattern.
```csharp
public void DisplayToast()
{
ToastManager.CreateToast()
.WithTitle("Example Toast")
.WithContent("The content of an example toast can be seen here.")
.Queue();
}
```
--------------------------------
### Display Simple Information Dialog
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Show a basic modal dialog with a title, content, and a single OK button. Ensure the DialogManager is initialized in your ViewModel.
```csharp
using SukiUI.Dialogs;
using SukiUI.Enums;
// ViewModel setup
public class MainViewModel
{
public ISukiDialogManager DialogManager { get; }
public MainViewModel()
{
DialogManager = new SukiDialogManager();
}
}
// Simple information dialog
DialogManager.CreateDialog()
.WithTitle("Information")
.WithContent("Operation completed successfully.")
.WithActionButton("OK", _ => { }, dismissOnClick: true)
.TryShow();
```
--------------------------------
### SukiWindow Menu Configuration
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/sukiwindow.md
Configure the visibility and items for the SukiWindow's menu. Set 'IsMenuVisible' to 'True' to show the menu.
```xml
```
--------------------------------
### Basic TextBox Usage
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/textbox.md
Demonstrates the fundamental usage of the TextBox control to collect user input.
```xml
```
--------------------------------
### Basic StackPage Usage
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/navigation/stackpage.md
Use SukiStackPage to display content with a navigation history. Set the Content property to bind to your current page and optionally configure the Limit for the history stack.
```xml
```
--------------------------------
### SukiWindow Background Animation and Transitions
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Enables and configures animation and transition effects for SukiWindow backgrounds.
```xml
```
--------------------------------
### SukiUI Progress Controls
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Illustrates the usage of various progress indicators in SukiUI, including CircleProgressBar, WaveProgress, Loading spinner, standard ProgressBar, and Stepper controls.
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
```xml
```
--------------------------------
### Toast with Click and Dismissal Callbacks and Action Button
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Implement user interaction callbacks for clicks and dismissals, and add a custom action button to a toast.
```csharp
public void DisplayToast()
{
ToastManager.CreateToast()
.Dismiss().After(TimeSpan.FromSeconds(3))
.OnClicked(_ => Console.WriteLine("Toast Clicked!"))
.OnDismissed(_ => Console.WriteLine("Toast Was Dismissed!"))
.WithActionButton("Dismiss", _ => { }, true)
.Queue();
}
```
--------------------------------
### Theme Management API
Source: https://context7.com/kikipoulet/sukiui/llms.txt
The SukiTheme class provides programmatic control over light/dark themes and color themes at runtime.
```APIDOC
## Theme Management API
The SukiTheme class provides programmatic control over light/dark themes and color themes at runtime.
```csharp
using SukiUI;
using Avalonia.Styling;
using Avalonia.Media;
// Get the singleton theme instance
SukiTheme theme = SukiTheme.GetInstance();
// Switch to dark theme
theme.ChangeBaseTheme(ThemeVariant.Dark);
// Switch to light theme
theme.ChangeBaseTheme(ThemeVariant.Light);
// Toggle between light and dark
theme.SwitchBaseTheme();
// Change to a predefined color theme
theme.ChangeColorTheme(SukiColor.Red);
// Cycle through available color themes
theme.SwitchColorTheme();
// Create and register a custom color theme
var purpleTheme = new SukiColorTheme("Purple", Colors.Purple, Colors.DarkBlue);
theme.AddColorTheme(purpleTheme);
theme.ChangeColorTheme(purpleTheme);
// Subscribe to theme change events
theme.OnBaseThemeChanged += variant =>
{
Console.WriteLine($"Theme changed to: {variant}");
};
theme.OnColorThemeChanged += colorTheme =>
{
Console.WriteLine($"Color theme changed to: {colorTheme.DisplayName}");
};
```
```
--------------------------------
### ViewModel Navigation Logic
Source: https://context7.com/kikipoulet/sukiui/llms.txt
C# code for a ViewModel demonstrating how to manage navigation state for SukiStackPage.
```csharp
// ViewModel navigation
public class NavigationViewModel
{
[ObservableProperty]
private object _currentPage;
public void NavigateTo(object page)
{
CurrentPage = page; // Stack automatically tracks history
}
}
```
--------------------------------
### Include Dock Styles in App.axaml
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Include the SukiUI Dock styles in your App.axaml file to enable theming for dockable panels. Ensure SukiTheme is also included.
```xml
```
--------------------------------
### AXAML Toast Host Integration
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Integrate the toast notification host into your SukiWindow using AXAML. Configure the maximum number of toasts to display.
```xml
```
--------------------------------
### Non-MVVM Toast Manager Initialization in Code-Behind
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Initialize and assign the ISukiToastManager to the ToastHost in your window's code-behind.
```csharp
public class MainWindow : SukiWindow
{
public static ISukiToastManager ToastManager = new SukiToastManager();
public MainWindow()
{
InitializeComponent();
ToastHost.Manager = ToastManager;
}
}
```
--------------------------------
### Add SukiUI Nuget Package
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/getting-started/installation.md
Use this command to add the SukiUI package to your Avalonia project via Nuget. Ensure you specify the desired version.
```bash
dotnet add package SukiUI --version 6.0.0
```
--------------------------------
### Include SukiUI Styles in App.axaml
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/getting-started/launch.md
Add the SukiUI namespace and SukiTheme to your App.axaml to apply global styles. Ensure a ThemeColor is set to avoid transparent controls.
```xml
```
--------------------------------
### AXAML Dialog Host Integration
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Add the dialog host to your SukiWindow using AXAML to manage and display dialogs. This requires binding the Manager property to your DialogManager instance.
```xml
```
--------------------------------
### TextBox with Clear Button and Prefix
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Demonstrates how to add a clear button and a prefix to a TextBox for enhanced user input.
```xml
```
```xml
```
--------------------------------
### Expander with CheckBoxes
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Shows how to use an Expander to reveal or hide a group of CheckBox controls.
```xml
```
--------------------------------
### Toggle Between Light and Dark Themes in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme.md
This method toggles the current base theme between light and dark. It's a convenient way to switch themes without needing to know the current state.
```csharp
SukiTheme.GetInstance().SwitchBaseTheme();
```
--------------------------------
### Configure SukiUI Theme in App.axaml
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Include the SukiTheme style in your App.axaml to enable the theming system. You can specify a default ThemeColor.
```xml
```
--------------------------------
### Display Loading Toast
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Use this to show a toast indicating a loading state. Ensure ToastManager is accessible.
```csharp
public void DisplayToast()
{
ToastManager.CreateToast()
.WithLoadingState(true)
.Queue();
}
```
--------------------------------
### Handle Theme Changes in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme.md
Subscribe to the OnBaseThemeChanged event to execute custom logic whenever the theme is switched. The event handler receives the new ThemeVariant.
```csharp
SukiTheme.GetInstance().OnBaseThemeChanged += variant =>
{
Console.WriteLine("Theme changed triggered !");
};
```
--------------------------------
### Switch to Next Color Theme
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/theme-color.md
Call this method to cycle through the available color themes in the application.
```csharp
SukiTheme.GetInstance().SwitchColorTheme();
```
--------------------------------
### SukiSideMenu Basic Structure
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/navigation/sidemenu.md
Defines the main navigation structure with enabled search. Includes a sample menu item with header, icon, and page content placeholders. Ensure PageContent is populated to prevent exceptions.
```xml
```
--------------------------------
### SukiWindow Custom Background Shaders
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Configures SukiWindow to use custom background shaders, either from a file or inline code.
```xml
```
--------------------------------
### Basic Stepper Usage in Axaml
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/progress/stepper.md
Use this snippet to integrate the Stepper component into your Axaml views. Bind the Index and Steps properties to your ViewModel for dynamic control.
```xml
```
--------------------------------
### Dialog with Title and Content
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/dialog.md
Construct a dialog with a specified title and content using the WithTitle() and WithContent() methods.
```csharp
DialogManager.CreateDialog()
.WithTitle("Example Dialog")
.WithContent("The content of an example dialog can be seen here.")
.TryShow();
```
--------------------------------
### Basic GlassCard Usage
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/glasscard.md
Use the basic GlassCard element to wrap your content. No specific attributes are required for default functionality.
```xml
```
--------------------------------
### Toast with Action Buttons
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Add custom action buttons to toasts, allowing users to interact directly. Buttons can be configured to dismiss the toast upon clicking.
```csharp
ToastManager.CreateToast()
.WithTitle("Update Available")
.WithContent("Version 2.0.0 is now available.")
.OfType(NotificationType.Information)
.WithActionButtonNormal("Later", _ => { }, dismissOnClick: true)
.WithActionButton("Update Now", _ => StartUpdate(), dismissOnClick: true)
.Queue();
```
--------------------------------
### Code-Behind MainWindow DialogManager Initialization
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/dialog.md
Initialize the ISukiDialogManager in your MainWindow's code-behind and assign it to the DialogHost.
```csharp
public class MainWindow : SukiWindow
{
public static ISukiDialogManager DialogManager = new SukiDialogManager();
public MainWindow()
{
InitializeComponent();
DialogHost.Manager = DialogManager;
}
}
```
--------------------------------
### MVVM Toast Manager Initialization in ViewModel
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/hosts/toast.md
Initialize the ISukiToastManager in your ViewModel to manage and display toasts.
```csharp
public class ExampleViewModel
{
public ISukiToastManager ToastManager { get; }
public ExampleViewModel()
{
ToastManager = new SukiToastManager();
}
}
```
--------------------------------
### Display Simple Toast Notification
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Use this to show a basic toast with a title and content. Ensure the ToastManager is initialized in your ViewModel.
```csharp
using SukiUI.Toasts;
using SukiUI.Enums;
// ViewModel setup
public class MainViewModel
{
public ISukiToastManager ToastManager { get; }
public MainViewModel()
{
ToastManager = new SukiToastManager();
}
}
// Display a simple toast
ToastManager.CreateToast()
.WithTitle("Welcome")
.WithContent("Application started successfully.")
.Queue();
```
--------------------------------
### Implement DropDownButton with Flyout
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/dropdownbutton.md
Use this snippet to create a DropDownButton that reveals custom content in a flyout when clicked. Ensure the Flyout element is correctly nested within DropDownButton.Flyout.
```xml
```
--------------------------------
### Basic Slider Configuration in XAML
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/slider.md
Configure a Slider with snapping to ticks, a defined range, and tick frequency. Bind the Value property to a ViewModel property.
```xml
```
--------------------------------
### SukiWindow with Gradient Background Style
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/sukiwindow.md
Use this to apply a 'Gradient' background style to your SukiWindow. The gradient dynamically matches your color theme.
```xml
```
--------------------------------
### Standard Button in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/button.md
Use this for a default button appearance. No special classes are required.
```xml
```
--------------------------------
### SukiWindow with Flat Background Style
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/sukiwindow.md
Use this to apply a classic 'Flat' background style to your SukiWindow. This is a standard background option.
```xml
```
--------------------------------
### Simple Flat Background Shader
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/theming/background.md
This is the simplest SKSL shader, returning the base background color for every pixel. It utilizes the `iBase` and `iAlpha` uniforms provided by SukiUI.
```glsl
vec4 main(vec2 fragCoord) {
return vec4(iBase, iAlpha);
}
```
--------------------------------
### Basic ToggleSwitch Usage
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/toggleswitch.md
Use this snippet to display a ToggleSwitch. Set the 'IsChecked' property to 'True' to initialize it in the checked state.
```xml
```
--------------------------------
### Busy/Loading Button in SukiUI (C#)
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/button.md
Control the busy or loading state of a button programmatically using the 'ShowProgress()' and 'HideProgress()' methods.
```csharp
MyButton.ShowProgress();
MyButton.HideProgress();
```
--------------------------------
### TextBox with Prefix
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/textbox.md
Adds a prefix to the TextBox, useful for indicating units or formats, such as URLs.
```xml
```
--------------------------------
### SukiWindow with Bubble Background Style
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/layout/sukiwindow.md
Use this to apply a 'Bubble' background style to your SukiWindow. This style enhances the glassmorphism design.
```xml
```
--------------------------------
### Basic Button Style in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/button.md
The 'Basic' class provides a minimal button style, often used for simple actions.
```xml
```
--------------------------------
### Confirmation Dialog with Multiple Buttons
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Create dialogs with multiple action buttons, such as Cancel and Confirm. Buttons can be styled and configured to dismiss the dialog.
```csharp
DialogManager.CreateDialog()
.WithTitle("Confirm Delete")
.WithContent("Are you sure you want to delete this item? This action cannot be undone.")
.WithActionButton("Cancel", _ => { }, dismissOnClick: true)
.WithActionButton("Delete", _ => DeleteItem(), dismissOnClick: true, "Flat", "Accent")
.TryShow();
```
--------------------------------
### TabControl Styling
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Standard TabControl implementation with SukiUI styling for organizing content into tabs.
```xml
```
--------------------------------
### Button Loading State Control
Source: https://context7.com/kikipoulet/sukiui/llms.txt
Provides C# code to control the loading spinner visibility on a SukiUI button.
```csharp
// Show loading spinner on button
SaveButton.ShowProgress();
// Hide loading spinner
SaveButton.HideProgress();
```
--------------------------------
### Flat Button Style in SukiUI
Source: https://github.com/kikipoulet/sukiui/blob/main/docs/docs/documentation/controls/inputs/button.md
Apply the 'Flat' class to create a button with no visible border or background by default.
```xml
```