Skip to content

Changing Content property of ShellContent doesn't change visual content.  #12669

Description

@idexus

Description

Changing Content property of ShellContent does not change visual content. You need to reroute to the page in another tab and when you come back it changes, but only on windows and android. On Mac and iOS it doesn't change anyway.

Steps to Reproduce

  1. Create Page inside ShellContent
  2. try change Content property
  3. it doesn't change visual content
public partial class MainPage : ContentPage
{
    public MainPage()
    {
         InitializeComponent();
    }
    
    private void OnCounterClicked(object sender, EventArgs e)
    {
        if (this.Parent is ShellContent shellContent)
        {
	    var contentPage = new ContentPage();
	    var label = new Label();
    
	    label.Text = "Page changed";
	    label.FontSize = 30;
	    label.HorizontalOptions = LayoutOptions.Center;
	    label.VerticalOptions = LayoutOptions.Center;
	    contentPage.Content = label;
      
            shellContent.ContentTemplate = null;
            shellContent.Content = contentPage;
    
            // there is no way to reload shell content
          }
    }
}

Link to public reproduction project repository

https://github.com/idexus/issue_maui_Content

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS, I was not able test on other platforms

Affected platform versions

iOS 16.2, Android API 33, macOS 13.1, Windows 10

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-shellShell Navigation, Routes, Tabs, Flyoutpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/ioss/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions