зеркало из https://github.com/DeGsoft/maui-linux.git
* [UWP] Fixes of calculation of heights in the MasterDetailPage * addressing comments
This commit is contained in:
Родитель
a7b4a47396
Коммит
1fe23fff8e
|
@ -0,0 +1,63 @@
|
|||
using Xamarin.Forms.CustomAttributes;
|
||||
using Xamarin.Forms.Internals;
|
||||
|
||||
#if UITEST
|
||||
using Xamarin.UITest;
|
||||
using NUnit.Framework;
|
||||
#endif
|
||||
|
||||
namespace Xamarin.Forms.Controls.Issues
|
||||
{
|
||||
[Preserve(AllMembers = true)]
|
||||
[Issue(IssueTracker.Github, 1648, "MasterDetailPage throws ArgumentOutOfRangeException", PlatformAffected.UWP)]
|
||||
public class GitHub1648 : TestNavigationPage
|
||||
{
|
||||
protected override void Init()
|
||||
{
|
||||
Navigation.PushAsync(new MasterDetailPage
|
||||
{
|
||||
Master = new NavigationPage(new ContentPage())
|
||||
{
|
||||
Title = "Master"
|
||||
},
|
||||
Detail = new ContentPage(),
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
Navigation.PushModalAsync(new SimplePage());
|
||||
}
|
||||
|
||||
class SimplePage : ContentPage
|
||||
{
|
||||
public SimplePage ()
|
||||
{
|
||||
Content = new StackLayout()
|
||||
{
|
||||
Children = {
|
||||
new Label {
|
||||
Text = "Success"
|
||||
},
|
||||
new Button
|
||||
{
|
||||
Text = "Reload",
|
||||
Command = new Command(() => Navigation.PopModalAsync())
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#if UITEST
|
||||
[Test]
|
||||
public void GitHub1648Test()
|
||||
{
|
||||
RunningApp.WaitForElement("Reload");
|
||||
RunningApp.Tap("Reload");
|
||||
RunningApp.WaitForElement("Success");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -243,6 +243,7 @@
|
|||
<Compile Include="$(MSBuildThisFileDirectory)Effects\AttachedStateEffect.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Effects\AttachedStateEffectLabel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Effects\AttachedStateEffectList.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)GitHub1648.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)GitHub1702.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)GitHub2598.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue1483.cs" />
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
width -= _masterPresenter.ActualWidth;
|
||||
}
|
||||
|
||||
return new Windows.Foundation.Size(width >= 0 ? width : 0, height);
|
||||
return new Windows.Foundation.Size(Math.Max(width, 0), Math.Max(height, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
else if (_masterPresenter != null)
|
||||
width = _masterPresenter.ActualWidth;
|
||||
|
||||
return new Windows.Foundation.Size(width, height);
|
||||
return new Windows.Foundation.Size(Math.Max(width, 0), Math.Max(height, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче