The Wayback Machine - https://web.archive.org/web/20201124160612/https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/pull/2142
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

Properly set ItemContainerStyle for ListBox #922 #2142

Merged

Conversation

@TysonMN
Copy link
Contributor

@TysonMN TysonMN commented Oct 20, 2020

Fixes #922

One can check that the issue described in #922 does not exist when using ListView in place of ListBox. I compared the default styles set by MDinXAML for ListBox and ListView. I concluded that the problem does not exist for ListView because it sets the ItemContainerStyle property while ListBox does not. That property setter uses a converter, which makes things a bit more complicated, but in the cases I tested, the converter always returned the style with key MaterialDesignListBoxItem, which is the default style set by MDinXAML for ListBoxItem.

This PR sets the ItemContainerStyle property to the style with key MaterialDesignListBoxItem on the default style for ListBox. I verified locally that this fixes #922.

I am willing to also add a test for this if someone can provide me a bit of assistance by showing me what such a test should look like.

@Keboo
Keboo approved these changes Oct 30, 2020
@Keboo Keboo added this to the 4.0.0 milestone Oct 30, 2020
@Keboo Keboo merged commit 7253d0f into MaterialDesignInXAML:master Oct 30, 2020
1 check passed
1 check passed
MaterialDesignInXAML.MaterialDesignInXamlToolkit Build #20201020.5 succeeded
Details
@TysonMN TysonMN deleted the TysonMN:fix_922_set_ItemContainerStyle branch Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.