Skip to content

Conversation

@corvinsz
Copy link
Member

fixes #3863

This PR adds a new attached property (materialDesign:TabAssist.HeaderBehavior) to let consumers decide on how to display the headers of a TabControl.

Currently the headers are always contained inside of a ScrollViewer, which is not always ideal. Under certain circumstances the user is unable to click on "the next" tab, because it is simply not shown:

455977593-05159782-e2c0-48dc-96f7-40ac3e8f9c08

With the new AP TabControls can be forced to wrap their headers in a WrapPanel, e.g.: materialDesign:TabAssist.HeaderBehavior="Wrapping".
There is basically now a trigger in the ControlTemplate which swaps out the header of the TabControl.

455977937-18020632-72d4-45b5-a850-e11e186f5825

Note

As of right now the AP can't be changed at runtime. Apparently applying the template when the property changes isn't enough. The TabControl sometimes doesn't show it's content when selecting a Tab after changing the materialDesign:TabAssist.HeaderBehavior. I would argue having the need of changing this AP at runtime is rather rare.

private static void OnHeaderBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    if (d is TabControl tabControl)
    {
        tabControl.ApplyTemplate();
    }
}

@Keboo Keboo added this to the 5.3.0 milestone Jun 19, 2025
MohammadHadi2031 and others added 2 commits June 26, 2025 01:12
* Updating to xUnit v3 1.x

* Adding MTP

https://devblogs.microsoft.com/dotnet/mtp-adoption-frameworks/

* Starting conversion to TUnit

* Tests all compile

* Adds cancellation tokens to async delays

Ensures that asynchronous delay calls use cancellation tokens to allow for tests to be cancelled correctly.

* WIP

* Refactors test suite and updates dependencies

Updates the test suite to use TUnit for improved test clarity and maintainability.
Removes unused xunit packages and addresses nullable warnings in RatingBar converters.
Also includes changes to CustomColorTheme, DataGridAssist, DialogHost, DrawerHost, FlipperAssist, Internal/TreeListViewItemsCollection, Label, MaterialDesignThemes.Wpf.Tests.csproj, MdixHelper, PackIcon, PopupBox, RatingBar, SnackbarMessageQueue, TextBlock, TextBox, Theme and Transitioner tests.

* Updates test framework and fixes assertions

Updates test framework from Fact to Test.

Updates tests to use Assert.That for improved readability and consistency.

* Reverting stupid

* Save point

* Assert.True

* Updates tests to be async

Updates tests to be async to prevent possible deadlocks and improve reliability.

* Removes TUnit dependencies from tests

Removes the TUnit library and associated code from test projects, modernizing testing using the default testing framework.

* Tests are now compiling

* Updates test framework for DecimalUpDown

Converts the DecimalUpDown test to use the `Arguments` attribute and updates assertions to improve reliability and clarity.

* Fixing member data sources

Updates TimePicker unit tests to use MethodDataSource with Func to prevent test data from being eagerly evaluated, resolving issues with the test framework.

* Refactors code for brevity and adds tests

Updates collection initialization to use more concise syntax.
Adds tests for the ButtonProgressAssist, CheckBoxAssist, ColorPicker, and DataGridAssist classes.
Adds a new test executor and removes redundant STAThreadExecutor attributes.
Adds NotInParallel attribute to CalendarFormatInfoTests and DialogHostTests.
Refactors the PreviewIndicatorTransformXConverter and PreviewIndicatorTransformYConverter.

* Updates screenshot artifact path

Updates the path for screenshot artifacts to target the .NET 9 framework.

* Fixes artifact upload path

Corrects the artifact upload path in the build workflow.

* Updates coordinate assertion method

Uses IsCloseTo method for asserting coordinate proximity in UI tests for ComboBoxes, DatePickers, PasswordBoxes, and TextBoxes.
This improves the accuracy and reliability of the tests by checking if the coordinates are within a specified tolerance range.

* Updates NuGet package versions

Updates several NuGet package versions, including Microsoft.NET.Test.Sdk, TUnit, and XAMLTest.

Fixes a potential issue in a test case by using CancellationToken.None instead of TestContext.Current!.CancellationToken

* Fixes UI test failures

Corrects failing UI tests by adjusting assertions and adding exception handling.

The fixes improve the stability and reliability of the UI test suite.

* Fixes combo box test assertion

Updates test assertion to expect a null text value when a combo box is uninitialized.
This corrects the expected behavior of the test.

* Updates artifact path for .NET 9

Updates the artifact upload path in the build workflow to correctly target the .NET 9 framework.
This resolves an issue where artifacts were not being correctly uploaded due to an incorrect target framework name.

* Adds success recorder in auto suggest box tests

* Skips flaky GetDialogSession test

* Skips failing saturation drag test

Skips a ColorPicker test that was failing before the move to Machine.Time.Past due to timing issues in the while loop.

* Ensures DialogHost is properly unloaded

Introduces a `ControlHost` class to ensure the `DialogHost` is properly unloaded when the test is complete.
This prevents orphaned `DialogHost` instances from interfering with subsequent tests.
@Keboo
Copy link
Member

Keboo commented Jun 27, 2025

Soerry for the delay on this. I think a better implementation would be to create a secondary style and/or control template for the TabControl that implements it with the WrapPanel. The default WPF behavior contradicts the material design behavior, so we want the current (horizontal scroll behavior) to be the default, but in cases like this we have often put in secondary styles that people can set if they want a different behavior.

@Keboo Keboo self-requested a review June 27, 2025 06:26
corvinsz and others added 2 commits June 26, 2025 23:35
* Modified the Template of the TabItem
-change the Cursor on hover
-implement a "hover" effect

* added new TabAssist.TabHeaderCursor attached property
…3878)

Makes the `BindableIsItemsHost` attached property public, allowing external access and usage.

Fixes: MaterialDesignInXAML#3685
@Keboo Keboo modified the milestones: 5.3.0, 5.3.1 Jun 27, 2025
Keboo and others added 18 commits July 13, 2025 19:24
Updates NuGet packages to embed an icon, instead of referencing an icon URL.

This change improves the NuGet package display and provides a more consistent user experience.
It removes the need to download the icon separately and ensures the icon is always available, even if the URL becomes invalid.
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Wait for the animations to have some time to run before moving focus to the dialog. this prevents focus jumps on fast double clicks

Fixes MaterialDesignInXAML#2912
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Reverts bad change to the nuspec
…alDesignInXAML#3910)

* Initial plan

* Add comprehensive Copilot instructions for MaterialDesignInXamlToolkit

Co-authored-by: Keboo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Keboo <[email protected]>
…es (MaterialDesignInXAML#3908)

* Initial plan

* Initial analysis and plan for migrating from nuget.exe to dotnet pack

Co-authored-by: Keboo <[email protected]>

* Migrate from nuget.exe to dotnet pack with MSBuild package properties

Co-authored-by: Keboo <[email protected]>

* Refactor packaging properties to Directory.Build.props and remove unnecessary build step

Co-authored-by: Keboo <[email protected]>

* Remove empty Package Content sections from project files

Co-authored-by: Keboo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Keboo <[email protected]>
Changes the NuGet package creation to output to the current directory
instead of the default location.

This resolves issues with the build script not finding the created
packages in the expected location.

Removes unused Azure pipeline YAML file.
…kness TemplateBindings and CornerRadius Dependency to SnackBar (MaterialDesignInXAML#3888)

* Fix: Add TemplateBindings to BorderBrush and BorderThickness

* Add CornerRadius dependency to SnackBar and TemplateBinding
…nXAML#3913)

* feat: add hint-text as AutomationProperty to the ComboBox by default so it can be picked up by a screen reader

* feat: add hint-text as AutomationProperty to all input-controls by default so it can be picked up by a screen reader
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 5.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Removed two example links from the README.
…#3919)

* added hovering halo for checkbox

* added hovering halo for radioButton and constant (InteractionHoverOpacity) for hover opacity
…AML#3915)

* update SmartHint.IsContentNullOrEmpty on initial load

* added test case
Background="{TemplateBinding wpf:ColorZoneAssist.Background}"
DockPanel.Dock="Top"
Focusable="False">
<Grid>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than this grid with both sets of controls. What if we apply a style trigger to the ColorZone and swap out its child content based on the AP?

MohammadHadi2031 and others added 12 commits September 26, 2025 15:57
* Implement GridView support for having columns

* clean up

* automatically add toggle button to first column

* clean up

* fix style issues

---------

Co-authored-by: MohammadHadi Attarieh <[email protected]>
…gnInXAML#3930)

* Prefer TemplateBinding over Binding with RelativeSource

* Updates Expander control template

Changes `ContentSite` border to be unnamed and binds `ExpandDirection` directly from the `TemplateBinding`.

---------

Co-authored-by: Kevin Bost <[email protected]>
* Remove white rectangle from Template and apply visual state to gray out CalendarDayButton

* Make test mor resilient by only caring about IsExpanded on items with children.

* set Opacity of the Year TextBlock when Calendar is disabled

---------

Co-authored-by: Kevin Bost <[email protected]>
…signInXAML#3934)

* Add simple issue repro to Home page

* WIP on fix.

Scroll position is now synced correctly, but the visibility property still needs to be respected properly.

* TextBox.HorizontalScrollBarVisibility is now respected

* Add null guards and possibly not-needed method SizeChanged() invoke

* Remove not needed invocation and null forgiving operators

* Place custom scrollbar correctly using converters

* Cleanup

* Take hover/focus state into account + ignore margins on hidden elements

* Only consider hover/focus when style is outlined

* Removing simple repro from Home page

* Update demo app with TextBox.TextWrapping option on Field page

* Fix initial state of custom ScrollBar

* Renames property for clarity.

Renames `isOutlinedStyle` to `hasOutlinedTextField` in `TextBoxHorizontalScrollBarMarginConverter` for better clarity and consistency.

* Improves UI test reliability

Adds retry logic to clear button click in date picker test; captures a screenshot of the split button popup during UI test.

* Moved converters into "internal" namespace

* Moved behavior into new "internals" namespace for behaviors

---------

Co-authored-by: Kevin Bost <[email protected]>
Updates the base versions for mdix, mdix-colors, and mdix-mahapps to 5.3.1.

Sets the GH_TOKEN environment variable for the "Open Pull Request" step in the release workflow.
…terialDesignInXAML#3940)

* Bump fastify/github-action-merge-dependabot from 3.11.1 to 3.11.2

Bumps [fastify/github-action-merge-dependabot](https://github.com/fastify/github-action-merge-dependabot) from 3.11.1 to 3.11.2.
- [Release notes](https://github.com/fastify/github-action-merge-dependabot/releases)
- [Commits](fastify/github-action-merge-dependabot@v3.11.1...v3.11.2)

---
updated-dependencies:
- dependency-name: fastify/github-action-merge-dependabot
  dependency-version: 3.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Waits for context menu to open in test

Wraps context menu right-click and element retrieval in a wait condition that checks if the context menu is open.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Bost <[email protected]>
…aterialDesignInXAML#3920)

* Porting material-color-utilities to dotnet MaterialDesignInXAML#2475

Backporting to .NET 462

* Implementing unit tests for MaterialColorUtilities

* Making enum values PascalCase and using explicit types where not obvious

* Modernizes test code syntax

Uses collection expressions and generic `Enum.GetValues`, suppresses obsolete member warnings, and removes an unnecessary assertion.

---------

Co-authored-by: Johann Dirry <[email protected]>
Co-authored-by: Kevin Bost <[email protected]>
…on requirements (MaterialDesignInXAML#3948)

* Initial plan

* Clarify .NET version requirements in Copilot instructions

Co-authored-by: Keboo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Keboo <[email protected]>
…nXAML#3936)

Modified padding, added cursor, and updated vertical alignment.
…nd `WrappingTabControlTemplate` have their own ControlTemplate
@corvinsz
Copy link
Member Author

I'm going to create a new PR for this. The rebase was a little much

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.

TabItem in two rows

8 participants