🧪 toolbaritems sample

pull/2/head
Marc CHEVALDONNE 7 months ago
parent b862b64fe1
commit 7d1fefb0ae

@ -7,6 +7,8 @@
Shell.FlyoutBehavior="Disabled"
Title="ex_Toolbar">
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"

@ -2,23 +2,33 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ex_Toolbar.MainPage"
Shell.TitleColor="{AppThemeBinding Light={StaticResource Primary}, Dark=Red}">
Shell.ForegroundColor="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Info"
IconImageSource="{OnPlatform 'info_circle.png', WinUI={AppThemeBinding Light='info_circle_primary.png', Dark='info_circle_primarydark.png'}}"
Order="Primary"/>
IconImageSource="{OnPlatform 'info_circle.png',
WinUI={AppThemeBinding Light='info_circle_primary.png', Dark='info_circle_primarydark.png'},
Android={AppThemeBinding Light='info_circle_primary.png', Dark='info_circle_primarydark.png'}}"
Order="Primary"/>
<ToolbarItem Text="Rabbit"
IconImageSource="{OnPlatform 'hare.png', WinUI={AppThemeBinding Light='hare_primary.png', Dark='hare_primarydark.png'}}"
Order="Primary"/>
<ToolbarItem Text="More"
Order="Primary"/>
IconImageSource="{OnPlatform 'hare.png',
WinUI={AppThemeBinding Light='hare_primary.png', Dark='hare_primarydark.png'},
Android={AppThemeBinding Light='hare_primary.png', Dark='hare_primarydark.png'}}"
Order="Primary"/>
<!-- <ToolbarItem Text="More"
Order="Primary"/>
<ToolbarItem Text="Blabla"
IconImageSource="{OnPlatform 'captions_bubble.png', WinUI={AppThemeBinding Light='captions_bubble_primary.png', Dark='captions_bubble_primarydark.png'}}"
Order="Secondary"/>
IconImageSource="{OnPlatform 'captions_bubble.png',
WinUI={AppThemeBinding Light='captions_bubble_primary.png', Dark='captions_bubble_primarydark.png'},
Android={AppThemeBinding Light='captions_bubble_primary.png', Dark='captions_bubble_primarydark.png'}}"
Order="Secondary"/>
<ToolbarItem Text="Blabla Quotes"
IconImageSource="{OnPlatform 'quote_bubble.png', WinUI={AppThemeBinding Light='quote_bubble_primary.png', Dark='quote_bubble_primarydark.png'}}"
Order="Secondary"/>
IconImageSource="{OnPlatform 'quote_bubble.png',
WinUI={AppThemeBinding Light='quote_bubble_primary.png', Dark='quote_bubble_primarydark.png'},
Android={AppThemeBinding Light='quote_bubble_primary.png', Dark='quote_bubble_primarydark.png'}}"
Order="Secondary"/> -->
</ContentPage.ToolbarItems>
<ScrollView>
<VerticalStackLayout
Padding="30,0"

@ -400,7 +400,7 @@
<Style TargetType="Shell" ApplyToDerivedTypes="True">
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
<Setter Property="Shell.ForegroundColor" Value="{OnPlatform WinUI={StaticResource Primary}, Default={StaticResource White}}" />
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" />
<Setter Property="Shell.DisabledColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
<Setter Property="Shell.UnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}" />
<Setter Property="Shell.NavBarHasShadow" Value="False" />

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net8.0-maccatalyst;net8.0-android;net8.0-ios</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
@ -73,8 +73,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

Loading…
Cancel
Save