Skip to content

Commit ec67521

Browse files
Feature/maui cinephile (#698)
* Add MAUI Cinephile project * Update project info * Copy styles from Xamarin.Forms project * Copy views from Xamarin.Forms project * Update namespaces * Remove FFImageLoading * Use Label instead of Span for gestures * Use event pattern directly * Fix style compile error * Update JSON annotations * Update image URLs See https://stackoverflow.com/a/50834600/1399272 * Update Android colors * Merge styles * Update icons * Use fluent builder bootstrap --------- Co-authored-by: Chris Pulman <[email protected]>
1 parent fef80cf commit ec67521

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1480
-15
lines changed

ReactiveUI.Samples.sln

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForms.Reactive.Client",
105105
EndProject
106106
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForms.Reactive.Client.Tests", "winforms\demo2\WinForms.Reactive.Client.Tests\WinForms.Reactive.Client.Tests.csproj", "{51000030-6C8E-4138-ACAE-20B5B462944C}"
107107
EndProject
108+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MAUI", "MAUI", "{F9D0B2A7-F4F0-4147-B64C-3D9FE244A898}"
109+
EndProject
110+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CinephileApp", "CinephileApp", "{19832957-3859-4FC3-9D41-1BD9CE005998}"
111+
EndProject
112+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cinephile", "maui\Cinephile\Cinephile\Cinephile.csproj", "{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}"
113+
EndProject
108114
Global
109115
GlobalSection(SolutionConfigurationPlatforms) = preSolution
110116
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@@ -1949,6 +1955,90 @@ Global
19491955
{51000030-6C8E-4138-ACAE-20B5B462944C}.Release|x64.Build.0 = Release|Any CPU
19501956
{51000030-6C8E-4138-ACAE-20B5B462944C}.Release|x86.ActiveCfg = Release|Any CPU
19511957
{51000030-6C8E-4138-ACAE-20B5B462944C}.Release|x86.Build.0 = Release|Any CPU
1958+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
1959+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
1960+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|Any CPU.Deploy.0 = Debug|Any CPU
1961+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
1962+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
1963+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM.Deploy.0 = Debug|Any CPU
1964+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU
1965+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU
1966+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM64.Deploy.0 = Debug|Any CPU
1967+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
1968+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
1969+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhone.Deploy.0 = Debug|Any CPU
1970+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
1971+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
1972+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Debug|Any CPU
1973+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
1974+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
1975+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x64.Deploy.0 = Debug|Any CPU
1976+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
1977+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
1978+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x86.Deploy.0 = Debug|Any CPU
1979+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
1980+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|Any CPU.Build.0 = Debug|Any CPU
1981+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|Any CPU.Deploy.0 = Debug|Any CPU
1982+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM.ActiveCfg = Debug|Any CPU
1983+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM.Build.0 = Debug|Any CPU
1984+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM.Deploy.0 = Debug|Any CPU
1985+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM64.ActiveCfg = Debug|Any CPU
1986+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM64.Build.0 = Debug|Any CPU
1987+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM64.Deploy.0 = Debug|Any CPU
1988+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
1989+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhone.Build.0 = Debug|Any CPU
1990+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhone.Deploy.0 = Debug|Any CPU
1991+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
1992+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
1993+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhoneSimulator.Deploy.0 = Debug|Any CPU
1994+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x64.ActiveCfg = Debug|Any CPU
1995+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x64.Build.0 = Debug|Any CPU
1996+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x64.Deploy.0 = Debug|Any CPU
1997+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x86.ActiveCfg = Debug|Any CPU
1998+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x86.Build.0 = Debug|Any CPU
1999+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x86.Deploy.0 = Debug|Any CPU
2000+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2001+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
2002+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
2003+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM.ActiveCfg = Debug|Any CPU
2004+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM.Build.0 = Debug|Any CPU
2005+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM.Deploy.0 = Debug|Any CPU
2006+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM64.ActiveCfg = Debug|Any CPU
2007+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM64.Build.0 = Debug|Any CPU
2008+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM64.Deploy.0 = Debug|Any CPU
2009+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
2010+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhone.Build.0 = Debug|Any CPU
2011+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhone.Deploy.0 = Debug|Any CPU
2012+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
2013+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
2014+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
2015+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x64.ActiveCfg = Debug|Any CPU
2016+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x64.Build.0 = Debug|Any CPU
2017+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x64.Deploy.0 = Debug|Any CPU
2018+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x86.ActiveCfg = Debug|Any CPU
2019+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x86.Build.0 = Debug|Any CPU
2020+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x86.Deploy.0 = Debug|Any CPU
2021+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
2022+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|Any CPU.Build.0 = Release|Any CPU
2023+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|Any CPU.Deploy.0 = Release|Any CPU
2024+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM.ActiveCfg = Release|Any CPU
2025+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM.Build.0 = Release|Any CPU
2026+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM.Deploy.0 = Release|Any CPU
2027+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM64.ActiveCfg = Release|Any CPU
2028+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM64.Build.0 = Release|Any CPU
2029+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM64.Deploy.0 = Release|Any CPU
2030+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhone.ActiveCfg = Release|Any CPU
2031+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhone.Build.0 = Release|Any CPU
2032+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhone.Deploy.0 = Release|Any CPU
2033+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
2034+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
2035+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
2036+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x64.ActiveCfg = Release|Any CPU
2037+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x64.Build.0 = Release|Any CPU
2038+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x64.Deploy.0 = Release|Any CPU
2039+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x86.ActiveCfg = Release|Any CPU
2040+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x86.Build.0 = Release|Any CPU
2041+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x86.Deploy.0 = Release|Any CPU
19522042
EndGlobalSection
19532043
GlobalSection(SolutionProperties) = preSolution
19542044
HideSolutionNode = FALSE
@@ -1991,6 +2081,8 @@ Global
19912081
{A55476B4-70CC-4B7A-B595-0A72B45DAAAD} = {D90C288D-C775-4132-92DE-43162CA3BE72}
19922082
{6F6AD010-EE71-40E4-9D63-AFF797739DA6} = {B78B452F-A57F-4968-9FBD-365F744D131C}
19932083
{51000030-6C8E-4138-ACAE-20B5B462944C} = {B78B452F-A57F-4968-9FBD-365F744D131C}
2084+
{19832957-3859-4FC3-9D41-1BD9CE005998} = {F9D0B2A7-F4F0-4147-B64C-3D9FE244A898}
2085+
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6} = {19832957-3859-4FC3-9D41-1BD9CE005998}
19942086
EndGlobalSection
19952087
GlobalSection(ExtensibilityGlobals) = postSolution
19962088
SolutionGuid = {9CF08746-3F6B-4A63-A043-F66E12D202B0}

Xamarin/Cinephile/Cinephile.Core/Rest/Dtos/ImageConfigurations/ImageConfigurationDto.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Diagnostics.CodeAnalysis;
9-
using Newtonsoft.Json;
9+
using System.Text.Json.Serialization;
1010

1111
namespace Cinephile.Core.Rest.Dtos.ImageConfigurations
1212
{
@@ -18,13 +18,13 @@ public class ImageConfigurationDto
1818
/// <summary>
1919
/// Gets or sets the image data.
2020
/// </summary>
21-
[JsonProperty(PropertyName ="images")]
21+
[JsonPropertyName("images")]
2222
public ImagesDto Images { get; set; }
2323

2424
/// <summary>
2525
/// Gets or sets the change keys.
2626
/// </summary>
27-
[JsonProperty(PropertyName = "change_keys")]
27+
[JsonPropertyName("change_keys")]
2828
[SuppressMessage("Design", "CA2227: Change to be read-only by removing the property setter.", Justification = "Used in DTO object.")]
2929
public IList<string> ChangeKeys { get; set; }
3030
}

Xamarin/Cinephile/Cinephile.Core/Rest/Dtos/ImageConfigurations/ImagesDto.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Diagnostics.CodeAnalysis;
9-
using Newtonsoft.Json;
9+
using System.Text.Json.Serialization;
1010

1111
namespace Cinephile.Core.Rest.Dtos.ImageConfigurations
1212
{
@@ -19,43 +19,43 @@ public class ImagesDto
1919
/// <summary>
2020
/// Gets or sets the base url to the image.
2121
/// </summary>
22-
[JsonProperty(PropertyName = "base_url")]
22+
[JsonPropertyName("base_url")]
2323
public string BaseUrl { get; set; }
2424

2525
/// <summary>
2626
/// Gets or sets the url to the secure image location.
2727
/// </summary>
28-
[JsonProperty(PropertyName = "secure_base_url")]
28+
[JsonPropertyName("secure_base_url")]
2929
public string SecureBaseUrl { get; set; }
3030

3131
/// <summary>
3232
/// Gets or sets the backdrop sizes.
3333
/// </summary>
34-
[JsonProperty(PropertyName = "backdrop_sizes")]
34+
[JsonPropertyName("backdrop_sizes")]
3535
public IList<string> BackdropSizes { get; set; }
3636

3737
/// <summary>
3838
/// Gets or sets the logo sizes.
3939
/// </summary>
40-
[JsonProperty(PropertyName = "logo_sizes")]
40+
[JsonPropertyName("logo_sizes")]
4141
public IList<string> LogoSizes { get; set; }
4242

4343
/// <summary>
4444
/// Gets or sets the poster sizes.
4545
/// </summary>
46-
[JsonProperty(PropertyName = "poster_sizes")]
46+
[JsonPropertyName("poster_sizes")]
4747
public IList<string> PosterSizes { get; set; }
4848

4949
/// <summary>
5050
/// Gets or sets the profile sizes.
5151
/// </summary>
52-
[JsonProperty(PropertyName = "profile_sizes")]
52+
[JsonPropertyName("profile_sizes")]
5353
public IList<string> ProfileSizes { get; set; }
5454

5555
/// <summary>
5656
/// Gets or sets the still sizes.
5757
/// </summary>
58-
[JsonProperty(PropertyName = "still_sizes")]
58+
[JsonPropertyName("still_sizes")]
5959
public IList<string> StillSizes { get; set; }
6060
}
6161
}

Xamarin/Cinephile/Cinephile.Core/Rest/Dtos/Movies/MovieResult.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Diagnostics.CodeAnalysis;
9-
using Newtonsoft.Json;
9+
using System.Text.Json.Serialization;
1010

1111
namespace Cinephile.Core.Rest.Dtos.Movies
1212
{
@@ -18,7 +18,7 @@ public class MovieResult
1818
/// <summary>
1919
/// Gets or sets the poster path.
2020
/// </summary>
21-
[JsonProperty("poster_path")]
21+
[JsonPropertyName("poster_path")]
2222
public string PosterPath { get; set; }
2323

2424
/// <summary>
@@ -34,13 +34,13 @@ public class MovieResult
3434
/// <summary>
3535
/// Gets or sets the release date of the movie.
3636
/// </summary>
37-
[JsonProperty("release_date")]
37+
[JsonPropertyName("release_date")]
3838
public string ReleaseDate { get; set; }
3939

4040
/// <summary>
4141
/// Gets or sets a list of genre id that are associated with the movie.
4242
/// </summary>
43-
[JsonProperty("genre_ids")]
43+
[JsonPropertyName("genre_ids")]
4444
[SuppressMessage("Design", "CA2227: Change to be read-only by removing the property setter.", Justification = "Used in DTO object.")]
4545
public IList<int> GenreIds { get; set; }
4646

maui/Cinephile/Cinephile/App.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:Cinephile"
5+
x:Class="Cinephile.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>

maui/Cinephile/Cinephile/App.xaml.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace Cinephile
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = AppBootstrapper.CreateMainPage();
10+
}
11+
12+
protected override void OnStart()
13+
{
14+
}
15+
16+
protected override void OnSleep()
17+
{
18+
}
19+
20+
protected override void OnResume()
21+
{
22+
}
23+
}
24+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved.
2+
// Licensed to the .NET Foundation under one or more agreements.
3+
// The .NET Foundation licenses this file to you under the MIT license.
4+
// See the LICENSE file in the project root for full license information.
5+
6+
using System.Diagnostics.Metrics;
7+
using Cinephile.Core.Models;
8+
using Cinephile.Core.Rest;
9+
using Cinephile.ViewModels;
10+
using Cinephile.Views;
11+
using ReactiveUI;
12+
using Splat;
13+
14+
namespace Cinephile
15+
{
16+
/// <summary>
17+
/// The app bootstrapper which is used to register everything with the Splat service locator.
18+
/// </summary>
19+
public static class AppBootstrapper
20+
{
21+
/// <summary>
22+
/// Registers everything with the Splat service locator.
23+
/// </summary>
24+
public static MauiAppBuilder UseAppBootstrapper(this MauiAppBuilder builder)
25+
{
26+
var router = new RoutingState();
27+
var screen = new AppBootstrapScreen(router);
28+
Locator.CurrentMutable.RegisterConstant(screen, typeof(IScreen));
29+
Locator.CurrentMutable.Register(() => new UpcomingMoviesListView(), typeof(IViewFor<UpcomingMoviesListViewModel>));
30+
Locator.CurrentMutable.Register(() => new UpcomingMoviesCellView(), typeof(IViewFor<UpcomingMoviesCellViewModel>));
31+
Locator.CurrentMutable.Register(() => new MovieDetailView(), typeof(IViewFor<MovieDetailViewModel>));
32+
Locator.CurrentMutable.Register(() => new AboutView(), typeof(IViewFor<AboutViewModel>));
33+
34+
Locator.CurrentMutable.Register(() => new Cache(), typeof(ICache));
35+
Locator.CurrentMutable.Register(() => new ApiService(), typeof(IApiService));
36+
Locator.CurrentMutable.Register(() => new MovieService(), typeof(IMovieService));
37+
38+
router
39+
.NavigateAndReset
40+
.Execute(new UpcomingMoviesListViewModel())
41+
.Subscribe();
42+
43+
return builder;
44+
}
45+
46+
/// <summary>
47+
/// Creates the first main page used within the application.
48+
/// </summary>
49+
/// <returns>The page generated.</returns>
50+
public static Page CreateMainPage()
51+
{
52+
// NB: This returns the opening page that the platform-specific
53+
// boilerplate code will look for. It will know to find us because
54+
// we've registered our AppBootstrapScreen.
55+
return new ReactiveUI.Maui.RoutedViewHost();
56+
}
57+
58+
/// <summary>
59+
/// The app bootstrap screen is the central location for the RoutingState used for routing between views.
60+
/// </summary>
61+
private class AppBootstrapScreen : ReactiveObject, IScreen
62+
{
63+
/// <summary>
64+
/// Initializes a new instance of the <see cref="AppBootstrapScreen"/> class.
65+
/// </summary>
66+
public AppBootstrapScreen(RoutingState router)
67+
{
68+
Router = router;
69+
}
70+
71+
/// <summary>
72+
/// Gets or sets the router which is used to navigate between views.
73+
/// </summary>
74+
public RoutingState Router { get; protected set; }
75+
}
76+
}
77+
}

0 commit comments

Comments
 (0)