Skip to content

Commit 35dd6db

Browse files
Rating view (#2191)
1 parent 9fe4f3b commit 35dd6db

25 files changed

+3633
-30
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,4 @@
225225
<PropertyGroup Condition="('$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true') and $([MSBuild]::IsOSPlatform('windows')) == 'true'">
226226
<IncludeTizenTargetFrameworks>true</IncludeTizenTargetFrameworks>
227227
</PropertyGroup>
228-
</Project>
228+
</Project>

samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public partial class AppShell : Shell
135135
CreateViewModelMapping<PopupLayoutAlignmentPage, PopupLayoutAlignmentViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
136136
CreateViewModelMapping<PopupPositionPage, PopupPositionViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
137137
CreateViewModelMapping<PopupSizingIssuesPage, PopupSizingIssuesViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
138+
CreateViewModelMapping<RatingViewCsharpPage, RatingViewCsharpViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
139+
CreateViewModelMapping<RatingViewShowcasePage, RatingViewShowcaseViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
140+
CreateViewModelMapping<RatingViewXamlPage, RatingViewXamlViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
138141
CreateViewModelMapping<SemanticOrderViewPage, SemanticOrderViewPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
139142
CreateViewModelMapping<ShowPopupInOnAppearingPage, ShowPopupInOnAppearingPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
140143
CreateViewModelMapping<StylePopupPage, StylePopupViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),

samples/CommunityToolkit.Maui.Sample/MauiProgram.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,32 +89,31 @@ public static MauiApp CreateMauiApp()
8989
fonts.AddFont("Font Awesome 6 Brands-Regular-400.otf", FontFamilies.FontAwesomeBrands);
9090
});
9191

92-
9392
builder.ConfigureLifecycleEvents(events =>
9493
{
9594
#if WINDOWS10_0_17763_0_OR_GREATER
96-
events.AddWindows(static windowLifeCycleBuilder =>
97-
{
98-
windowLifeCycleBuilder.OnWindowCreated(window =>
99-
{
100-
window.SystemBackdrop = new MicaBackdrop { Kind = MicaKind.Base };
95+
events.AddWindows(static windowLifeCycleBuilder =>
96+
{
97+
windowLifeCycleBuilder.OnWindowCreated(window =>
98+
{
99+
window.SystemBackdrop = new MicaBackdrop { Kind = MicaKind.Base };
101100

102-
var titleBar = window.GetAppWindow()?.TitleBar ?? throw new InvalidOperationException("App Window Cannot be Null");
101+
var titleBar = window.GetAppWindow()?.TitleBar ?? throw new InvalidOperationException("App Window Cannot be Null");
103102

104-
titleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
103+
titleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
105104

106-
window.ExtendsContentIntoTitleBar = false;
105+
window.ExtendsContentIntoTitleBar = false;
107106

108-
IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
109-
WindowId win32WindowsId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle);
110-
AppWindow winuiAppWindow = AppWindow.GetFromWindowId(win32WindowsId);
107+
IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
108+
WindowId win32WindowsId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle);
109+
AppWindow winuiAppWindow = AppWindow.GetFromWindowId(win32WindowsId);
111110

112-
if (winuiAppWindow.Presenter is OverlappedPresenter p)
113-
{
114-
p.SetBorderAndTitleBar(true, true);
115-
}
116-
});
117-
});
111+
if (winuiAppWindow.Presenter is OverlappedPresenter p)
112+
{
113+
p.SetBorderAndTitleBar(true, true);
114+
}
115+
});
116+
});
118117
#endif
119118
});
120119

@@ -148,7 +147,6 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
148147
services.AddTransient<ViewsGalleryPage, ViewsGalleryViewModel>();
149148
services.AddTransient<PlatformSpecificGalleryPage, PlatformSpecificGalleryViewModel>();
150149

151-
152150
// Add Alerts Pages + ViewModels
153151
services.AddTransientWithShellRoute<SnackbarPage, SnackbarViewModel>();
154152
services.AddTransientWithShellRoute<ToastPage, ToastViewModel>();
@@ -261,6 +259,9 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
261259
services.AddTransientWithShellRoute<PopupAnchorPage, PopupAnchorViewModel>();
262260
services.AddTransientWithShellRoute<PopupLayoutAlignmentPage, PopupLayoutAlignmentViewModel>();
263261
services.AddTransientWithShellRoute<PopupPositionPage, PopupPositionViewModel>();
262+
services.AddTransientWithShellRoute<RatingViewCsharpPage, RatingViewCsharpViewModel>();
263+
services.AddTransientWithShellRoute<RatingViewShowcasePage, RatingViewShowcaseViewModel>();
264+
services.AddTransientWithShellRoute<RatingViewXamlPage, RatingViewXamlViewModel>();
264265
services.AddTransientWithShellRoute<SemanticOrderViewPage, SemanticOrderViewPageViewModel>();
265266
services.AddTransientWithShellRoute<ShowPopupInOnAppearingPage, ShowPopupInOnAppearingPageViewModel>();
266267
services.AddTransientWithShellRoute<StylePopupPage, StylePopupViewModel>();

0 commit comments

Comments
 (0)