Adding final project to dev branch
This commit is contained in:
51
WguApp/Controls/CustomButton.xaml.cs
Normal file
51
WguApp/Controls/CustomButton.xaml.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user