Skip to content

DialogHost API revamp #3841

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

Draft
wants to merge 77 commits into
base: master
Choose a base branch
from

Conversation

corvinsz
Copy link
Member

Initially I "just" wanted to implement a fullscreen dialog, but I asked myself "why stop here?"

Here are a few thoughts/changes to explain this PR:

  • To not clutter the existing Show methods even more I opted to implement a new class called DialogOptions, to have this option-based configuration-style
  • DialogOptions has alot of Previous<some property> properties, to keep it as compatible with the old Show methods. The way this works is by storing the corresponding property before setting it to something different, then show the dialog, and then revert all the properties to the previously stored value. While the old and new API could be used interchangingly, it is probably a good idea to just stick with one of the two.
  • I added a default CloseButton (PART_CloseButton) to the template
  • I added a new interface IDialogService. We already have an abstraction for the Snackbar (ISnackbarMessageQueue), but not (yet) for the DialogHost
  • Also I replaced alot of code with syntactic sugar or newer syntaxes

There are 2 things I want to publicly address

  1. What other Show methods should we add to the IDialogService?
  2. I for the life of me can't figure out why the dialog is not sizing to fullscreen if I press the maximize button. I have been trying to figure this out for hours now without any luck:
    fullscreenDialogProblem

There are still some ToDos left, but I wanted to share this publicly now so any ideas or recommendations can be incorporated.

If all of this is total nonsense, lmk 😆

Corvin Szimion and others added 30 commits October 24, 2024 10:55
-adjust the Popups size depending on the "isFullscreenDialog"
-removed "IsFullscreenDialog" from old "Show" API
-added new generic "Show" API which accepts DialogOptions
-added Apply and Revert methods for DialogOptions
…width of the dialog can be restored correctly
nicolaihenriksen and others added 30 commits June 7, 2025 22:32
…ing-value conversions (MaterialDesignInXAML#3865)

* Consume new XAMLTest and ensure tests execute

* Data-drive the (basic) DecimalUpDown test to verify culture-differences

* Add net9.0 in the pipeline workflow
* ToggleButton uses EllipseClipConverter

* EllipseClipConverter: Changed to file-scoped namespace
…top will shrink the content MaterialDesignInXAML#3640 (MaterialDesignInXAML#3875)

Related Work Items: MaterialDesignInXAML#3

Co-authored-by: MohammadHadi Attarieh <mhadi.atttarieh@gmail.com>
* 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.
* 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
-adjust the Popups size depending on the "isFullscreenDialog"
-removed "IsFullscreenDialog" from old "Show" API
-added new generic "Show" API which accepts DialogOptions
-added Apply and Revert methods for DialogOptions
…width of the dialog can be restored correctly
-make new Show method non-generic
-added IDialogService interface
-modified obsolete message
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.

7 participants