/
SwipeItem.cs
35 lines (28 loc) · 1005 Bytes
/
SwipeItem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.ComponentModel;
namespace Xamarin.Forms
{
public class SwipeItem : MenuItem, ISwipeItem
{
public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(SwipeItem), Color.Default);
public static readonly BindableProperty IsVisibleProperty = BindableProperty.Create(nameof(IsVisible), typeof(bool), typeof(SwipeItem), true);
public Color BackgroundColor
{
get { return (Color)GetValue(BackgroundColorProperty); }
set { SetValue(BackgroundColorProperty, value); }
}
public bool IsVisible
{
get { return (bool)GetValue(IsVisibleProperty); }
set { SetValue(IsVisibleProperty, value); }
}
public event EventHandler<EventArgs> Invoked;
[EditorBrowsable(EditorBrowsableState.Never)]
public void OnInvoked()
{
if (Command != null && Command.CanExecute(CommandParameter))
Command.Execute(CommandParameter);
Invoked?.Invoke(this, EventArgs.Empty);
}
}
}