first step

This commit is contained in:
gaoyuan
2022-03-02 22:29:13 +08:00
parent 51f8e4f2e8
commit 9929eee056
17 changed files with 343 additions and 60 deletions

View File

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Xml.Linq;
using Billing.Languages;
using Billing.Models;
using Xamarin.Forms;
@ -77,6 +79,11 @@ namespace Billing.UI
Grid.SetRowSpan(view, rowSpan);
return view;
}
public static async Task ShowMessage(this Page page, string message, string title = null)
{
await page.DisplayAlert(title ?? page.Title, message, Resource.Ok);
}
}
public static class ModelExtensionHelper

View File

@ -155,7 +155,8 @@ namespace Billing.UI
itemHeight = rowHeight;
}
var rect = new Rectangle(0, lastHeight, width, itemHeight);
item.Layout(rect);
//item.Layout(rect);
LayoutChildIntoBoundingRegion(item, rect);
lastHeight += itemHeight + spacing;
}
}

View File

@ -245,7 +245,7 @@ namespace Billing.UI
HorizontalOptions = LayoutOptions.End,
VerticalOptions = LayoutOptions.Center
}
.Binding(Switch.IsToggledProperty, nameof(IsToggled), BindingMode.TwoWay);
.Binding(Switch.IsToggledProperty, nameof(IsToggled), mode: BindingMode.TwoWay);
}
public class OptionEntryCell : OptionCell
@ -283,7 +283,7 @@ namespace Billing.UI
VerticalOptions = LayoutOptions.Center,
ReturnType = ReturnType.Next
}
.Binding(Entry.TextProperty, nameof(Text), BindingMode.TwoWay)
.Binding(Entry.TextProperty, nameof(Text), mode: BindingMode.TwoWay)
.Binding(InputView.KeyboardProperty, nameof(Keyboard))
.Binding(Entry.PlaceholderProperty, nameof(Placeholder))
.DynamicResource(Entry.TextColorProperty, BaseTheme.TextColor)
@ -334,7 +334,7 @@ namespace Billing.UI
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Fill
}
.Binding(Editor.TextProperty, nameof(Text), BindingMode.TwoWay)
.Binding(Editor.TextProperty, nameof(Text), mode: BindingMode.TwoWay)
.Binding(Editor.FontSizeProperty, nameof(FontSize))
.Binding(InputView.KeyboardProperty, nameof(Keyboard))
.Binding(Editor.PlaceholderProperty, nameof(Placeholder))