Skip to content

Commit 115efed

Browse files
Apply fix to the MaterialNavigationDrawer
1 parent be64db0 commit 115efed

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

nuget.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup Condition=" $(MSBuildProjectName.Equals('HorusStudio.Maui.MaterialDesignControls')) ">
33
<PackageId>HorusStudio.Maui.MaterialDesignControls</PackageId>
4-
<Version>10.0.0</Version>
4+
<Version>10.0.1</Version>
55
<Authors>Horus Studio and contributors</Authors>
66
<Company>Horus Studio</Company>
77
<Title>Material Design Controls for .NET MAUI</Title>
@@ -15,7 +15,7 @@
1515
<PackageTags>dotnet-maui;dotnet;maui;cross-platform;android;ios;macos;maccatalyst;materialdesign;ui</PackageTags>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
1717
<PackageReleaseNotes>
18-
- Add net10.0 support
18+
- Add independent LabelColor support for NavigationDrawer items
1919
</PackageReleaseNotes>
2020
<PackageOutputPath>$(MSBuildThisFileDirectory)Artifacts</PackageOutputPath>
2121
<EscapedCurrentDirectory>$([System.Text.RegularExpressions.Regex]::Escape('$(MSBuildThisFileDirectory)'))</EscapedCurrentDirectory>

samples/HorusStudio.Maui.MaterialDesignControls.Sample/ViewModels/NavigationDrawerViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ private void LoadItems(bool includeAllItems)
9999
SelectedLeadingIcon = "trash.png",
100100
LeadingIcon = "trash.png",
101101
Text = "Trash",
102-
LabelColor = Colors.Red
102+
LabelColor = Colors.Red,
103+
ActiveIndicatorLabelColor = Colors.Red
103104
},
104105
new()
105106
{

src/HorusStudio.Maui.MaterialDesignControls/Controls/NavigationDrawer/MaterialNavigationDrawer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,8 @@ private void SetLabelTextColorPropertyBindings(MaterialLabel label, MaterialNavi
11661166
var drawerActiveIndicatorLabelColor = (Color)values[2];
11671167
var drawerLabelColor = (Color)values[3];
11681168
var disabledLabelColor = (Color)values[4];
1169-
var itemLabelColor = values[5] as Color?;
1170-
var itemActiveIndicatorLabelColor = values[6] as Color?;
1169+
var itemLabelColor = (Color?)values[5];
1170+
var itemActiveIndicatorLabelColor = (Color?)values[6];
11711171

11721172
// If item has its own LabelColor, use it instead of drawer's LabelColor
11731173
var labelColor = itemLabelColor ?? drawerLabelColor;
@@ -1201,8 +1201,8 @@ private void SetIconTintColorPropertyBindings(IconTintColorBehavior iconTintColo
12011201
var drawerActiveIndicatorLabelColor = (Color)values[2];
12021202
var drawerLabelColor = (Color)values[3];
12031203
var disabledLabelColor = (Color)values[4];
1204-
var itemLabelColor = values[5] as Color?;
1205-
var itemActiveIndicatorLabelColor = values[6] as Color?;
1204+
var itemLabelColor = (Color?)values[5];
1205+
var itemActiveIndicatorLabelColor = (Color?)values[6];
12061206

12071207
// If item has its own LabelColor, use it instead of drawer's LabelColor
12081208
var labelColor = itemLabelColor ?? drawerLabelColor;

0 commit comments

Comments
 (0)