first test-flight version
This commit is contained in:
@ -29,4 +29,35 @@ namespace Billing.UI
|
||||
LongPressed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public class LongPressGrid : Grid
|
||||
{
|
||||
public static readonly BindableProperty LongCommandProperty = BindableProperty.Create(nameof(LongCommand), typeof(Command), typeof(LongPressGrid));
|
||||
public static readonly BindableProperty LongCommandParameterProperty = BindableProperty.Create(nameof(LongCommandParameter), typeof(object), typeof(LongPressGrid));
|
||||
|
||||
public Command LongCommand
|
||||
{
|
||||
get => (Command)GetValue(LongCommandProperty);
|
||||
set => SetValue(LongCommandProperty, value);
|
||||
}
|
||||
public object LongCommandParameter
|
||||
{
|
||||
get => GetValue(LongCommandParameterProperty);
|
||||
set => SetValue(LongCommandParameterProperty, value);
|
||||
}
|
||||
|
||||
public void TriggerLongPress()
|
||||
{
|
||||
var command = LongCommand;
|
||||
if (command == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var parameter = LongCommandParameter;
|
||||
if (command.CanExecute(parameter))
|
||||
{
|
||||
command.Execute(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user