Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cd77417
change behaviour for API 30+
Pastajello Apr 6, 2026
86e456f
remove not needed flad for <=API29 add sample project?
Pastajello Apr 6, 2026
3ac122b
remove not needed transparency
Pastajello Apr 7, 2026
2f9aa9d
remove sample
Pastajello Apr 8, 2026
7b0d69c
better sample
Pastajello Apr 9, 2026
6d5a5d9
remove remaining files
Pastajello Apr 9, 2026
5d30f95
Merge branch 'main' into bugfix/2351-content-behind-statusbar
Pastajello Apr 9, 2026
8514bec
PR refactorings
Pastajello Apr 9, 2026
4e80d0d
restore previous page formatting
Pastajello Apr 9, 2026
1235318
remove more formatting changes
Pastajello Apr 9, 2026
7c785b2
Apply suggestion from @TheCodeTraveler
Pastajello Apr 9, 2026
3e55567
fix wrong names
Pastajello Apr 9, 2026
6123950
even more formatting fixes
Pastajello Apr 9, 2026
81c74df
Merge branch 'main' into bugfix/2351-content-behind-statusbar
ne0rrmatrix Apr 12, 2026
5033fa4
Merge branch 'main' into bugfix/2351-content-behind-statusbar
TheCodeTraveler Apr 15, 2026
1d2ebb7
Merge branch 'main' into bugfix/2351-content-behind-statusbar
Pastajello Apr 15, 2026
0b95162
Fix namespaces, better naming + add SafeAreaEdges Default
MerSpyro Apr 15, 2026
c73ae04
revert refactoring
MerSpyro Apr 15, 2026
09f0158
Apply suggestion from @TheCodeTraveler
TheCodeTraveler Apr 15, 2026
2a62ecd
Update samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/StatusBar…
TheCodeTraveler Apr 15, 2026
5d6047c
Update samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/StatusBar…
TheCodeTraveler Apr 15, 2026
73241d4
add flag clearing -copilot suggestion
MerSpyro Apr 15, 2026
517b8f7
Merge branch 'bugfix/2351-content-behind-statusbar' of https://github…
MerSpyro Apr 15, 2026
d81f5f4
Update samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/StatusBar…
Pastajello Apr 15, 2026
9dfebba
remove support android
MerSpyro Apr 15, 2026
4825bac
Merge branch 'bugfix/2351-content-behind-statusbar' of https://github…
MerSpyro Apr 15, 2026
c0984d2
Apply suggestion from @TheCodeTraveler
TheCodeTraveler Apr 15, 2026
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
1 change: 1 addition & 0 deletions samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CommunityToolkit.Maui.Sample.Pages;
using CommunityToolkit.Maui.Sample.Pages.Alerts;
using CommunityToolkit.Maui.Sample.Pages.Behaviors;
using CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior;
using CommunityToolkit.Maui.Sample.Pages.Converters;
using CommunityToolkit.Maui.Sample.Pages.Essentials;
using CommunityToolkit.Maui.Sample.Pages.Extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@
<ProjectReference Include="..\..\src\CommunityToolkit.Maui.Maps\CommunityToolkit.Maui.Maps.csproj" />
</ItemGroup>

<ItemGroup>
Comment thread
Pastajello marked this conversation as resolved.
Outdated
<MauiXaml Update="Pages\Behaviors\StatusBarBehavior\StatusBarBehaviorPage.xaml">
<SubType>Designer</SubType>
</MauiXaml>
</ItemGroup>

<ItemGroup>
<Compile Update="Pages\Behaviors\StatusBarBehavior\StatusBarBehaviorPage.xaml.cs">
<DependentUpon>StatusBarBehaviorPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))=='windows' and $(Configuration) == 'Release'">
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions samples/CommunityToolkit.Maui.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using CommunityToolkit.Maui.Sample.Pages;
using CommunityToolkit.Maui.Sample.Pages.Alerts;
using CommunityToolkit.Maui.Sample.Pages.Behaviors;
using CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior;
using CommunityToolkit.Maui.Sample.Pages.Converters;
using CommunityToolkit.Maui.Sample.Pages.Essentials;
using CommunityToolkit.Maui.Sample.Pages.Extensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Shell
Shell.FlyoutBehavior="Disabled"
Title="MauiApp1"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior.BrokenTitleViewShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:statusBarBehavior="clr-namespace:CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="clr-namespace:CommunityToolkit.Maui.Behaviors;assembly=CommunityToolkit.Maui">

<Shell.Behaviors>
<xct:StatusBarBehavior StatusBarStyle="LightContent" />
</Shell.Behaviors>

<ShellContent
ContentTemplate="{DataTemplate statusBarBehavior:MainPage}"
Route="MainPage"
Title="Home" />

<TabBar Route="Tabbar">
<Tab Title="Tab 1">
<ShellContent ContentTemplate="{DataTemplate statusBarBehavior:MainPage}" Title="Tab 1" />
</Tab>
<Tab Title="Tab 2">
<ShellContent ContentTemplate="{DataTemplate statusBarBehavior:MainPage}" Title="Tab 1" />
</Tab>
</TabBar>
</Shell>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior;

public partial class BrokenTitleViewShell : Shell
{
public BrokenTitleViewShell()
{
InitializeComponent();

GoToAsync("//Tabbar");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior.MainPage"
Comment thread
Pastajello marked this conversation as resolved.
Outdated
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">

<Shell.TitleView>
<Grid BackgroundColor="Yellow">
<Label HorizontalOptions="Center" Text="TITLE VIEW" />
</Grid>
</Shell.TitleView>

<Grid RowDefinitions="auto, auto, *">
<Label Text="Top line" />

<VerticalStackLayout
Grid.Row="1"
Padding="30,0"
Spacing="25">
<Image
Aspect="AspectFit"
HeightRequest="185"
SemanticProperties.Description="dot net bot in a race car number eight"
Source="dotnet_bot.png" />

<Label SemanticProperties.HeadingLevel="Level1" Text="Hello, World!" />

<Label
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
SemanticProperties.HeadingLevel="Level2"
Text="Welcome to &#10;.NET Multi-platform App UI" />

<Button
Clicked="OnCounterClicked"
HorizontalOptions="Fill"
SemanticProperties.Hint="Counts the number of times you click"
Text="Click me"
x:Name="CounterBtn" />
</VerticalStackLayout>

<Label
Grid.Row="2"
Text="Bottom"
VerticalOptions="End" />

</Grid>

</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior;

public partial class MainPage : ContentPage
{
int count = 0;

public MainPage()
{
InitializeComponent();
}

void OnCounterClicked(object? sender, EventArgs e)
{
MainThread.BeginInvokeOnMainThread(async () => { await Shell.Current.GoToAsync("//MainPage"); });
}
}
Original file line number Diff line number Diff line change
@@ -1,72 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>

<pages:BasePage
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehaviorPage"
Title="StatusBarBehavior"
ios:Page.UseSafeArea="True"
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior.StatusBarBehaviorPage"
x:DataType="vm:StatusBarBehaviorViewModel"
x:Name="Page"
x:TypeArguments="vm:StatusBarBehaviorViewModel"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:pages="clr-namespace:CommunityToolkit.Maui.Sample.Pages"
xmlns:vm="clr-namespace:CommunityToolkit.Maui.Sample.ViewModels.Behaviors"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="True"
Title="StatusBarBehavior"
x:DataType="vm:StatusBarBehaviorViewModel"
x:TypeArguments="vm:StatusBarBehaviorViewModel"
x:Name="Page">
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">

<ContentPage.Resources>
<ControlTemplate x:Key="RadioButtonTemplate">
<Border Stroke="#F3F2F1"
StrokeThickness="2"
StrokeShape="RoundRectangle 10"
BackgroundColor="#F3F2F1"
HeightRequest="90"
WidthRequest="90"
HorizontalOptions="Start"
VerticalOptions="Start">
<Border
BackgroundColor="#F3F2F1"
HeightRequest="90"
HorizontalOptions="Start"
Stroke="#F3F2F1"
StrokeShape="RoundRectangle 10"
StrokeThickness="2"
VerticalOptions="Start"
WidthRequest="90">
<Grid
BackgroundColor="Transparent"
Margin="4"
WidthRequest="90">
<Grid
HeightRequest="18"
HorizontalOptions="End"
Margin="0,0,4,0"
VerticalOptions="Start"
WidthRequest="18">
<Ellipse
Fill="White"
HeightRequest="16"
HorizontalOptions="Center"
Stroke="Blue"
VerticalOptions="Center"
WidthRequest="16" />
<Ellipse
Fill="Blue"
HeightRequest="8"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="8"
x:Name="check" />
</Grid>
<ContentPresenter />
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CheckedStates">
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter TargetName="check"
Property="Opacity"
Value="1" />
<Setter Property="Opacity" TargetName="check" Value="1" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Unchecked">
<VisualState.Setters>
<Setter TargetName="check"
Property="Opacity"
Value="0" />
<Setter Property="Opacity" TargetName="check" Value="0" />
Comment thread
Pastajello marked this conversation as resolved.
Outdated
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
<Grid Margin="4"
WidthRequest="90"
BackgroundColor="Transparent">
<Grid Margin="0,0,4,0"
WidthRequest="18"
HeightRequest="18"
HorizontalOptions="End"
VerticalOptions="Start">
<Ellipse Stroke="Blue"
Fill="White"
WidthRequest="16"
HeightRequest="16"
HorizontalOptions="Center"
VerticalOptions="Center" />
<Ellipse x:Name="check"
Fill="Blue"
WidthRequest="8"
HeightRequest="8"
HorizontalOptions="Center"
VerticalOptions="Center" />
</Grid>
<ContentPresenter />
</Grid>
</Border>
</ControlTemplate>

Expand All @@ -84,7 +85,10 @@

<ScrollView Padding="{StaticResource ContentPadding}">

<VerticalStackLayout Padding="15,0" Spacing="30" IgnoreSafeArea="False">
Comment thread
Pastajello marked this conversation as resolved.
<VerticalStackLayout
IgnoreSafeArea="False"
Padding="15,0"
Spacing="30">

<Label Text="Slide to change StatusBar color" />

Expand Down Expand Up @@ -124,17 +128,16 @@

<Stepper
HorizontalOptions="Start"
Increment="0.1"
Comment thread
Pastajello marked this conversation as resolved.
Outdated
Margin="20,0"
Maximum="1"
Increment="0.1"
Minimum="0"
Value="{Binding AlphaSliderValue}" />

<Label Text="Select StatusBar and NavigationBar style" />

<HorizontalStackLayout Spacing="15">
<RadioButton IsChecked="{Binding IsDefaultChecked}"
Comment thread
Pastajello marked this conversation as resolved.
VerticalOptions="Center">
<RadioButton IsChecked="{Binding IsDefaultChecked}" VerticalOptions="Center">
<RadioButton.Content>
<Label
Margin="10,0,0,0"
Expand All @@ -144,8 +147,7 @@
</RadioButton.Content>
</RadioButton>

<RadioButton IsChecked="{Binding IsLightContentChecked}"
Comment thread
Pastajello marked this conversation as resolved.
VerticalOptions="Center">
<RadioButton IsChecked="{Binding IsLightContentChecked}" VerticalOptions="Center">
<RadioButton.Content>
<Label
Margin="10,0,0,0"
Expand All @@ -155,8 +157,7 @@
</RadioButton.Content>
</RadioButton>

<RadioButton IsChecked="{Binding IsDarkContentChecked}"
VerticalOptions="Center">
<RadioButton IsChecked="{Binding IsDarkContentChecked}" VerticalOptions="Center">
<RadioButton.Content>
<Label
Margin="10,0,0,0"
Expand All @@ -169,8 +170,14 @@
</HorizontalStackLayout>

<Button
x:Name="ModalPageButton"
HorizontalOptions="Center"
VerticalOptions="Center"
x:Name="ModalPageButton" />

<Button
Clicked="Button_OnClicked"
HorizontalOptions="Center"
Text="Go to Broken Shel.TitleView Shell"
VerticalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;

namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
namespace CommunityToolkit.Maui.Sample.Pages.Behaviors.StatusBarBehavior;
Comment thread
Pastajello marked this conversation as resolved.
Outdated

public partial class StatusBarBehaviorPage : BasePage<StatusBarBehaviorViewModel>
{
Expand Down Expand Up @@ -68,4 +68,10 @@ static bool TryGetModalPageButton(Microsoft.Maui.ILayout layout, [NotNullWhen(tr

return false;
}

void Button_OnClicked(object? sender, EventArgs e)
Comment thread
Pastajello marked this conversation as resolved.
Outdated
{
Application.Current?.MainPage = new BrokenTitleViewShell();
Comment thread
Pastajello marked this conversation as resolved.
Outdated

Comment thread
TheCodeTraveler marked this conversation as resolved.
}
}
Loading
Loading