Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void ShellElementPropertyChanged(object sender, PropertyChangedEventArgs e)
fe.Visibility = WVisibility.Visible;
}
}

base.MeasureOverride(availableSize);
var request = view.Measure(availableSize.Width, availableSize.Height);
Clip = new RectangleGeometry { Rect = new WRect(0, 0, request.Width, request.Height) };
return request.ToPlatform();
Expand Down
78 changes: 78 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue19783.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;

namespace Maui.Controls.Sample.Issues
{

[Issue(IssueTracker.Github, 19783, "ShellContent IsVisible=True Does not display Title")]
public class Issue19783 : Shell
{
public Issue19783()
{
var shellContent = new ShellContent()
{
ContentTemplate = new DataTemplate(typeof(Issue19783_WelcomePage))
};
var shellContent2 = new ShellContent()
{
ContentTemplate = new DataTemplate(typeof(Issue19783_ProfilePage))
};
this.Items.Add(new FlyoutItem()
{
Title = "Welcome Page",
Items =
{
shellContent
}
});
this.Items.Add(new FlyoutItem()
{
Title = "Profile Page",
IsVisible = false,
Items =
{
shellContent2
}
});
Button button = new Button();
button.Text = "Toggle Profile Page";
button.AutomationId = "ToggleProfilePage";
button.Clicked += (sender, e) =>
{
this.Items[1].IsVisible = true;
};
this.FlyoutFooter = button;
}
}

public class Issue19783_WelcomePage : ContentPage
{
StackLayout stackLayout;
public Issue19783_WelcomePage()
{
Title = "Welcome";
stackLayout = new StackLayout();
var button = new Button();
button.Text = "click to open pane";
button.AutomationId = "OpenPane";
button.Clicked += (sender, e) =>
{
Shell.Current.FlyoutIsPresented = true;
};
var label = new Label { Text = "Welcome to the Shell" };
stackLayout.Children.Add(label);
stackLayout.Children.Add(button);
Content = stackLayout;
}
}

public class Issue19783_ProfilePage : ContentPage
{
public Issue19783_ProfilePage()
{
Title = "Profile";
Content = new Label { Text = "Profile" };
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue19783 : _IssuesUITest
{
public Issue19783(TestDevice device) : base(device) { }

public override string Issue => "ShellContent IsVisible=True Does not display Title";

[Test]
[Category(UITestCategories.Shell)]
public void Issue19783Shell()
{
App.WaitForElement("click to open pane");
App.Tap("OpenPane");
App.WaitForElement("Toggle Profile Page");
App.Tap("ToggleProfilePage");
App.WaitForElement("Profile Page");
}
}
}