Skip to content
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

.NET 9 Support #818

Merged
merged 7 commits into from
Nov 14, 2024
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
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 8.0.100
version: 9.0.100
performMultiLevelLookup: true
includePreviewVersions: true # Required for preview versions

Expand Down
14 changes: 14 additions & 0 deletions demo/UraniumApp/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,19 @@

<uranium:SelectableLabel Margin="15" Text="Hello, World! This text should be selectable!" />

<material:PickerField Title="Monkeys">
<material:PickerField.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Baboon</x:String>
<x:String>Capuchin Monkey</x:String>
<x:String>Blue Monkey</x:String>
<x:String>Squirrel Monkey</x:String>
<x:String>Golden Lion Tamarin</x:String>
<x:String>Howler Monkey</x:String>
<x:String>Japanese Macaque</x:String>
</x:Array>
</material:PickerField.ItemsSource>
</material:PickerField>

</VerticalStackLayout>
</ContentPage>
1 change: 0 additions & 1 deletion demo/UraniumApp/Pages/TabViews/TabViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:material="http://schemas.enisn-projects.io/dotnet/maui/uraniumui/material"
xmlns:input="clr-namespace:InputKit.Shared.Controls;assembly=InputKit.Maui"
xmlns:m="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:root="clr-namespace:UraniumApp"
xmlns:local="clr-namespace:UraniumApp.Pages">
<ContentPage.Content>
Expand Down
9 changes: 5 additions & 4 deletions demo/UraniumApp/UraniumApp.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\maui.common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
Expand Down Expand Up @@ -57,7 +57,8 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.1" />
<PackageReference Include="Bogus" Version="35.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 4 additions & 7 deletions maui.common.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project>
<PropertyGroup>
<MauiVersion>8.0.21</MauiVersion>
<PropertyGroup Condition="$(TargetFramework.Contains('net8'))">
<MauiVersion>8.0.83</MauiVersion>
</PropertyGroup>
<!-- <PropertyGroup Condition="$(TargetFramework.Contains('net7'))">
<MauiVersion>7.0.92</MauiVersion>
<PropertyGroup Condition="$(TargetFramework.Contains('net9'))">
<MauiVersion>9.0.10</MauiVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('net6'))">
<MauiVersion>6.0.552</MauiVersion>
</PropertyGroup> -->
</Project>
8 changes: 4 additions & 4 deletions src/UraniumUI.Blurs/BlurPlatformEffect.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected void UpdateEffect()
if (_mainDrawable == null)
{
_mainDrawable = new GradientDrawable();
_mainDrawable.SetColor(Colors.Transparent.ToAndroid());
_mainDrawable.SetColor(Colors.Transparent.ToPlatform());
Control.Background = _mainDrawable;
}

Expand Down Expand Up @@ -116,12 +116,12 @@ protected Android.Graphics.Color GetColor()
{
if (VirtualEffect?.AccentColor != null && VirtualEffect.AccentColor.IsNotDefault())
{
return VirtualEffect.AccentColor.WithAlpha(VirtualEffect.AccentOpacity).ToAndroid();
return VirtualEffect.AccentColor.WithAlpha(VirtualEffect.AccentOpacity).ToPlatform();
}

return VirtualEffect?.Mode == BlurMode.Dark
? Colors.Black.WithAlpha(VirtualEffect.AccentOpacity).ToAndroid()
: Colors.White.WithAlpha(VirtualEffect.AccentOpacity).ToAndroid();
? Colors.Black.WithAlpha(VirtualEffect.AccentOpacity).ToPlatform()
: Colors.White.WithAlpha(VirtualEffect.AccentOpacity).ToPlatform();
}

private void AlignBlurView()
Expand Down
4 changes: 2 additions & 2 deletions src/UraniumUI.Blurs/UraniumUI.Blurs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand All @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.2" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/UraniumUI.Dialogs.Mopups/UraniumUI.Dialogs.Mopups.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand All @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mopups" Version="1.3.0" />
<PackageReference Include="Mopups" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
2 changes: 1 addition & 1 deletion src/UraniumUI.Material/Handlers/ButtonViewHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET8_0
#if NET8_0 || NET9_0

using Microsoft.Maui.Handlers;
using System.Windows.Input;
Expand Down
6 changes: 4 additions & 2 deletions src/UraniumUI.Material/Resources/StyleResource.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,11 @@
<Setter Property="Fill" Value="{AppThemeBinding {StaticResource OnSurface}, Dark={StaticResource OnSurfaceDark}}"></Setter>
</Style>

<Style x:Key="UraniumUI.Styles.FontImageSource" TargetType="FontImageSource" CanCascade="True">
<!-- Disable until solution of MAUI bug -->

<!--<Style x:Key="UraniumUI.Styles.FontImageSource" TargetType="FontImageSource" CanCascade="True">
<Setter Property="Color" Value="{AppThemeBinding {StaticResource OnBackground}, Dark={StaticResource OnBackgroundDark}}"></Setter>
</Style>
</Style>-->

<Style x:Key="UraniumUI.Styles.TreeView" TargetType="c:TreeView">
<Setter Property="SelectionColor" Value="{AppThemeBinding {StaticResource Tertiary}, Dark={StaticResource TertiaryDark}}" />
Expand Down
4 changes: 2 additions & 2 deletions src/UraniumUI.Material/UraniumUI.Material.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</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);net7.0-tizen</TargetFrameworks> -->
Expand All @@ -30,4 +30,8 @@
<PackageReference Include="InputKit.Maui" Version="4.4.7" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('net9'))">
<PackageReference Include="InputKit.Maui" Version="4.5.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/UraniumUI.WebComponents/UraniumUI.WebComponents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
3 changes: 2 additions & 1 deletion src/UraniumUI/Handlers/AutoCompleteViewHandler.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Maui.Controls.Compatibility.Platform.Android;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
using System.Collections;
using UraniumUI.Controls;

Expand All @@ -31,7 +32,7 @@ protected override AppCompatAutoCompleteTextView CreatePlatformView()

if (VirtualView != null)
{
autoComplete.SetTextColor(VirtualView.TextColor.ToAndroid());
autoComplete.SetTextColor(VirtualView.TextColor.ToPlatform());
}

return autoComplete;
Expand Down
2 changes: 1 addition & 1 deletion src/UraniumUI/Handlers/AutoCompleteViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AutoCompleteViewHandler() : base(IconViewMapper)
}
}

#if (NET8_0) && !ANDROID && !IOS && !MACCATALYST && !WINDOWS
#if (NET8_0 || NET9_0) && !ANDROID && !IOS && !MACCATALYST && !WINDOWS
public partial class AutoCompleteViewHandler : ViewHandler<AutoCompleteView, object>
{
public AutoCompleteViewHandler(IPropertyMapper mapper, CommandMapper commandMapper = null) : base(IconViewMapper, commandMapper)
Expand Down
2 changes: 1 addition & 1 deletion src/UraniumUI/Handlers/DropdownHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public DropdownHandler() : base(DropdownPropertyMapper)
}
}

#if (NET8_0) && !ANDROID && !IOS && !MACCATALYST && !WINDOWS
#if (NET8_0 || NET9_0) && !ANDROID && !IOS && !MACCATALYST && !WINDOWS
public partial class DropdownHandler : ViewHandler<Dropdown, object>
{
public DropdownHandler(IPropertyMapper mapper, CommandMapper commandMapper = null) : base(DropdownPropertyMapper, commandMapper)
Expand Down
2 changes: 1 addition & 1 deletion src/UraniumUI/Handlers/StatefulContentViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private void ExecuteCommandIfCan(ICommand command)
command.Execute(StatefulView.CommandParameter);
}
}
#if NET8_0 && !ANDROID && !IOS && !MACCATALYST && !WINDOWS
#if (NET8_0 || NET9_0) && !ANDROID && !IOS && !MACCATALYST && !WINDOWS
public static void MapIsFocusable(StatefulContentViewHandler handler, StatefulContentView view)
{

Expand Down
4 changes: 2 additions & 2 deletions src/UraniumUI/UraniumUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0</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);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
Expand Down
Loading