5.0.0 Migration Guide #3466
Replies: 6 comments 7 replies
-
Hello, how can i change the height of textbox outline ? |
Beta Was this translation helpful? Give feedback.
-
Hi, regarding ShadowAssist.ShadowEdges, I'm getting an error that it doesn't exist, what name was it changed to? |
Beta Was this translation helpful? Give feedback.
-
hi, What is the best way to access these PrimaryXXX colors in version 5? |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply. I migrated to version 5 and in some parts of the code I used Static Resource PrimaryXXX colors that do not exist now. If I add What is the best way to access these PrimaryXXX colors in version 5? my App.xaml: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi, I'm updating from 4.9 to 5.1 and there's a converter called |
Beta Was this translation helpful? Give feedback.
-
This is a living document that is expected to be a guide for updating from 4.9.0 to 5.0.0. All feedback is welcome here, however if you are running into a specific issue with the migration, please open a new issue rather than commenting here.
This will cover the most common upgrade issues. You can find a list of breaking changes on issue: #2255.
Anything that was previously marked as Obsolete in the 4.9.0 or earlier release has been removed.
Main Defaults Resource Dictionary Renamed
Because we are still supporting both Material Design 2 and Material Design 3 styles, the previous
MaterialDesignTheme.Defaults.xaml
resource dictionary has been replaced withMaterialDesign2.Defaults.xaml
andMaterialDesign3.Defaults.xaml
. In your main App.xaml replace with one of those two dictionaries. If you want your app to still use the same previous look and feel, theMaterialDesign2.Defaults.xaml
resource dictionary most closely resembles the defaults from the 4.9.0 release.Brush Renames
To better facilitate the addition of new brushes as well as to make adjusting individual components, the library has adopted a new naming scheme for brush resources.
MaterialDesign.Brush.
prefix.MaterialDesign.Brush.<Primary|Secondary>.[Light|Dark]
. Corresponding foreground colors, will have a.Foreground
suffix added. For exampleMaterialDesign.Brush.Secondary.Light
orMaterialDesign.Brush.Primary.Foreground
.For anyone wishing to avoid needing to do the brush rename at the time of upgrade, there is an additional resource dictionary that you can include that maps the old brush resource names to the new names. This would typically get placed in the merged resource dictionary of your App.xaml.
Be aware that this should be considered a temporary solution to allow time to do the full migration. It is not expected to be maintained long term and is subject to have items removed from it on future releases.
There is also a migration script that can be run on your repository that will attempt to locate brush resources and update them. Be aware this only looks for
{StaticResource xxx}
and{DynamicResource xxx}
references for brushes. You can find the script in the repository hereSee #2435 for more additional details.
Style renames
To standardize on naming, all usages of "Accent" in the style keys were replaced with "Secondary". For many style keys, simply making this one change will appropriately update it.
For anyone wishing to avoid needing to do the style rename at the time of upgrade, there is an additional resource dictionary that you can include that maps the old styles keys to the new names. This would typically get placed in the merged resource dictionary of your App.xaml.
Be aware that this should be considered a temporary solution to allow time for you to do the full migration. It is not expected to be maintained long term and is subject to have items removed from it on future releases.
There is also a migration script that can be run on your repository that will attempt to locate style resources and update them. Be aware this only looks for
{StaticResource xxx}
and{DynamicResource xxx}
style references. You can find the script in the repository hereShadowAssist replaced by ElevationAssist
The ShadowAssist was previously marked as Obsolete in the 4.9.0 release and has been completely removed int he 5.0.0 release.
To fix any usages simply update from
ShadowAssist
toElevationAssist
andShadowDepth
toElevation
. The old values map to the new ones as follows:ShadowDepth.Depth0
=>Elevation.Dp0
ShadowDepth.Depth1
=>Elevation.Dp2
ShadowDepth.Depth2
=>Elevation.Dp3
orElevation.Dp4
ShadowDepth.Depth3
=>Elevation.Dp7
orElevation.Dp8
ShadowDepth.Depth4
=>Elevation.Dp12
orElevation.Dp16
ShadowDepth.Depth5
=>Elevation.Dp16
orElevation.Dp24
Code renames
All extension method classes have had their "Mixin" suffix replaced with an "Extensions" suffix. In most cases, this will be a transparent change, unless you are invoking the extension method directly as a static method.
Beta Was this translation helpful? Give feedback.
All reactions