Size & Radius Customization

This feature allows developers to control and adjust the overall size and the radii of the spinner's inner and outer circles, ensuring the control fits various layouts and maintains its visual proport

Overview

The Size & Radius Customization feature in the SiticoneLoadingSpinner control provides properties and methods to modify the spinner’s dimensions. Developers can explicitly set the OuterCircleRadius and InnerCircleRadius, or allow the control to adjust its size automatically while maintaining a proper ratio. This flexibility ensures the spinner remains visually balanced and integrates smoothly into different form layouts and resolutions.


Detailed Size & Radius Settings

The table below summarizes the key properties and methods related to size and radius customization, along with their descriptions, valid values, and default behaviors.

Property / Setting
Description
Valid Values / Defaults

OuterCircleRadius

Defines the radius of the outer circle, affecting the overall size of the spinner.

Integer; default based on control's default size (default: 25, subject to control sizing)

InnerCircleRadius

Specifies the radius of the inner circle; often set as a fraction of the outer radius for balanced design.

Integer; should be less than or equal to OuterCircleRadius (default: determined by a default ratio, typically 1/3 of outer radius)

ResetRadiusToDefault()

Resets the inner and outer radii to their default proportions, recalculating based on control size.

Method; no parameters

Control Sizing Behavior

The control automatically maintains a square shape and a minimum size based on the outer radius to preserve visual integrity.

Automatic adjustment based on control's size and user settings

The control maintains a minimum size to ensure that the spinner remains legible, and if the radii are not explicitly set by the user, they are adjusted according to a default ratio when the control is resized.


Code Examples & Integration Samples

Explicitly Setting the Outer and Inner Radii

Developers can directly adjust the radii to customize the spinner’s proportions:

// Create an instance of the spinner control.
var spinner = new SiticoneLoadingSpinner();

// Set the outer radius for a larger spinner.
spinner.OuterCircleRadius = 40;

// Set the inner radius; ensure this is less than the outer radius.
spinner.InnerCircleRadius = 12;

// Start the spinner to see the size changes.
spinner.Start();

Resetting Radii to Default

If custom radii have been applied and a reversion to default sizing is needed, use the ResetRadiusToDefault() method:

// Reset radii back to default values based on the current control size.
spinner.ResetRadiusToDefault();
spinner.Start();

Responsive Sizing Behavior

The control automatically adjusts to maintain a square shape and enforce minimum dimensions. This example demonstrates how the control behaves when resized:

// Example: Resize the spinner control programmatically.
spinner.Size = new Size(150, 150);

// The control will adjust the inner and outer radii based on the new size,
// unless the user has explicitly set them.
spinner.Start();

Key Points

Key Aspect
Details

Explicit Customization

OuterCircleRadius and InnerCircleRadius allow precise control over the spinner’s size and proportions.

Automatic Adjustment

When not explicitly set, the control adjusts radii based on the control's size and maintains a square shape.

Minimum Size Enforcement

The control enforces a minimum size to ensure that the spinner remains visually consistent and legible.

Reset Capability

ResetRadiusToDefault() offers an easy way to revert to default settings after custom modifications.


Best Practices

Best Practice
Recommendation

Maintain Proportionality

Ensure that InnerCircleRadius is always a proper fraction of OuterCircleRadius to avoid visual imbalance.

Test Across Layouts

Verify the spinner's appearance in different container sizes to confirm that automatic resizing maintains design integrity.

Use Reset Method for Consistency

Leverage ResetRadiusToDefault() when a consistent baseline is needed, especially after dynamic resizing or theme changes.

Consider Minimum Size

Design your form layouts with the spinner’s minimum size in mind to prevent unexpected clipping or distortion.


Common Pitfalls

Common Issue
Explanation & Resolution

Inconsistent Ratios

Setting an InnerCircleRadius too high relative to OuterCircleRadius can lead to an overcrowded appearance; maintain a balanced ratio.

Overriding Automatic Resizing

Explicitly setting radii may override the control's automatic sizing; ensure this is intentional and well-documented in your code.

Ignoring Minimum Size Constraints

Failing to account for the enforced minimum size may result in the spinner being displayed too small on certain form layouts.

Resizing After Manual Configuration

If custom radii are set, subsequent resizing of the control may not adjust the radii automatically; consider using ResetRadiusToDefault() when needed.


Usage Scenarios

Scenario
Description & Sample Code

Fixed Size Spinner

When a consistent spinner size is required, explicitly set OuterCircleRadius and InnerCircleRadius to match your design guidelines.

Responsive UI Design

Allow the control to adjust its radii automatically by not setting explicit values; the control will resize proportionally with the form.

Dynamic Theme Switching

Use ResetRadiusToDefault() when themes change to ensure that the spinner resets to its default, balanced dimensions.

High-DPI and Multi-Resolution Support

Ensure that the spinner scales appropriately on different displays by relying on the control's built-in sizing and minimum size behavior.


Review

The Size & Radius Customization feature is crucial for adapting the SiticoneLoadingSpinner to fit different layouts and screen resolutions. By providing both explicit radius settings and automatic resizing behavior, developers have the flexibility to design spinners that are visually balanced and responsive. This feature supports a wide range of usage scenarios from fixed-size implementations to dynamic, responsive designs while ensuring consistency and clarity.


Summary

Size & Radius Customization in the SiticoneLoadingSpinner control empowers developers to control the overall dimensions and specific radii of the spinner’s inner and outer circles. With properties like OuterCircleRadius and InnerCircleRadius, along with the ResetRadiusToDefault() method, developers can either explicitly define the spinner's size or allow it to adjust automatically based on the control's dimensions. This ensures that the spinner remains legible, proportional, and well-integrated within varying UI layouts.


Additional Tips

Tip
Recommendation

Maintain Consistency with Other Controls

Ensure that the spinner’s size aligns with other UI elements for a harmonious layout.

Experiment with Ratios

Try different combinations of OuterCircleRadius and InnerCircleRadius to find the most visually appealing ratio for your application.

Validate on Multiple Devices

Test the spinner on various screen resolutions and DPI settings to verify that automatic resizing behaves as expected.

Document Custom Sizing Choices

Include comments in your code explaining why specific radius values were chosen, aiding future maintenance and updates.

This comprehensive documentation for the Size & Radius Customization feature should assist developers in effectively integrating and tailoring the SiticoneLoadingSpinner control’s dimensions within their .NET WinForms applications.

Last updated