### FAQ: Using the Ask Method Source: https://handyorg.github.io/handycontrol/extend_controls/growl Explanation and example of how to use the `Ask` method for user confirmation. ```APIDOC ## FAQ: Using the Ask Method ### Description The `Ask` method is used to display a notification that requires user confirmation. It presents 'Confirm' and 'Cancel' buttons. The behavior after the user interacts with these buttons is determined by a callback function. ### Callback Function The second parameter of the `Ask` method is a `Func`. This function receives a boolean value indicating the user's choice: `true` if 'Confirm' was clicked, `false` if 'Cancel' was clicked. The function should return `true` to close the Growl notification after the action, or `false` to keep it open. ### Example ```csharp Growl.Ask(Properties.Langs.Lang.GrowlAsk, isConfirmed => { Growl.Info(isConfirmed.ToString()); // Display user's choice return true; // Close the Growl notification after the action }); ``` In this example, if the user confirms, a message indicating `true` will be shown, and the Growl notification will close. If the user cancels, a message indicating `false` will be shown, and the Growl notification will also close because the callback returns `true`. ``` -------------------------------- ### Basic Dialog Usage Source: https://handyorg.github.io/handycontrol/extend_controls/dialog Example of how to show a custom dialog by providing its class name. ```APIDOC ## Basic Dialog Usage ### Example ```csharp Dialog.Show(new TextDialog()); ``` This example demonstrates showing a `TextDialog` instance. The `TextDialog` is a custom user control defined elsewhere. ``` -------------------------------- ### Basic ComboBox Examples Source: https://handyorg.github.io/handycontrol/extend_controls/comboBox Demonstrates basic ComboBox usage with ShowClearButton, ItemsSource, SelectedIndex, and IsEnabled properties. ```xaml ``` -------------------------------- ### FloatingBlock Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/floatingBlock Demonstrates how to use the FloatingBlock control with different configurations for click effects. It shows examples using ContentTemplate and direct Content property. ```xaml ``` -------------------------------- ### Basic TabControl Example Source: https://handyorg.github.io/handycontrol/native_controls/tabControl Demonstrates the default TabControl with multiple tab items. This is a foundational example for using the TabControl. ```xaml ``` -------------------------------- ### NotifyIcon Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/notifyIcon An example demonstrating how to use the NotifyIcon control in XAML. ```APIDOC ## NotifyIcon Usage Example ### Description This example shows how to declare and configure a NotifyIcon in XAML. ### XAML ```xml ``` ``` -------------------------------- ### Adding and Jumping in CoverFlow Source: https://handyorg.github.io/handycontrol/extend_controls/coverFlow Example demonstrating how to add resources and jump to a specific page in the CoverFlow control. ```APIDOC ## Example: Adding and Jumping ### Description This example shows how to populate the CoverFlow with multiple image resources and then navigate to a specific item. ### Code ```csharp CoverFlowMain.AddRange(new [] { new Uri(@"pack://application:,,,/Resources/Img/Album/1.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/2.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/3.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/4.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/5.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/6.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/7.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/8.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/9.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/10.jpg") }); CoverFlowMain.JumpTo(2); ``` ``` -------------------------------- ### TextBlock Styles Example Source: https://handyorg.github.io/handycontrol/native_controls/textBlock Demonstrates the usage of various predefined TextBlock styles for different text hierarchies and semantic meanings. ```XAML ``` -------------------------------- ### Gravatar Control Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/gravatar Demonstrates various ways to use the Gravatar control within a StackPanel and UniformGrid. Includes examples of setting Id, Style, and Source properties, as well as binding the Id to a TextBox. ```xaml ``` -------------------------------- ### CompareSlider Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/compareSlider Demonstrates how to use the CompareSlider control to display image differences. Includes horizontal and vertical orientations. ```xaml ``` -------------------------------- ### Rate Control Examples Source: https://handyorg.github.io/handycontrol/extend_controls/rate Demonstrates various configurations of the Rate control, including default values, read-only mode, half-selection, clearing behavior, custom icons, and displaying text. ```xaml ``` -------------------------------- ### TabControl Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/tabControl Demonstrates how to use the TabControl with various properties enabled, including animations, close buttons, draggable tabs, and tab filling. This example showcases a TabControl with seven TabItems, each containing a SimplePanel with a different background color. ```xaml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ``` ```xaml ``` -------------------------------- ### Shield Badge Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/shield Demonstrates how to use the Shield badge component with different subjects, statuses, colors, and click commands to open links. ```xaml ``` -------------------------------- ### CircleProgressBar Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/circleProgressBar Demonstrates various configurations of CircleProgressBar, including different sizes, text visibility, arc thickness, and styles for different states. ```xaml 1 2 3 4 5 6 7 8 ``` ``` ``` -------------------------------- ### HoneycombPanel Layout Example Source: https://handyorg.github.io/handycontrol/extend_controls/honeycombPanel Illustrates the circular arrangement of elements around a central point in a honeycomb layout. ```plaintext ● ● (7) (8) ● ● ● (6) (1) (9) ● ● ● ... (5) (0) (2) ● ● ... (4) (3) ``` -------------------------------- ### Brush Resource for IconBrushKey Source: https://handyorg.github.io/handycontrol/data/GrowlInfo Example of a Brush resource that can be used for the IconBrushKey property in GrowlInfo. Ensure the resource type is Brush and the Key name is correctly specified. ```xml ``` -------------------------------- ### Example Usage of Boolean to Visibility Converter Source: https://handyorg.github.io/handycontrol/basic_xaml/converters Demonstrates how to use the `Boolean2VisibilityConverter` in XAML to control element visibility based on a boolean binding. ```XAML Visibility="{Binding ShowButton,Converter={StaticResource Boolean2VisibilityConverter}}" ``` -------------------------------- ### Geometry Resource for IconKey Source: https://handyorg.github.io/handycontrol/data/GrowlInfo Example of a Geometry resource that can be used for the IconKey property in GrowlInfo. Ensure the resource type is Geometry and the Key name is correctly specified. ```xml M260.8 645H160V0h100.8v645zM461.8 152.2h-100.8V1024h100.8V152.2z m201.2 0h-100.8V1024h100.8V152.2zM864 152h-100.8v494H864V152z ``` -------------------------------- ### Defining a Geometry for AnimationPath Source: https://handyorg.github.io/handycontrol/extend_controls/animationPath Example of defining a Geometry resource named 'GithubGeometry' which can be used by the AnimationPath control. ```xaml M512 0C229.12 0 0 229.12 0 512c0 226.56 146.56 417.92 350.08 485.76 25.6 4.48 35.2-10.88 35.2-24.32 0-12.16-0.64-52.48-0.64-95.36-128.64 23.68-161.92-31.36-172.16-60.16-5.76-14.72-30.72-60.16-52.48-72.32-17.92-9.6-43.52-33.28-0.64-33.92 40.32-0.64 69.12 37.12 78.72 52.48 46.08 77.44 119.68 55.68 149.12 42.24 4.48-33.28 17.92-55.68 32.64-68.48-113.92-12.8-232.96-56.96-232.96-252.8 0-55.68 19.84-101.76 52.48-137.6-5.12-12.8-23.04-65.28 5.12-135.68 0 0 42.88-13.44 140.8 52.48 40.96-11.52 84.48-17.28 128-17.28 43.52 0 87.04 5.76 128 17.28 97.92-66.56 140.8-52.48 140.8-52.48 28.16 70.4 10.24 122.88 5.12 135.68 32.64 35.84 52.48 81.28 52.48 137.6 0 196.48-119.68 240-233.6 252.8 18.56 16 34.56 46.72 34.56 94.72 0 68.48-0.64 123.52-0.64 140.8 0 13.44 9.6 29.44 35.2 24.32A512.832 512.832 0 0 0 1024 512c0-282.88-229.12-512-512-512z ``` -------------------------------- ### DashedBorder Example Source: https://handyorg.github.io/handycontrol/extend_controls/dashedBorder Demonstrates how to use the DashedBorder control in XAML with specific styling for width, height, border dash thickness, color, dash array, and corner radius. ```APIDOC ## DashedBorder Example ### Description Shows a practical example of implementing the DashedBorder control with various customization properties. ### Usage ```xml ``` ### Notes - When setting the border thickness, use `BorderThickness` if all corner radius values are the same. - Use `BorderDashThickness` if the corner radius values differ. ``` -------------------------------- ### Using AnimationPath in XAML Source: https://handyorg.github.io/handycontrol/extend_controls/animationPath Example of how to use the AnimationPath control within a Grid, binding its Data property to a Geometry resource and setting the Duration. ```xaml ``` -------------------------------- ### TagPanel Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/tag Demonstrates the usage of TagPanel with various Tag controls. It shows how to configure the panel's orientation, maximum width, alignment, and whether to show an add button. Individual tags can be configured for selectable state and visibility of their close buttons. ```xaml ``` -------------------------------- ### Show Dialog and Get Result Asynchronously Source: https://handyorg.github.io/handycontrol/extend_controls/dialog Shows a dialog and waits for an asynchronous result. The Initialize method sets up the ViewModel, and GetResultAsync retrieves the result. ```csharp Dialog.Show() .Initialize(vm => vm.Message = DialogResult) .GetResultAsync() .ContinueWith(str => DialogResult = str.Result); ``` -------------------------------- ### CirclePanel Usage Example Source: https://handyorg.github.io/handycontrol/extend_controls/circlePanel Demonstrates how to use the CirclePanel to arrange multiple buttons in a circular layout. The Diameter property controls the size of the circle. ```xaml