Repository navigation
Labels
area/hot-reloadCategorizes an issue or PR as relevant to hot reloaddifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI
Description
Current behavior 🐛
When reset a ListView.Header using runtime app, the Layout is not updated.
See on the Video that when clear the Header of the ListView using backend code, the layout still the same (using the green area of the header)
And when I clear on the XAML editor (IDE) and force Hot Reload the Header space disappears.
ListView.Header.Hide.mp4
Expected behavior 🎯
When remove the Header of the ListView, using the RunningApp, the space disappears.
How to reproduce it (as minimally and precisely as possible) 🔬
Use this sample project.
Or Create a new blank App
dotnet new unoapp -o UnoAppHeader "
And change the MainPage.xaml
<Page x:Class="UnoAppHeader.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UnoAppHeader"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ScrollViewer IsTabStop="True">
<Grid>
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<Button Content="Click me to toggle header"
Width="200"
Height="50"
Margin="10"
Click="Button_Click" />
<Grid Background="LightGreen"
Height="300"
Width="300">
<ListView Width="300"
x:Name="ListViewWithHeader"
Header="Initial ListViewHeader"
Height="300">
<ListView.Items>
<x:String>First Item</x:String>
</ListView.Items>
<ListView.ItemTemplate>
<DataTemplate>
<Grid Background="Yellow">
<Border Width="290" Height="280" Background="Red" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</StackPanel>
</Grid>
</ScrollViewer>
</Page>and the backend MainPage.xaml.cs
namespace UnoAppHeader;
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(ListViewWithHeader.Header?.ToString()))
{
ListViewWithHeader.Header = "Changed Header Text";
}
else
{
//Direct change (don't work)
//ListViewWithHeader.Header = null;
//Using reflection (don't work)
var headerProperty = ListViewWithHeader.GetType().GetProperty("Header");
if (headerProperty != null && headerProperty.CanWrite)
{
headerProperty.SetValue(ListViewWithHeader, null);
}
}
}
}And run the App and click on the button.
Workaround 🛠️
Change on the Xaml.
And use Hot Reload every change of the Header
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
All platforms 🌍
Uno.Sdk version (and other relevant versions) 📦
last dev "Uno.Sdk": "6.2.0-dev.12"
IDE version 🧑💻
Visual studio Version 17.14.4
Anything else we need to know? 💬
No response
Reacted by DevTKSS
Metadata
Metadata
Assignees
Labels
area/hot-reloadCategorizes an issue or PR as relevant to hot reloaddifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI
Activity
nickrandolph commentedon Mar 2, 2026
@ramezgerges @Jen-Uno @MartinZikmund if there are some cycles free it would be good to take a quick look at this to see if there's a quick fix. If it's more complex, we can live with it being lower in the priority queue for now
github-actions commentedon Nov 1, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.