Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit bb6b28b

Browse files
author
Alexander Witkowski
committed
Add remove border effect implementation for uwp
Align to code style Remove comment Fixed namespace Fix using When you only commit half of your changes 🤦‍♂️
1 parent 6e6a28f commit bb6b28b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Windows.UI.Xaml;
2+
using Windows.UI.Xaml.Controls;
3+
using Xamarin.CommunityToolkit.Effects;
4+
using Xamarin.Forms.Platform.UWP;
5+
using Effects = Xamarin.CommunityToolkit.UWP.Effects;
6+
7+
[assembly: Xamarin.Forms.ExportEffect(typeof(Effects.RemoveBorderEffect), nameof(RemoveBorderEffect))]
8+
9+
namespace Xamarin.CommunityToolkit.UWP.Effects
10+
{
11+
public class RemoveBorderEffect : PlatformEffect
12+
{
13+
Thickness oldBorderThickness;
14+
15+
protected override void OnAttached()
16+
{
17+
if (Control is Control uwpControl)
18+
{
19+
oldBorderThickness = uwpControl.BorderThickness;
20+
uwpControl.BorderThickness = new Thickness(0.0);
21+
}
22+
}
23+
24+
protected override void OnDetached()
25+
{
26+
if (Control is Control uwpControl)
27+
{
28+
uwpControl.BorderThickness = oldBorderThickness;
29+
}
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)