Merge branch '3.1.0'
This commit is contained in:
Коммит
fda8a08528
|
@ -721,12 +721,12 @@ namespace Xamarin.Flex
|
|||
float spacing = 0;
|
||||
if (layout.flex_grows == 0 && layout.flex_dim > 0) {
|
||||
layout_align(item.JustifyContent, layout.flex_dim, children_count, ref pos, ref spacing);
|
||||
|
||||
if (layout.reverse) {
|
||||
pos = layout.size_dim - pos;
|
||||
}
|
||||
}
|
||||
|
||||
if (layout.reverse)
|
||||
pos = layout.size_dim - pos;
|
||||
|
||||
|
||||
if (layout.reverse) {
|
||||
pos -= layout.vertical ? item.PaddingBottom : item.PaddingRight;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@ namespace Xamarin.Forms.Core.XamlC
|
|||
var parts = value.Split('.');
|
||||
if (parts.Length == 1 || (parts.Length == 2 && parts [0] == "Color")) {
|
||||
var color = parts [parts.Length - 1];
|
||||
|
||||
if (color == "lightgrey")
|
||||
color = "lightgray";
|
||||
var fieldReference = module.ImportFieldReference(("Xamarin.Forms.Core", "Xamarin.Forms", "Color"),
|
||||
color,
|
||||
isStatic: true,
|
||||
|
|
|
@ -404,5 +404,28 @@ namespace Xamarin.Forms.Core.UnitTests
|
|||
Assert.That(label1.Bounds, Is.EqualTo(new Rectangle(156, 6, 138, 20)));
|
||||
Assert.That(label2.Bounds, Is.EqualTo(new Rectangle(0, 32, 300, 20)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
//https://github.com/xamarin/Xamarin.Forms/issues/2551
|
||||
public void TestReverseWithGrow()
|
||||
{
|
||||
var platform = new UnitPlatform();
|
||||
var label0 = new Label {
|
||||
Platform = platform,
|
||||
IsPlatformEnabled = true,
|
||||
};
|
||||
FlexLayout.SetGrow(label0, 1);
|
||||
var layout = new FlexLayout {
|
||||
Platform = platform,
|
||||
IsPlatformEnabled = true,
|
||||
Direction = FlexDirection.ColumnReverse,
|
||||
Children = {
|
||||
label0,
|
||||
}
|
||||
};
|
||||
|
||||
layout.Layout(new Rectangle(0, 0, 300, 300));
|
||||
Assert.That(label0.Bounds, Is.EqualTo(new Rectangle(0, 0, 300, 300)));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -156,6 +156,7 @@ namespace Xamarin.Forms
|
|||
case "lightcoral": return Color.LightCoral;
|
||||
case "lightcyan": return Color.LightCyan;
|
||||
case "lightgoldenrodyellow": return Color.LightGoldenrodYellow;
|
||||
case "lightgrey":
|
||||
case "lightgray": return Color.LightGray;
|
||||
case "lightgreen": return Color.LightGreen;
|
||||
case "lightpink": return Color.LightPink;
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
public class AlertDialog : ContentDialog
|
||||
{
|
||||
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
// The child template name is derived from the default style
|
||||
// https://msdn.microsoft.com/en-us/library/windows/apps/mt299120.aspx
|
||||
var scrollName = "ContentScrollViewer";
|
||||
if (GetTemplateChild(scrollName) is ScrollViewer contentScrollViewer)
|
||||
contentScrollViewer.VerticalScrollBarVisibility = VerticalScrollBarVisibility;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -91,10 +91,11 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
string content = options.Message ?? string.Empty;
|
||||
string title = options.Title ?? string.Empty;
|
||||
|
||||
var alertDialog = new ContentDialog
|
||||
var alertDialog = new AlertDialog
|
||||
{
|
||||
Content = content,
|
||||
Title = title
|
||||
Title = title,
|
||||
VerticalScrollBarVisibility = ScrollBarVisibility.Auto
|
||||
};
|
||||
|
||||
if (options.Cancel != null)
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
public class TableViewRenderer : ViewRenderer<TableView, Windows.UI.Xaml.Controls.ListView>
|
||||
{
|
||||
bool _ignoreSelectionEvent;
|
||||
bool _disposed;
|
||||
|
||||
public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
|
||||
{
|
||||
|
@ -47,6 +48,19 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
base.OnElementChanged(e);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && !_disposed)
|
||||
{
|
||||
_disposed = true;
|
||||
if(Control != null)
|
||||
{
|
||||
Control.SelectionChanged -= OnSelectionChanged;
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
void OnModelChanged(object sender, EventArgs e)
|
||||
{
|
||||
Control.Header = Element.Root;
|
||||
|
@ -64,8 +78,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
{
|
||||
foreach (object item in e.AddedItems)
|
||||
{
|
||||
var cell = item as Cell;
|
||||
if (cell != null)
|
||||
if (item is Cell cell)
|
||||
{
|
||||
if (cell.IsEnabled)
|
||||
Element.Model.RowSelected(cell);
|
||||
|
@ -74,6 +87,9 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
}
|
||||
}
|
||||
|
||||
if (Control == null)
|
||||
return;
|
||||
|
||||
Control.SelectedItem = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="ColorExtensions.cs" />
|
||||
<Compile Include="FormsCancelButton.cs" />
|
||||
<Compile Include="AlertDialog.cs" />
|
||||
<Compile Include="FormsPivot.cs" />
|
||||
<Compile Include="AlignmentExtensions.cs" />
|
||||
<Compile Include="BrushHelpers.cs" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче