[create-pull-request] automated change (#19144)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Родитель
2ccac2d383
Коммит
32e300553e
|
@ -9,36 +9,37 @@ namespace Maui.Controls.Sample.Issues;
|
|||
[Issue(IssueTracker.Github, 18457, "Adding/Removing Pages From Removed TabbedPage Causes Crash")]
|
||||
public class Issue18457 : TestContentPage
|
||||
{
|
||||
bool pagePushed = false;
|
||||
TabbedPage _tabbedPage = new TabbedPage();
|
||||
bool pagePushed = false;
|
||||
TabbedPage _tabbedPage = new TabbedPage();
|
||||
protected override void Init()
|
||||
{
|
||||
_tabbedPage.Children.Add(new ContentPage() { Title = "tab 1"});
|
||||
_tabbedPage.Children.Add(new ContentPage() { Title = "tab 2"});
|
||||
_tabbedPage.Children.Add(new ContentPage() { Title = "tab 3"});
|
||||
_tabbedPage.Children.Add(new ContentPage() { Title = "tab 1" });
|
||||
_tabbedPage.Children.Add(new ContentPage() { Title = "tab 2" });
|
||||
_tabbedPage.Children.Add(new ContentPage() { Title = "tab 3" });
|
||||
}
|
||||
|
||||
protected override async void OnNavigatedTo(NavigatedToEventArgs args)
|
||||
{
|
||||
base.OnNavigatedTo(args);
|
||||
|
||||
if (!pagePushed)
|
||||
{
|
||||
pagePushed = true;
|
||||
await Navigation.PushAsync(_tabbedPage);
|
||||
await Navigation.PopAsync();
|
||||
_tabbedPage.Children.Add(new ContentPage());
|
||||
_tabbedPage.Children[0].Background = SolidColorBrush.Purple;
|
||||
_tabbedPage.Children[0].Title = "update title";
|
||||
_tabbedPage.Children[0].IconImageSource = "dotnet_bot.png";
|
||||
await Task.Yield();
|
||||
Content = new VerticalStackLayout(){
|
||||
Children =
|
||||
{
|
||||
new Label() { Text = "This test pushes and pops a TabbedPage, and then modifies the Children on the popped page."},
|
||||
new Label() { Text = "If the app doesn't crash, this test has passed.", AutomationId = "Success" }
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!pagePushed)
|
||||
{
|
||||
pagePushed = true;
|
||||
await Navigation.PushAsync(_tabbedPage);
|
||||
await Navigation.PopAsync();
|
||||
_tabbedPage.Children.Add(new ContentPage());
|
||||
_tabbedPage.Children[0].Background = SolidColorBrush.Purple;
|
||||
_tabbedPage.Children[0].Title = "update title";
|
||||
_tabbedPage.Children[0].IconImageSource = "dotnet_bot.png";
|
||||
await Task.Yield();
|
||||
Content = new VerticalStackLayout()
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label() { Text = "This test pushes and pops a TabbedPage, and then modifies the Children on the popped page."},
|
||||
new Label() { Text = "If the app doesn't crash, this test has passed.", AutomationId = "Success" }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,8 +77,8 @@ namespace Microsoft.Maui.DeviceTests
|
|||
await CreateHandlerAndAddToWindow<LineHandler>(line, async (handler) =>
|
||||
{
|
||||
await AssertionExtensions.Wait(
|
||||
() =>
|
||||
handler.PlatformView is not null &&
|
||||
() =>
|
||||
handler.PlatformView is not null &&
|
||||
handler.PlatformView.Drawable is not null);
|
||||
|
||||
var mauiShapeView = handler.PlatformView;
|
||||
|
|
|
@ -93,8 +93,8 @@ public class MemoryTests : ControlsHandlerTestBase
|
|||
|
||||
#if IOS
|
||||
// NOTE: skip certain controls on older iOS devices
|
||||
if (type == typeof (WebView) && !OperatingSystem.IsIOSVersionAtLeast(16))
|
||||
return;
|
||||
if (type == typeof(WebView) && !OperatingSystem.IsIOSVersionAtLeast(16))
|
||||
return;
|
||||
#endif
|
||||
|
||||
WeakReference viewReference = null;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Microsoft.Maui.Platform
|
|||
{
|
||||
var handler = Handler;
|
||||
var virtualView = handler?.VirtualView;
|
||||
|
||||
|
||||
if (handler == null || virtualView == null)
|
||||
return;
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace Microsoft.Maui.Platform
|
|||
{
|
||||
var handler = Handler;
|
||||
var virtualView = handler?.VirtualView;
|
||||
|
||||
|
||||
if (handler == null || virtualView == null)
|
||||
return;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче