WinUI-Gallery icon indicating copy to clipboard operation
WinUI-Gallery copied to clipboard

feat: Update NumberBox example to reflect spin button placement in displayed XAML code

Open Zakariathr22 opened this issue 6 months ago • 2 comments

Description

This update ensures that the example code reflects user selections between Inline and Compact spin button placements, improving the accuracy and relevance of the displayed example, main changes are:

  • Updated XAML to dynamically reflect spin button placement changes in the displayed code.
    • Replaced static XAML with dynamic code binding that updates based on user selection.
  • Modified RadioButtons control to use SelectionChanged event handler for updating the SpinButtonPlacementMode of the NumberBox.
  • Added XAML substitution to ensure the displayed source code shows the correct SpinButtonPlacementMode.
  • Removed obsolete XAML source file NumberBoxSample2_xaml.txt.

Motivation and Context

The previous implementation did not dynamically update the example source code based on user interactions with the spin button placement options. This change improves user experience by providing accurate and up-to-date example code that matches the current UI configuration, helping users better understand how different settings affect the NumberBox control.

How Has This Been Tested?

Manual Testing: The changes were tested by interacting with the RadioButtons control to switch between Inline and Compact spin button placements. The displayed example code was verified to accurately update according to the selected option.

Screenshots:

image image

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Zakariathr22 avatar Aug 21 '24 03:08 Zakariathr22