### Set and Get Element Theme Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/types.md Example of overriding the application theme for a specific element to Dark and getting the actual theme. ```csharp // Override application theme for a specific element ThemeManager.SetRequestedTheme(myButton, ElementTheme.Dark); // Get the actual theme (accounting for inheritance) var actualTheme = ThemeManager.GetActualTheme(myButton); ``` -------------------------------- ### Set Application Theme Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/types.md Example of how to set the application theme to Dark and check if the Light theme is active. ```csharp ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark; if (ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Light) { // Light theme is active } ``` -------------------------------- ### Slide Navigation Transition Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/types.md Example of creating a SlideNavigationTransitionInfo with the effect set to FromLeft and navigating to a DetailPage. ```csharp var transition = new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft }; frame.Navigate(typeof(DetailPage), null, transition); ``` -------------------------------- ### SimpleStackPanel Orientation Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/types.md Example of creating a SimpleStackPanel and setting its Orientation to Horizontal with spacing. ```csharp var panel = new SimpleStackPanel { Orientation = Orientation.Horizontal, Spacing = 12 }; ``` -------------------------------- ### Visual Tree Navigation Examples Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Provides examples for finding child elements, parent windows, and specific named elements within the visual tree. ```csharp // Find child element var itemsPresenter = VisualTree.FindDescendant(listView); // Find parent window var parentWindow = VisualTree.FindAncestor(button); // Find specific named element var contentPresenter = VisualTree.FindDescendant(frame); ``` -------------------------------- ### SetBinding Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Example demonstrating how to use the SetBinding extension method to bind the IsEnabled property of a button. ```csharp button.SetBinding(IsEnabledProperty, new Binding("IsValid")); ``` -------------------------------- ### Set Password Reveal Mode Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/types.md Example of allowing password peeking in a PasswordBox by setting the reveal mode. ```csharp // Allow peeking password PasswordBoxHelper.SetRevealMode(passwordBox, PasswordRevealMode.Peek); ``` -------------------------------- ### Install ModernWPF via NuGet Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/README.md Use this command to install the ModernWPF UI package into your project via the Package Manager Console. ```powershell Install-Package ModernWpfUI ``` -------------------------------- ### SimpleStackPanel Layout Example Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/README.md Use SimpleStackPanel for basic vertical or horizontal stacking of elements with configurable spacing. ```xaml ``` -------------------------------- ### Configure Content Transitions Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Navigation.md Sets custom transitions for page navigation. This example adds a drill-in transition effect. ```csharp var transitions = new TransitionCollection(); transitions.Add(new NavigationThemeTransition { DefaultNavigationTransitionInfo = new DrillInNavigationTransitionInfo() }); frame.ContentTransitions = transitions; ``` -------------------------------- ### Configure Frame Navigation Transitions (C#) Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/configuration.md Programmatically configure default navigation transitions for a Frame control using C#. This example adds a DrillInNavigationTransitionInfo. ```csharp public void ConfigureFrameTransitions() { var transitions = new TransitionCollection(); // Drill-in transition transitions.Add(new NavigationThemeTransition { DefaultNavigationTransitionInfo = new DrillInNavigationTransitionInfo() }); ContentFrame.ContentTransitions = transitions; } ``` -------------------------------- ### Style Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the style for the title bar control. ```APIDOC ## Style ### Description Gets or sets the style for the title bar control. ### Attached Property Methods - `GetStyle(Window window)`: Retrieves the style of the title bar. - `SetStyle(Window window, Style value)`: Sets the style of the title bar. ### Parameters #### SetStyle - `window` (Window) - Required - The window element to set the property on. - `value` (Style) - Required - The style to apply to the title bar. ### Remarks Uses `TitleBarControl` as the target style type. ``` -------------------------------- ### Listen for Theme Changes Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ThemeManager.md Provides examples of subscribing to events for application-wide theme changes and specific element theme changes to update the UI accordingly. ```csharp // Listen for application theme changes ThemeManager.Current.ActualApplicationThemeChanged += (s, e) => { var theme = ThemeManager.Current.ActualApplicationTheme; // Update UI based on new theme }; // Listen for element theme changes ThemeManager.AddActualThemeChangedHandler(myWindow, (s, e) => { // Handle theme change for this specific window }); ``` -------------------------------- ### Background Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the background brush for the title bar. ```APIDOC ## Background ### Description Gets or sets the background brush for the title bar. ### Attached Property Methods - `GetBackground(Window window)`: Retrieves the background brush of the title bar. - `SetBackground(Window window, Brush value)`: Sets the background brush of the title bar. ### Parameters #### SetBackground - `window` (Window) - Required - The window element to set the property on. - `value` (Brush) - Required - The background brush color. ### Request Example ```csharp var titleBarBrush = TitleBar.GetBackground(myWindow); TitleBar.SetBackground(myWindow, Brushes.Navy); ``` ``` -------------------------------- ### Foreground Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the foreground (text) brush for the title bar. ```APIDOC ## Foreground ### Description Gets or sets the foreground (text) brush for the title bar. ### Attached Property Methods - `GetForeground(Window window)`: Retrieves the foreground brush of the title bar. - `SetForeground(Window window, Brush value)`: Sets the foreground brush of the title bar. ### Parameters #### SetForeground - `window` (Window) - Required - The window element to set the property on. - `value` (Brush) - Required - The foreground brush color. ### Request Example ```xaml ``` ``` -------------------------------- ### Configure Frame Navigation Transitions (XAML) Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/configuration.md Set up default navigation transitions for a Frame control in XAML. This example uses DrillInNavigationTransitionInfo. ```xaml ``` -------------------------------- ### ThemeManager.Current Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ThemeManager.md Gets the singleton instance of ThemeManager. This is the primary way to access and control the application's theming system. ```APIDOC ## ThemeManager.Current ### Description Gets the singleton instance of `ThemeManager`. This instance controls the application-wide and element-specific theming system. ### Method GET ### Endpoint ThemeManager.Current ### Returns `ThemeManager` - The global theme manager instance. ### Example ```csharp var themeManager = ThemeManager.Current; themeManager.ApplicationTheme = ApplicationTheme.Dark; ``` ``` -------------------------------- ### IsWindows10OrGreater Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Gets a value indicating whether the OS is Windows 10 or later. ```APIDOC ## IsWindows10OrGreater ### Description Gets a value indicating whether the OS is Windows 10 or later. ### Example ```csharp if (OSVersionHelper.IsWindows10OrGreater) { // Use Windows 10+ features } ``` ``` -------------------------------- ### Complete Application Startup Configuration Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/configuration.md This template demonstrates a complete startup sequence for a Modern WPF application. It covers theme manager initialization, loading saved settings, setting up theme change handlers, and showing the main window. ```csharp public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); // 1. Initialize theme manager ThemeManager.Current.Initialize(); // 2. Load saved settings var settings = ThemeSettings.Load(); settings.ApplySettings(); // 3. Setup theme change handlers SetupThemeChangeHandling(); // 4. Show main window MainWindow = new MainWindow(); MainWindow.Show(); } private void SetupThemeChangeHandling() { ThemeManager.Current.ActualApplicationThemeChanged += (s, e) => { SaveThemeSettings(); }; ThemeManager.Current.ActualAccentColorChanged += (s, e) => { SaveThemeSettings(); }; } private void SaveThemeSettings() { var settings = new ThemeSettings { ApplicationTheme = ThemeManager.Current.ApplicationTheme, AccentColor = ThemeManager.Current.AccentColor }; settings.Save(); } } ``` -------------------------------- ### Get ThemeManager Instance Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ThemeManager.md Access the singleton ThemeManager instance to manage application themes. Use this to retrieve the current manager. ```csharp var themeManager = ThemeManager.Current; themeManager.ApplicationTheme = ApplicationTheme.Dark; ``` -------------------------------- ### Complete Application Initialization Pattern Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/XamlResources.md Demonstrates the recommended pattern for initializing application resources in App.xaml, including core theme resources, control styles, and custom application colors/styles. ```xaml ``` -------------------------------- ### Initialize SimpleStackPanel Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Demonstrates how to create and configure a new instance of SimpleStackPanel with vertical orientation and spacing. ```csharp var panel = new SimpleStackPanel { Orientation = Orientation.Vertical, Spacing = 12 }; ``` -------------------------------- ### ThemeManager.ActualApplicationTheme Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ThemeManager.md Gets the effective theme currently in use by the application. This read-only property reflects the actual theme, considering both explicit settings and system preferences. ```APIDOC ## ThemeManager.ActualApplicationTheme ### Description Gets the effective theme currently in use by the application. This read-only property accounts for explicit `ApplicationTheme` settings and system preferences. ### Method GET ### Endpoint ThemeManager.ActualApplicationTheme ### Returns `ApplicationTheme` - The effective application theme (Light or Dark). ### Remarks This property's value is determined by the `ApplicationTheme` property and system settings. ``` -------------------------------- ### Set TitleBar Back Button Visibility and State (C#) Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Manage the visibility and enabled state of the back button in the title bar using C# methods. This example shows how to enable it and check its state. ```csharp // Show back button in title bar TitleBar.SetIsBackButtonVisible(myWindow, true); // Disable back button TitleBar.SetIsBackEnabled(myWindow, false); // Check if back button is enabled bool isEnabled = TitleBar.GetIsBackEnabled(myWindow); ``` -------------------------------- ### Make Window Theme-Aware Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ThemeManager.md Demonstrates how to configure a window to automatically respond to application-level theme changes by setting its theme awareness. ```csharp public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); // Make this window respond to application theme changes ThemeManager.SetIsThemeAware(this, true); } } ``` -------------------------------- ### InactiveForeground Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the foreground brush when the window is inactive. ```APIDOC ## InactiveForeground ### Description Gets or sets the foreground brush when the window is inactive. ### Attached Property Methods - `GetInactiveForeground(Window window)`: Retrieves the inactive foreground brush of the title bar. - `SetInactiveForeground(Window window, Brush value)`: Sets the inactive foreground brush of the title bar. ### Parameters #### SetInactiveForeground - `window` (Window) - Required - The window element to set the property on. - `value` (Brush) - Required - The inactive foreground brush color. ### Request Example ```xaml ``` ``` -------------------------------- ### Switch Application Theme Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ThemeManager.md Demonstrates how to switch the application's theme to Dark, Light, or use the system's default theme by setting the ApplicationTheme property. ```csharp // Switch to dark theme ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark; // Use system theme ThemeManager.Current.ApplicationTheme = null; // Switch to light theme ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light; ``` -------------------------------- ### DPI-Aware Window Sizing Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Demonstrates setting a window's size in logical pixels and converting it to physical pixels for native API usage. ```csharp public class DpiAwareWindow : Window { protected override void OnLoaded(object sender, RoutedEventArgs e) { // Set size in logical pixels, convert to physical for native APIs int logicalWidth = 800; int physicalWidth = DpiHelper.LogicalToPhysical(logicalWidth); } } ``` -------------------------------- ### BackButtonStyle Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the style applied to the back button specifically. ```APIDOC ## BackButtonStyle ### Description Gets or sets the style applied to the back button specifically. ### Attached Property Methods - `GetBackButtonStyle(Window window)`: Retrieves the style of the back button. - `SetBackButtonStyle(Window window, Style value)`: Sets the style of the back button. ### Parameters #### SetBackButtonStyle - `window` (Window) - Required - The window element to set the property on. - `value` (Style) - Required - The style to apply to the back button. ### Remarks Uses `TitleBarButton` as the target style type. ``` -------------------------------- ### InactiveBackground Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the background brush when the window is inactive (not focused). ```APIDOC ## InactiveBackground ### Description Gets or sets the background brush when the window is inactive (not focused). ### Attached Property Methods - `GetInactiveBackground(Window window)`: Retrieves the inactive background brush of the title bar. - `SetInactiveBackground(Window window, Brush value)`: Sets the inactive background brush of the title bar. ### Parameters #### SetInactiveBackground - `window` (Window) - Required - The window element to set the property on. - `value` (Brush) - Required - The inactive background brush color. ### Request Example ```csharp TitleBar.SetInactiveBackground(myWindow, new SolidColorBrush(Color.FromArgb(255, 240, 240, 240))); ``` ``` -------------------------------- ### LogicalOrientation Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Gets the logical orientation of the panel, which is the current Orientation value. ```APIDOC ## Protected Property: LogicalOrientation ### Description Gets the logical orientation of the panel. Returns the current `Orientation` value. ### Type `Orientation` ### Access `protected override` ``` -------------------------------- ### ViewModel with Design-Time Data Loading Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Illustrates how to load sample data for the designer using DesignMode.DesignModeEnabled. ```csharp public class MyViewModel { public ObservableCollection Items { get; set; } public MyViewModel() { Items = new ObservableCollection(); if (DesignMode.DesignModeEnabled) { // Load sample data for designer Items.Add(new Item { Name = "Sample 1" }); Items.Add(new Item { Name = "Sample 2" }); } } } ``` -------------------------------- ### IsWindows8OrGreater Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Gets a value indicating whether the OS is Windows 8 or later. ```APIDOC ## IsWindows8OrGreater ### Description Gets a value indicating whether the OS is Windows 8 or later. ``` -------------------------------- ### Navigate to a Page with Transition Animation Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Navigation.md Navigates to a page with a specified transition animation. An optional parameter can also be passed. Returns true on success, false otherwise. ```csharp public bool Navigate(Type sourcePageType, object parameter, NavigationTransitionInfo infoOverride) ``` ```csharp frame.Navigate( typeof(DetailsPage), itemId, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromBottom } ); ``` -------------------------------- ### Instantiate ColorPaletteResources Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ColorPaletteResources.md Demonstrates how to create a new instance of ColorPaletteResources and set its TargetTheme and Accent properties. Use this to initialize a custom color palette for a specific theme. ```csharp var colorResources = new ColorPaletteResources { TargetTheme = ApplicationTheme.Dark, Accent = Colors.Blue }; ``` -------------------------------- ### IsBackButtonVisible Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets whether the back button is visible in the title bar. ```APIDOC ## IsBackButtonVisible ### Description Gets or sets whether the back button is visible in the title bar. ### Attached Property Methods - `GetIsBackButtonVisible(Window window)`: Retrieves whether the back button is visible. - `SetIsBackButtonVisible(Window window, bool value)`: Sets whether the back button is visible. ### Parameters #### SetIsBackButtonVisible - `window` (Window) - Required - The window element to set the property on. - `value` (bool) - Required - `true` to show the back button, `false` to hide it. ### Request Example ```csharp // Show back button in title bar TitleBar.SetIsBackButtonVisible(myWindow, true); ``` ``` -------------------------------- ### Initialize Custom Resource Dictionaries Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/configuration.md Add custom resource dictionaries to your application's resources to manage application-specific styling. This allows for modularity in defining colors and control templates. ```csharp public class AppResources { public static void Initialize() { var appResources = Application.Current.Resources; // Add theme resources (already done in App.xaml) // Add custom colors appResources.MergedDictionaries.Add( new ResourceDictionary { Source = new Uri("pack://application:,,,/Themes/Colors.xaml") } ); // Add control templates appResources.MergedDictionaries.Add( new ResourceDictionary { Source = new Uri("pack://application:,,,/Themes/Controls.xaml") } ); } } ``` -------------------------------- ### IsIconVisible Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets whether the window icon is visible in the title bar. ```APIDOC ## IsIconVisible ### Description Gets or sets whether the window icon is visible in the title bar. ### Default `false` ### Attached Property Methods - `GetIsIconVisible(Window window)`: Retrieves whether the window icon is visible. - `SetIsIconVisible(Window window, bool value)`: Sets whether the window icon is visible. ### Parameters #### SetIsIconVisible - `window` (Window) - Required - The window element to set the property on. - `value` (bool) - Required - `true` to show the icon, `false` to hide it. ### Request Example ```xaml ``` ``` -------------------------------- ### ButtonStyle Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets the style applied to regular title bar buttons. ```APIDOC ## ButtonStyle ### Description Gets or sets the style applied to regular title bar buttons. ### Attached Property Methods - `GetButtonStyle(Window window)`: Retrieves the style of the title bar buttons. - `SetButtonStyle(Window window, Style value)`: Sets the style of the title bar buttons. ### Parameters #### SetButtonStyle - `window` (Window) - Required - The window element to set the property on. - `value` (Style) - Required - The style to apply to the title bar buttons. ### Remarks Uses `TitleBarButton` as the target style type. ### Request Example ```xaml ``` ``` -------------------------------- ### IsBackEnabled Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/TitleBar.md Gets or sets whether the back button is enabled (clickable) in the title bar. ```APIDOC ## IsBackEnabled ### Description Gets or sets whether the back button is enabled (clickable) in the title bar. ### Default `true` ### Attached Property Methods - `GetIsBackEnabled(Window window)`: Retrieves whether the back button is enabled. - `SetIsBackEnabled(Window window, bool value)`: Sets whether the back button is enabled. ### Parameters #### SetIsBackEnabled - `window` (Window) - Required - The window element to set the property on. - `value` (bool) - Required - `true` to enable the back button, `false` to disable it. ### Request Example ```csharp // Disable back button TitleBar.SetIsBackEnabled(myWindow, false); // Check if back button is enabled bool isEnabled = TitleBar.GetIsBackEnabled(myWindow); ``` ``` -------------------------------- ### SimpleStackPanel.Orientation Property Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Gets or sets the direction in which child elements are arranged. Can be Horizontal or Vertical. ```APIDOC ## SimpleStackPanel.Orientation Property ### Description Gets or sets the direction in which child elements are arranged. Changes trigger a measure pass for layout recalculation. ### Property Signature ```csharp public Orientation Orientation { get; set; } ``` ### Type `Orientation` enum ### Default Value `Orientation.Vertical` ### Remarks - `Orientation.Horizontal`: Children arranged left to right. - `Orientation.Vertical`: Children arranged top to bottom. ### Example ```csharp // Arrange buttons horizontally panel.Orientation = Orientation.Horizontal; // Arrange buttons vertically panel.Orientation = Orientation.Vertical; ``` ``` -------------------------------- ### SimpleStackPanel Constructor Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Initializes a new instance of the SimpleStackPanel class. This is the entry point for creating a SimpleStackPanel object. ```APIDOC ## SimpleStackPanel Constructor ### Description Initializes a new instance of the `SimpleStackPanel` class. ### Signature ```csharp public SimpleStackPanel() ``` ### Example ```csharp var panel = new SimpleStackPanel { Orientation = Orientation.Vertical, Spacing = 12 }; ``` ``` -------------------------------- ### LogicalOrientation Property Implementation Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Gets the logical orientation of the panel. Returns the current Orientation value. ```csharp protected override Orientation LogicalOrientation { get; } ``` -------------------------------- ### EntranceNavigationTransitionInfo Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Navigation.md Provides a fade-in entrance animation for page navigation. This transition is useful for bringing new content into view smoothly. ```APIDOC ## EntranceNavigationTransitionInfo ### Description Provides a fade-in entrance animation for page navigation. This transition is useful for bringing new content into view smoothly. ### Usage ```csharp frame.Navigate(typeof(HomePage), null, new EntranceNavigationTransitionInfo()); ``` ``` -------------------------------- ### ColorsHelper.DefaultAccentColor Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Gets the default application accent color. This is typically a shade of blue used as a system accent. ```APIDOC ## ColorsHelper.DefaultAccentColor ### Description Gets the default application accent color. This is typically a shade of blue used as a system accent. ### Returns `Color` — The default accent color (typically Windows blue). ### Example ```csharp var defaultAccent = ColorsHelper.DefaultAccentColor; ``` ``` -------------------------------- ### Merge Custom Resources into App Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/XamlResources.md Integrate custom theme resources into your application by merging a custom ResourceDictionary. This should be done during application startup. ```csharp public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var customResources = new ResourceDictionary { Source = new Uri("pack://application:,,,/Themes/CustomColors.xaml") }; this.Resources.MergedDictionaries.Insert(0, customResources); } } ``` -------------------------------- ### Create Storyboard for Property Animation Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Creates a Storyboard to animate a DependencyProperty on a FrameworkElement. Useful for simple property transitions. ```csharp public static Storyboard CreateStoryboard(FrameworkElement target, DependencyProperty property, object fromValue, object toValue, Duration duration) { // Implementation details omitted for brevity return null; // Placeholder } ``` ```csharp var storyboard = AnimationHelper.CreateStoryboard( button, OpacityProperty, 0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.5)) ); storyboard.Begin(); ``` -------------------------------- ### Get Default Accent Color Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Retrieves the default accent color for the application. This is typically a shade of blue. ```csharp var defaultAccent = ColorsHelper.DefaultAccentColor; ``` -------------------------------- ### Dynamically Switch Between Light and Dark Themes Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ColorPaletteResources.md Implement methods to switch the application's theme by replacing the current ColorPaletteResources in the merged dictionaries with either a dark or light theme configuration. ```csharp public void SwitchToDarkTheme() { var darkPalette = CreateDarkPalette(); Application.Current.Resources.MergedDictionaries[0] = darkPalette; } public void SwitchToLightTheme() { var lightPalette = CreateLightPalette(); Application.Current.Resources.MergedDictionaries[0] = lightPalette; } private ColorPaletteResources CreateDarkPalette() { return new ColorPaletteResources { TargetTheme = ApplicationTheme.Dark, Accent = Colors.CornflowerBlue, BaseHigh = Colors.White, BaseLow = Colors.Gray }; } private ColorPaletteResources CreateLightPalette() { return new ColorPaletteResources { TargetTheme = ApplicationTheme.Light, Accent = Colors.RoyalBlue, BaseHigh = Colors.Black, BaseLow = Colors.LightGray }; } ``` -------------------------------- ### DesignModeEnabled Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Helpers.md Gets a value indicating whether the application is running in design mode (XAML designer) or runtime. ```APIDOC ## DesignModeEnabled ### Description Gets a value indicating whether the application is running in design mode (XAML designer) or runtime. ### Returns `bool` — True if running in the designer; false at runtime. ### Example ```csharp public MyControl() { InitializeComponent(); if (!DesignMode.DesignModeEnabled) { // Runtime-only initialization LoadData(); } } ``` ``` -------------------------------- ### Responsive Layout with Data Binding Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Implement a responsive layout by data binding the panel's orientation to the window's actual width. Requires a custom WidthToOrientationConverter. ```csharp var stackPanel = new SimpleStackPanel { Spacing = 12 }; // Data bind to adjust orientation based on window width var binding = new Binding("ActualWidth") { Source = this, Converter = new WidthToOrientationConverter() }; stackPanel.SetBinding(SimpleStackPanel.OrientationProperty, binding); ``` -------------------------------- ### HasLogicalOrientation Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/SimpleStackPanel.md Gets a value indicating whether this panel has logical orientation. This property always returns true. ```APIDOC ## Protected Property: HasLogicalOrientation ### Description Gets a value indicating whether this panel has logical orientation. Always returns `true`. ### Type `bool` ### Access `protected override` ``` -------------------------------- ### Navigate with Transition Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Navigation.md Navigates to a page with a specific transition animation. ```APIDOC ## Navigate with Transition ### Description Navigates to a page with a specific transition animation. ### Method `Navigate` ### Parameters #### Path Parameters - **sourcePageType** (`Type`) - Required - The type of the page to navigate to - **parameter** (`object`) - Optional - Optional parameter for the page - **infoOverride** (`NavigationTransitionInfo`) - Required - The transition animation to use ### Returns `bool` — True if navigation succeeded; otherwise false. ### Example ```csharp frame.Navigate( typeof(DetailsPage), itemId, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromBottom } ); ``` ``` -------------------------------- ### Accent Property Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/ColorPaletteResources.md Gets or sets the primary accent color. When set, derived shades are automatically calculated. ```APIDOC ## Accent Property ### Description Gets or sets the primary accent color. When set, derived shades are automatically calculated. ### Property `public Color? Accent { get; set; }` ### Parameters #### Set Property - **Accent** (`Windows.UI.Color?`) - Required/Optional - The primary accent color. ### Details - **Type**: `Windows.UI.Color?` - **Default**: `null` ``` -------------------------------- ### Use DrillInNavigationTransitionInfo for Zoom-In Animation Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/Navigation.md Implement DrillInNavigationTransitionInfo for a drill-in animation effect, where the new page zooms in from the center. This provides a visually engaging transition. ```csharp var transition = new DrillInNavigationTransitionInfo(); frame.Navigate(typeof(DetailPage), itemId, transition); ``` -------------------------------- ### Use Theme Resource Brushes in XAML Source: https://github.com/kinnara/modernwpf/blob/master/_autodocs/api-reference/XamlResources.md Demonstrates how to use predefined brush resources for text and buttons in XAML. These brushes are derived from standard color keys. ```xaml