Skip to content

Update CommunityToolkit.Maui reference in sample content template #28510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 4, 2025
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
7 changes: 6 additions & 1 deletion src/Templates/src/templates/maui-mobile/MauiApp.1.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>DOTNET_TFM-android;DOTNET_TFM-ios;DOTNET_TFM-maccatalyst</TargetFrameworks>
Expand Down Expand Up @@ -82,7 +82,12 @@
<!--#if (IncludeSampleContent) -->
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<!--#if (Framework == "net8.0") -->
<PackageReference Include="CommunityToolkit.Maui" Version="9.1.0" />
<!--#endif-->
<!--#if (Framework == "net9.0") -->
<PackageReference Include="CommunityToolkit.Maui" Version="11.1.1" />
<!--#endif-->
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.8" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.10" />
<PackageReference Include="Syncfusion.Maui.Toolkit" Version="1.0.4" />
Expand Down
4 changes: 4 additions & 0 deletions src/Templates/src/templates/maui-mobile/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MauiApp._1.Pages.MainPage"
x:DataType="pageModels:MainPageModel"
x:Name="OverviewPage"
Title="{Binding Today}">

<ContentPage.Behaviors>
<toolkit:EventToCommandBehavior
BindingContext="{Binding Path=BindingContext, Source={x:Reference OverviewPage}, x:DataType=ContentPage}"
EventName="NavigatedTo"
Command="{Binding NavigatedToCommand}" />
<toolkit:EventToCommandBehavior
BindingContext="{Binding Path=BindingContext, Source={x:Reference OverviewPage}, x:DataType=ContentPage}"
EventName="NavigatedFrom"
Command="{Binding NavigatedFromCommand}" />
<toolkit:EventToCommandBehavior
BindingContext="{Binding Path=BindingContext, Source={x:Reference OverviewPage}, x:DataType=ContentPage}"
EventName="Appearing"
Command="{Binding AppearingCommand}" />
</ContentPage.Behaviors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:DataType="pageModels:ManageMetaPageModel"
x:Class="MauiApp._1.Pages.ManageMetaPage"
x:Name="MetaPage"
Title="Categories and Tags">


<ContentPage.Behaviors>
<toolkit:EventToCommandBehavior
BindingContext="{Binding Path=BindingContext, Source={x:Reference MetaPage}, x:DataType=ContentPage}"
EventName="Appearing"
Command="{Binding AppearingCommand}" />
</ContentPage.Behaviors>
Expand Down Expand Up @@ -61,7 +62,12 @@
<Entry.Behaviors>
<toolkit:TextValidationBehavior
InvalidStyle="{StaticResource InvalidEntryStyle}"
<!--#if (Framework == "net8.0") -->
Flags="ValidateOnUnfocusing"
<!--#endif -->
<!--#if (Framework == "net9.0") -->
Flags="ValidateOnUnfocused"
<!--#endif -->
RegexPattern="^#(?:[0-9a-fA-F]{3}){1,2}$" />
</Entry.Behaviors>
</Entry>
Expand Down Expand Up @@ -103,7 +109,12 @@
<Entry.Behaviors>
<toolkit:TextValidationBehavior
InvalidStyle="{StaticResource InvalidEntryStyle}"
<!--#if (Framework == "net8.0") -->
Flags="ValidateOnUnfocusing"
<!--#endif -->
<!--#if (Framework == "net9.0") -->
Flags="ValidateOnUnfocused"
<!--#endif -->
RegexPattern="^#(?:[0-9a-fA-F]{3}){1,2}$" />
</Entry.Behaviors>
</Entry>
Expand Down