Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
4d39187
Update to .NET 9
TheCodeTraveler Oct 14, 2024
1eaca0c
Update for .NET 9
TheCodeTraveler Oct 14, 2024
5c0af69
Update BindableObjectMultiBindExtensionsTests.cs
TheCodeTraveler Oct 14, 2024
7386996
Update azure-pipelines.yml
TheCodeTraveler Oct 14, 2024
49a3670
Update azure-pipelines.yml
TheCodeTraveler Oct 14, 2024
438947e
Remove `string` path bindings
TheCodeTraveler Oct 14, 2024
6c86ddb
Update azure-pipelines.yml
TheCodeTraveler Oct 14, 2024
0eecf21
Update BindingHelpers.cs
TheCodeTraveler Oct 15, 2024
ea5a787
Fix TypedBinding
TheCodeTraveler Oct 15, 2024
9bcfd43
Update GesturesExtensionsTests.cs
TheCodeTraveler Oct 15, 2024
5be6fb6
Revert `Format` method
TheCodeTraveler Oct 15, 2024
1e2a9ca
Revert `Format(int, params object[])`
TheCodeTraveler Oct 15, 2024
66b64fe
Allow unsafe code blocks in sample
TheCodeTraveler Oct 15, 2024
6293ac0
Enable AOT on Android + Windows Sample
TheCodeTraveler Oct 15, 2024
b20dfc8
Update CommunityToolkit.Maui.Markup.Sample.csproj
TheCodeTraveler Oct 15, 2024
b3b3b9a
Revert "Update CommunityToolkit.Maui.Markup.Sample.csproj"
TheCodeTraveler Oct 15, 2024
d630507
Revert "Enable AOT on Android + Windows Sample"
TheCodeTraveler Oct 15, 2024
bf733d2
Use Syntax Highlighting for code blocks
TheCodeTraveler Oct 16, 2024
749fe98
Update `<WarningsAsErrors>`
TheCodeTraveler Oct 16, 2024
e70a347
Resolve WinRt errors
TheCodeTraveler Oct 16, 2024
5307712
Remove `Application.Current.MainPage`
TheCodeTraveler Oct 16, 2024
5ba730c
Create BindableObjectExtensionsTests.cs
TheCodeTraveler Oct 16, 2024
7d7b595
Merge branch 'Support-NET-9' of https://github.com/CommunityToolkit/M…
TheCodeTraveler Oct 16, 2024
f54a2b8
Merge branch 'main' into Support-NET-9
TheCodeTraveler Oct 16, 2024
1dd3914
Fix ElementExtensionsTests and DynamicResourceHandlerTests
TheCodeTraveler Oct 16, 2024
cf41760
Resolve AppThemeBinding Tests
TheCodeTraveler Oct 31, 2024
5173e95
Merge branch 'main' into Support-NET-9
TheCodeTraveler Oct 31, 2024
3899fd0
Remove `ActivateWindow`
TheCodeTraveler Oct 31, 2024
3863174
Re-add obsolete BindableObjectExtensions
TheCodeTraveler Nov 1, 2024
12edde2
Merge branch 'main' into Support-NET-9
TheCodeTraveler Nov 4, 2024
e7b0a6c
Update NuGet Packages
TheCodeTraveler Nov 4, 2024
398a157
`dotnet format`
TheCodeTraveler Nov 4, 2024
7245395
Update CommunityToolkit.Maui.Markup.Sample.csproj
TheCodeTraveler Nov 7, 2024
641b7ef
Add Support for BindingBase.Create
TheCodeTraveler Nov 8, 2024
d326f04
Update Sample
TheCodeTraveler Nov 8, 2024
3866804
Revert "Update Sample"
TheCodeTraveler Nov 8, 2024
72b78be
Revert "Add Support for BindingBase.Create"
TheCodeTraveler Nov 8, 2024
2c9c914
Update MVVM Toolkit
TheCodeTraveler Nov 8, 2024
5d0c904
Revert "Update MVVM Toolkit"
TheCodeTraveler Nov 8, 2024
76dc565
Revert
TheCodeTraveler Nov 8, 2024
51fc161
Use `params ReadOnlySpan<T>`
TheCodeTraveler Nov 10, 2024
6b5bec5
Merge branch 'main' into Support-NET-9
TheCodeTraveler Nov 10, 2024
b5e5f0b
Update ExecuteBindingsBase.cs
TheCodeTraveler Nov 10, 2024
cd4f88e
Revert Benchmarks
TheCodeTraveler Nov 10, 2024
72b611a
Update Xcode logic
TheCodeTraveler Nov 10, 2024
0c56055
Update azure-pipelines.yml
TheCodeTraveler Nov 10, 2024
21848d2
Update azure-pipelines.yml
TheCodeTraveler Nov 10, 2024
6906bfa
Increase to macOS-15
TheCodeTraveler Nov 11, 2024
f27026e
Merge branch 'main' into Support-NET-9
TheCodeTraveler Nov 11, 2024
f941773
Fix Hosted Agent Image
TheCodeTraveler Nov 11, 2024
337e284
Merge branch 'Support-NET-9' of https://github.com/CommunityToolkit/M…
TheCodeTraveler Nov 11, 2024
e8364aa
Update azure-pipelines.yml
TheCodeTraveler Nov 11, 2024
5d7a4a6
Use `CollectionViewHandler2` and `CarouselViewHandler2`
TheCodeTraveler Nov 12, 2024
0411cdd
Use Primary Constructors
TheCodeTraveler Nov 12, 2024
1027ebb
Use partial properties
TheCodeTraveler Nov 12, 2024
3e9a144
Organize properties
TheCodeTraveler Nov 12, 2024
255e6fc
Use Partial Properties
TheCodeTraveler Nov 12, 2024
1653fa5
`dotnet format`
TheCodeTraveler Nov 12, 2024
e8cc2f0
Update for .NET 9 GA
TheCodeTraveler Nov 12, 2024
eaab921
Fix sample app error
TheCodeTraveler Nov 12, 2024
ae2a6c3
Update samples/CommunityToolkit.Maui.Markup.Sample/CommunityToolkit.M…
TheCodeTraveler Nov 12, 2024
f54775f
Update azure-pipelines.yml
TheCodeTraveler Nov 12, 2024
f306f8d
Update azure-pipelines.yml
TheCodeTraveler Nov 12, 2024
8a11480
Revert to macOS-14
TheCodeTraveler Nov 12, 2024
3d9ae6e
Revert "Revert to macOS-14"
TheCodeTraveler Nov 12, 2024
19b67ad
Update azure-pipelines.yml
TheCodeTraveler Nov 12, 2024
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
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@ dotnet_diagnostic.CA2208.severity = error
dotnet_diagnostic.CA1834.severity = error

# IDE0220: Add explicit cast
dotnet_diagnostic.IDE0220.severity = error
dotnet_diagnostic.IDE0220.severity = error

# IDE0220: The field [ObservableProperty] can be converted to a partial property
dotnet_diagnostic.MVMTK0042.severity = error
40 changes: 32 additions & 8 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<PropertyGroup>
<NetVersion>net8.0</NetVersion>
<MauiPackageVersion>8.0.93</MauiPackageVersion>
<NetVersion>net9.0</NetVersion>
<MauiPackageVersion>9.0.0</MauiPackageVersion>
<MauiCommunityToolkitPackageVersion>9.1.1</MauiCommunityToolkitPackageVersion>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>NETSDK1023</NoWarn>
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>

<!-- https://learn.microsoft.com/dotnet/core/deploying/native-aot/?tabs=net8plus%2Cwindows -->
<!-- Support NativeAOT https://learn.microsoft.com/dotnet/core/deploying/native-aot/?tabs=net8plus%2Cwindows -->
<StripSymbols>false</StripSymbols>
<TrimmerSingleWarn>false</TrimmerSingleWarn>

<!-- Prevent NuGet Package Vulnerabilities -->
<NuGetAudit>enable</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>

<!-- MAUI Specific -->
<MauiStrictXamlCompilation>true</MauiStrictXamlCompilation>
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>

<!-- WarningsAsErrors
CS0419: Ambiguous reference in cref attribute
CS0618: Is obsolete
CS1570: XML comment has badly formed XML 'Expected an end tag for element [parameter]
CS1571: XML comment on [construct] has a duplicate param tag for [parameter]
CS1572: XML comment has a param tag for '[parameter]', but there is no parameter by that name
Expand All @@ -39,13 +48,28 @@
CS1711: XML comment has a typeparam tag, but there is no type parameter by that name
CS1712: Type parameter has no matching typeparam tag in the XML comment
CS1723: XML comment has cref attribute that refers to a type parameter
CS1734: XML comment has a paramref tag, but there is no parameter by that name
CS1734: XML comment has a paramref tag, but there is no parameter by that name
MVMTK0042: The field [ObservableProperty] can be converted to a partial property
CsWinRT1028: Class implements WinRT interfaces but isn't marked partial
CsWinRT1030: Class implements WinRT interfaces that require unsafe code
XC0045: Binding: Property not found
XC0103: Consider attributing the markup extension with [RequireService] or [AcceptEmptyServiceProvider] if it doesn't require any
NU1900 Error communicating with package source, while getting vulnerability information.
NU1901 Package with low severity detected
NU1902 Package with moderate severity detected
NU1903 Package with high severity detected
NU1904 Package with critical severity detected
NU1905 An audit source does not provide a vulnerability database
NUnit*: NUnit Analyzers
IL2***: Trim Warnings
IL3***: AOT Warnings-->
<WarningsAsErrors>
nullable,
CS0419,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1587,CS1589,CS1590,CS1591,CS1592,CS1598,CS1658,CS1710,CS1711,CS1712,CS1723,CS1734,
CS0419,CS0618,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1587,CS1589,CS1590,CS1591,CS1592,CS1598,CS1658,CS1710,CS1711,CS1712,CS1723,CS1734,
MVMTK0042,
CsWinRT1028,CsWinRT1030,
XC0045,XC0103,
NU1900,NU1901,NU1902,NU1903,NU1904,NU1905,
NUnit1001,NUnit1002,NUnit1003,NUnit1004,NUnit1005,NUnit1006,NUnit1007,NUnit1008,NUnit1009,NUnit1010,NUnit1011,NUnit1012,NUnit1013,NUnit1014,NUnit1015,NUnit1016,NUnit1017,NUnit1018,NUnit1019,NUnit1020,NUnit1021,NUnit1022,NUnit1023,NUnit1024,NUnit1025,NUnit1026,NUnit1027,NUnit1028,NUnit1029,NUnit1030,NUnit1031,NUnit1032,NUnit1033,
NUnit2001,NUnit2002,NUnit2003,NUnit2004,NUnit2005,NUnit2006,NUnit2007,NUnit2008,NUnit2009,NUnit2010,NUnit2011,NUnit2012,NUnit2013,NUnit2014,NUnit2015,NUnit2016,NUnit2017,NUnit2018,NUnit2019,NUnit2020,NUnit2021,NUnit2022,NUnit2023,NUnit2024,NUnit2025,NUnit2026,NUnit2027,NUnit2028,NUnit2029,NUnit2030,NUnit2031,NUnit2032,NUnit2033,NUnit2034,NUnit2035,NUnit2036,NUnit2037,NUnit2038,NUnit2039,NUnit2040,NUnit2041,NUnit2042,NUnit2043,NUnit2044,NUnit2045,NUnit2046,NUnit2047,NUnit2048,NUnit2049,NUnit2050,
NUnit3001,NUnit3002,NUnit3003,NUnit3004,
Expand All @@ -64,7 +88,7 @@
IL2110,IL2111,IL2112,IL2113,IL2114,IL2115,IL2116,IL2117,IL2118,IL2119,
IL2120,IL2121,IL2122,
IL3050,IL3051,IL3052,IL3053,IL3054,IL3055,IL3056
</WarningsAsErrors>
</WarningsAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down
45 changes: 33 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variables:
PreviewNumber: $[counter(variables['CurrentSemanticVersionBase'], 1001)]
CurrentSemanticVersion: '$(CurrentSemanticVersionBase)-preview$(PreviewNumber)'
NugetPackageVersion: '$(CurrentSemanticVersion)'
NET_VERSION: '8.0.x'
NET_VERSION: '9.0.100'
RunPoliCheck: false
PathToLibrarySolution: 'src/CommunityToolkit.Maui.Markup.sln'
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Markup.Sample.sln'
Expand Down Expand Up @@ -51,13 +51,14 @@ jobs:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
image: 'macos-15'
pool:
vmImage: $(image)
steps:
- script: |
sudo xcode-select -s /Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app
sudo xcode-select -p
echo Installed Xcode Versions:
ls -al /Applications | grep Xcode
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app/Contents/Developer
displayName: 'Set Xcode v$(CommunityToolkitSampleApp_Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS

Expand All @@ -68,10 +69,19 @@ jobs:
version: '$(NET_VERSION)'
includePreviewVersions: false

- task: JavaToolInstaller@0
displayName: "Install Java"
inputs:
versionSpec: "17"
jdkArchitectureOption: "x64"
jdkSourceOption: "PreInstalled"

- task: CmdLine@2
displayName: 'Install .NET MAUI Workload'
inputs:
script : 'dotnet workload install maui'
script : |
dotnet workload install maui
dotnet workload update

- pwsh: |
Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
Expand All @@ -98,7 +108,7 @@ jobs:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
image: 'macos-15'
pool:
vmImage: $(image)
steps:
Expand All @@ -123,8 +133,9 @@ jobs:
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['build.reason'], 'PullRequest'))

- script: |
sudo xcode-select -s /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app
sudo xcode-select -p
echo Installed Xcode Versions:
ls -al /Applications | grep Xcode
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app/Contents/Developer
displayName: 'Set Xcode v$(CommunityToolkitLibrary_Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS

Expand All @@ -135,10 +146,19 @@ jobs:
version: '$(NET_VERSION)'
includePreviewVersions: false

- task: JavaToolInstaller@0
displayName: "Install Java"
inputs:
versionSpec: "17"
jdkArchitectureOption: "x64"
jdkSourceOption: "PreInstalled"

- task: CmdLine@2
displayName: 'Install .NET MAUI Workload'
inputs:
script : 'dotnet workload install maui'
script : |
dotnet workload install maui
dotnet workload update

- pwsh: |
Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
Expand Down Expand Up @@ -249,13 +269,14 @@ jobs:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
image: 'macos-15'
pool:
vmImage: $(image)
steps:
- script: |
sudo xcode-select -s /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app
sudo xcode-select -p
echo Installed Xcode Versions:
ls -al /Applications | grep Xcode
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app/Contents/Developer
displayName: 'Set Xcode v$(CommunityToolkitLibrary_Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.203",
"version": "9.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
9 changes: 6 additions & 3 deletions samples/CommunityToolkit.Maui.Markup.Sample/App.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
namespace CommunityToolkit.Maui.Markup.Sample;

class App : Application
partial class App : Application
{
readonly AppShell appShell;

public App(AppShell shell)
{
Resources = new AppStyles();

MainPage = shell;
appShell = shell;
}

protected override Window CreateWindow(IActivationState? activationState) => new(appShell);
}
4 changes: 2 additions & 2 deletions samples/CommunityToolkit.Maui.Markup.Sample/AppShell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace CommunityToolkit.Maui.Markup.Sample;

class AppShell : Shell
partial class AppShell : Shell
{
static readonly IReadOnlyDictionary<Type, string> pageRouteMappingDictionary = new Dictionary<Type, string>(
[
Expand Down Expand Up @@ -32,7 +32,7 @@ public static string GetRoute(Type type)
return route;
}

static KeyValuePair<Type, string> CreateRoutePageMapping<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TPage, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TViewModel>() where TPage : BaseContentPage<TViewModel>
static KeyValuePair<Type, string> CreateRoutePageMapping<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TPage, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TViewModel>() where TPage : BaseContentPage<TViewModel>
where TViewModel : BaseViewModel
{
var route = CreateRoute();
Expand Down
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>$(NetVersion)-android;$(NetVersion)-ios;$(NetVersion)-maccatalyst</TargetFrameworks>
Expand All @@ -22,20 +22,23 @@
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>

<!-- Remove this NoWarn once .NET MAUI has implemented partial classes for XamlUserTypeInfo source generators -->
<NoWarn>CsWinRT1028</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'tizen'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<PropertyGroup Condition="'$(Configuration)' == 'Release' &#xD;&#xA; AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'tizen'&#xD;&#xA; AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'&#xD;&#xA; AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<!-- Ahead-of-time compilation is not yet supported net8.0-tizen -->
<!-- Cross-OS native compilation is not supported net8.0-android -->
<!-- net8.0-windows causing build errors in azurepipelines.yml -->
<!-- Windows causing build errors in azurepipelines.yml -->
<PublishAot>true</PublishAot>
</PropertyGroup>

Expand All @@ -52,14 +55,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiPackageVersion)"/>
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiPackageVersion)"/>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiPackageVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiPackageVersion)" />
<PackageReference Include="CommunityToolkit.Maui" Version="$(MauiCommunityToolkitPackageVersion)" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview1" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\CommunityToolkit.Maui.Markup\CommunityToolkit.Maui.Markup.csproj" />
<ProjectReference Include="..\..\src\CommunityToolkit.Maui.Markup.SourceGenerators\CommunityToolkit.Maui.Markup.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
Expand All @@ -68,10 +71,7 @@
<!-- Workaround for https://github.com/dotnet/maui/issues/7272 -->
<Target Name="_SetPublishFolderTypeNoneOnDocFileItems" BeforeTargets="_ComputePublishLocation">
<ItemGroup>
<ResolvedFileToPublish
Update="@(ResolvedFileToPublish)"
Condition="'%(ResolvedFileToPublish.Extension)' == '.xml' And '%(ResolvedFileToPublish.PublishFolderType)' == ''"
PublishFolderType="None" />
<ResolvedFileToPublish Update="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.Extension)' == '.xml' And '%(ResolvedFileToPublish.PublishFolderType)' == ''" PublishFolderType="None" />
</ItemGroup>
</Target>

Expand Down
21 changes: 13 additions & 8 deletions samples/CommunityToolkit.Maui.Markup.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ public class MauiProgram
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder()
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMarkup();

// Fonts
builder.ConfigureFonts(fonts => fonts.AddFont("FontAwesome.otf", "FontAwesome"));
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMarkup()
.ConfigureFonts(fonts => fonts.AddFont("FontAwesome.otf", "FontAwesome"))
.ConfigureMauiHandlers(handlers =>
{
#if IOS || MACCATALYST
handlers.AddHandler<CollectionView, Microsoft.Maui.Controls.Handlers.Items2.CollectionViewHandler2>();
handlers.AddHandler<CarouselView, Microsoft.Maui.Controls.Handlers.Items2.CarouselViewHandler2>();
#endif
});

// App Shell
builder.Services.AddTransient<AppShell>();
Expand All @@ -25,8 +30,8 @@ public static MauiApp CreateMauiApp()
builder.Services.AddSingleton(Preferences.Default);
builder.Services.AddSingleton<HackerNewsAPIService>();
builder.Services.AddRefitClient<IHackerNewsApi>()
.ConfigureHttpClient(client => client.BaseAddress = new Uri("https://hacker-news.firebaseio.com/v0"))
.AddStandardResilienceHandler(options => options.Retry = new MobileHttpRetryStrategyOptions());
.ConfigureHttpClient(client => client.BaseAddress = new Uri("https://hacker-news.firebaseio.com/v0"))
.AddStandardResilienceHandler(options => options.Retry = new MobileHttpRetryStrategyOptions());

// Pages + View Models
builder.Services.AddTransient<NewsPage, NewsViewModel>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Maui.Layouts;
namespace CommunityToolkit.Maui.Markup.Sample.Pages;

sealed class NewsDetailPage : BaseContentPage<NewsDetailViewModel>
sealed partial class NewsDetailPage : BaseContentPage<NewsDetailViewModel>
{
public NewsDetailPage(NewsDetailViewModel newsDetailViewModel) : base(newsDetailViewModel, newsDetailViewModel.Title)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace CommunityToolkit.Maui.Markup.Sample.Pages;

sealed class NewsPage : BaseContentPage<NewsViewModel>
sealed partial class NewsPage : BaseContentPage<NewsViewModel>
{
readonly IDispatcher dispatcher;
readonly RefreshView refreshView;
Expand Down
Loading