Skip to content

Commit

Permalink
Merge pull request #11162 from Youssef1313/elevatedview-cornerradius
Browse files Browse the repository at this point in the history
fix!: `ElevatedView` shouldn't have CornerRadius as it exists in the base Control class.
  • Loading branch information
MartinZikmund authored Feb 3, 2023
2 parents 73417f5 + e782b0b commit 2a96342
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
5 changes: 5 additions & 0 deletions build/PackageDiffIgnore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9215,6 +9215,8 @@
<Member fullName="Microsoft.UI.Xaml.DependencyProperty Microsoft.UI.Xaml.Media.RevealBrush::AlwaysUseFallbackProperty()" reason="Not present in WinAppSDK 1.2" />
<Member fullName="Microsoft.UI.Xaml.DependencyProperty Microsoft.UI.Xaml.Media.RevealBrush::StateProperty()" reason="Not present in WinAppSDK 1.2" />
<Member fullName="Microsoft.UI.Xaml.DependencyProperty Microsoft.UI.Xaml.Media.RevealBrush::TargetThemeProperty()" reason="Not present in WinAppSDK 1.2" />
<Member fullName="Windows.UI.Xaml.DependencyProperty Uno.UI.Toolkit.ElevatedView::CornerRadiusProperty()" reason="Already exists in Control and ElevatedView should not shadow it" />
<Member fullName="Windows.UI.Xaml.CornerRadius Uno.UI.Toolkit.ElevatedView::CornerRadius()" reason="Already exists in Control and ElevatedView should not shadow it" />
</Properties>
<Methods>
<Member fullName="Microsoft.UI.Windowing.AppWindowConfiguration Microsoft.UI.Windowing.AppWindow.get_Configuration()" reason="Not present in WinAppSDK 1.2" />
Expand Down Expand Up @@ -9378,6 +9380,9 @@
<Member fullName="Microsoft.UI.Xaml.DependencyProperty Microsoft.UI.Xaml.Media.RevealBrush.get_TargetThemeProperty()" reason="Not present in WinAppSDK 1.2" />
<Member fullName="System.Void Microsoft.UI.Xaml.Media.RevealBrush.SetState(Microsoft.UI.Xaml.UIElement element, Microsoft.UI.Xaml.Media.RevealBrushState value)" reason="Not present in WinAppSDK 1.2" />
<Member fullName="Microsoft.UI.Xaml.Media.RevealBrushState Microsoft.UI.Xaml.Media.RevealBrush.GetState(Microsoft.UI.Xaml.UIElement element)" reason="Not present in WinAppSDK 1.2" />
<Member fullName="Windows.UI.Xaml.CornerRadius Uno.UI.Toolkit.ElevatedView.get_CornerRadius()" reason="Already exists in Control and ElevatedView should not shadow it" />
<Member fullName="System.Void Uno.UI.Toolkit.ElevatedView.set_CornerRadius(Windows.UI.Xaml.CornerRadius value)" reason="Already exists in Control and ElevatedView should not shadow it" />
<Member fullName="Windows.UI.Xaml.DependencyProperty Uno.UI.Toolkit.ElevatedView.get_CornerRadiusProperty()" reason="Already exists in Control and ElevatedView should not shadow it" />
</Methods>
</IgnoreSet>

Expand Down
17 changes: 2 additions & 15 deletions src/Uno.UI.Toolkit/ElevatedView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,9 @@ public object ElevatedContent
set => SetValue(BackgroundProperty, value);
}

public new static DependencyProperty CornerRadiusProperty { get ; } = DependencyProperty.Register(
"CornerRadius",
typeof(CornerRadius),
typeof(ElevatedView),
#if __IOS__ || __MACOS__
new FrameworkPropertyMetadata(default(CornerRadius))
#else
new FrameworkPropertyMetadata(default(CornerRadius), OnChanged)
#if !__IOS__ && !__MACOS__
private protected override void OnCornerRadiousChanged(DependencyPropertyChangedEventArgs args) => OnChanged(this, args);
#endif
);

public new CornerRadius CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusProperty);
set => SetValue(CornerRadiusProperty, value);
}

protected internal override void OnTemplatedParentChanged(DependencyPropertyChangedEventArgs e)
{
Expand Down
7 changes: 6 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/Control/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,14 @@ public CornerRadius CornerRadius

public static CornerRadius GetCornerRadiusDefaultValue() => default(CornerRadius);

[GeneratedDependencyProperty]
[GeneratedDependencyProperty(ChangedCallbackName = nameof(OnCornerRadiousChanged))]
public static DependencyProperty CornerRadiusProperty { get; } = CreateCornerRadiusProperty();

private protected virtual void OnCornerRadiousChanged(DependencyPropertyChangedEventArgs args)
{
}


#endregion

#if HAS_UNO_WINUI
Expand Down

0 comments on commit 2a96342

Please sign in to comment.