Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor SampleCodePresenter to adjust code presenter visibility handling #1666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Zakariathr22
Copy link
Contributor

Description

Refactored SampleCodePresenter to improve code presenter visibility handling and align its behavior with broader application usage patterns, the only change is:

  • Updated the SampleCodePresenter_Loaded method in SampleCodePresenter.xaml.cs to enhance visibility handling for CodePresenter by removing logic to collapse code presenter visibility by default.

Motivation and Context

  • The previous implementation collapsed the visibility of CodePresenter in scenarios where it was not explicitly needed. This conflicted with scenarios like the Iconography Page, where an empty CodePresenter is defined and modified dynamically later.
  • The responsibility for managing visibility when switching between code presenters (e.g., XAML and C#) already exists in the ControlExample.HandlePresenterVisibility method, making redundant visibility management unnecessary within SampleCodePresenter in most cases.
  • To prevent issues in cases requiring default-loaded CodePresenter, its visibility is now set to Visible by default, and changes are applied only when truly needed.

How Has This Been Tested?

Manual Testing:

  • Verified CodePresenter visibility remains consistent across pages requiring dynamic updates.
  • Tested transitions between XAML and C# in scenarios where HandlePresenterVisibility() manages visibility logic.

Screenshots:

- Before: Code presenters collapsed unnecessarily where they defined empty to be modified dynamically later.
image

- After: Proper handling of empty code presenters and visibility.
image

Types of changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant