51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WguApp.Controls;
|
|
|
|
public partial class CustomButton : ContentView
|
|
{
|
|
|
|
public event EventHandler? Clicked;
|
|
|
|
public static readonly BindableProperty TextProperty =
|
|
BindableProperty.Create(
|
|
propertyName: nameof(Text),
|
|
returnType: typeof(string),
|
|
declaringType: typeof(CustomButton),
|
|
defaultValue: "Text",
|
|
defaultBindingMode: BindingMode.OneWay);
|
|
|
|
public static readonly BindableProperty DateTextProperty =
|
|
BindableProperty.Create(
|
|
propertyName: nameof(DateText),
|
|
returnType: typeof(string),
|
|
declaringType: typeof(CustomButton),
|
|
defaultValue: "//",
|
|
defaultBindingMode: BindingMode.OneWay);
|
|
|
|
public string Text
|
|
{
|
|
get => (string)GetValue(TextProperty);
|
|
set => SetValue(TextProperty, value);
|
|
}
|
|
|
|
public string DateText
|
|
{
|
|
get => (string)GetValue(DateTextProperty);
|
|
set => SetValue(DateTextProperty, value);
|
|
}
|
|
|
|
public CustomButton()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void TapGestureRecognizer_OnTapped(object? sender, TappedEventArgs e)
|
|
{
|
|
Clicked?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
} |