basic logic

This commit is contained in:
2022-02-25 12:20:16 +08:00
parent abeae1cab9
commit 9a6011c3d8
49 changed files with 773 additions and 73 deletions

View File

@ -1,4 +1,7 @@
namespace Billing.UI;
using System;
using Xamarin.Forms;
namespace Billing.UI;
public static partial class Definition
{
@ -7,3 +10,59 @@ public static partial class Definition
public static partial string GetRobotoCondensedRegularFontFamily();
public static partial string GetRobotoCondensedBoldFontFamily();
}
public static class ExtensionHelper
{
public static View Binding(this View view, BindableProperty property, string path, BindingMode mode = BindingMode.Default, IValueConverter converter = null)
{
view.SetBinding(property, path, mode, converter);
return view;
}
public static View DynamicResource(this View view, BindableProperty property, string key)
{
view.SetDynamicResource(property, key);
return view;
}
public static View GridColumn(this View view, int column)
{
Grid.SetColumn(view, column);
return view;
}
public static View GridRow(this View view, int row)
{
Grid.SetRow(view, row);
return view;
}
}
public class Tap : IDisposable
{
private readonly static object sync = new();
private static Tap instance;
private bool busy = false;
private Tap() { }
public static bool IsBusy => instance?.busy ?? false;
public static Tap Start()
{
lock (sync)
{
(instance ??= new Tap()).busy = true;
}
return instance;
}
public void Dispose()
{
lock (sync)
{
busy = false;
}
}
}