Skip to content

Commit 8972991

Browse files
Live stream review comment fix + primary constructor (#3611)
1 parent b3108ab commit 8972991

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/MaterialDesignThemes.Wpf/RatingBarButton.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace MaterialDesignThemes.Wpf;
22

3-
public class RatingBarButton : ButtonBase
3+
public class RatingBarButton(RatingBar ratingBar) : ButtonBase
44
{
55
static RatingBarButton()
66
{
@@ -21,12 +21,10 @@ public int Value
2121
internal set => SetValue(ValuePropertyKey, value);
2222
}
2323

24-
public RatingBar RatingBar { get; } = null!; // Null initializer added to suppress warning (for the obsoleted empty constructor)
25-
26-
public RatingBarButton(RatingBar ratingBar) => RatingBar = ratingBar;
24+
public RatingBar RatingBar { get; } = ratingBar;
2725

2826
// Only added the default constructor for back-compat. Ideally should not be used from MDIX consumers, but you never know.
2927
[Obsolete("Should not be used. Use the constructor taking a RatingBar instance as parameter instead. This constructor will be removed in a future version.")]
30-
public RatingBarButton()
28+
public RatingBarButton() : this(null!)
3129
{ }
3230
}

0 commit comments

Comments
 (0)