Skip to content

Commit

Permalink
update .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
iNoles committed Nov 13, 2024
1 parent 4488a4f commit 9462198
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ public partial class App : Application
public App()
{
InitializeComponent();
}

MainPage = new AppShell();
protected override Window CreateWindow(IActivationState? activationState)

Check warning on line 10 in App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build_Android

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 10 in App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build_Android

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 10 in App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build_Windows

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 10 in App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build_Windows

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 10 in App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build_Windows

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 10 in App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build_Windows

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
return new Window(new AppShell());
}
}
6 changes: 3 additions & 3 deletions HackerNews.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst;net8.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0-ios;net9.0-maccatalyst;net9.0-android</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);net8.0-tizen</TargetFrameworks> -->
<OutputType>Library</OutputType>
<RootNamespace>HackerNews</RootNamespace>
<UseMaui>true</UseMaui>
<MauiVersion>8.0.93</MauiVersion>
<MauiVersion>9.0.0</MauiVersion>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
Expand Down
6 changes: 2 additions & 4 deletions NewsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ static void InsertIntoSortedCollection<T>(ObservableCollection<T> collection, Co

private async IAsyncEnumerable<StoryModel> GetTopStoriesAsync()
{
List<string> topStoryIds = [];

List<string> topStoryIds;
try
{
var topStoriesJson = await _newsService.GetTopStoryAsJsonAsync();
Expand All @@ -74,8 +73,7 @@ private async IAsyncEnumerable<StoryModel> GetTopStoriesAsync()

foreach (var id in topStoryIds)
{
StoryModel story = null;

StoryModel story;
try
{
story = await _newsService.GetTopStoryAsync(id);
Expand Down

0 comments on commit 9462198

Please sign in to comment.