forked from AvaloniaUI/Avalonia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AvaloniaUI#7484 from wieslawsoltes/ClippingPageXam…
…lOnly [RenderDemo] Set Border clip from xaml on ClippingPage
- Loading branch information
1 parent
039fa5b
commit 256bba5
Showing
2 changed files
with
30 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,18 @@ | ||
using System; | ||
using System.Reactive.Linq; | ||
using Avalonia; | ||
using Avalonia.Animation; | ||
using Avalonia.Controls; | ||
using Avalonia.Data; | ||
using Avalonia.Markup.Xaml; | ||
using Avalonia.Media; | ||
|
||
namespace RenderDemo.Pages | ||
{ | ||
public class ClippingPage : UserControl | ||
{ | ||
private Geometry _clip; | ||
|
||
public ClippingPage() | ||
{ | ||
InitializeComponent(); | ||
WireUpCheckbox(); | ||
} | ||
|
||
private void InitializeComponent() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
private void WireUpCheckbox() | ||
{ | ||
var useMask = this.FindControl<CheckBox>("useMask"); | ||
var clipped = this.FindControl<Border>("clipped"); | ||
_clip = clipped.Clip; | ||
useMask.Click += (s, e) => clipped.Clip = clipped.Clip == null ? _clip : null; | ||
} | ||
} | ||
} |