Skip to content

Commit 9903bca

Browse files
committed
feat: Implement initial MAUI application structure including AppShell, a TimerPage, and shared UI styles.
1 parent e9363d3 commit 9903bca

35 files changed

Lines changed: 86 additions & 1909 deletions

NowPlus.Cross/AppShell.xaml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@
88
Shell.FlyoutBehavior="Flyout"
99
Title="NowPlus.Cross">
1010

11-
<ShellContent
12-
Title="Dashboard"
13-
Icon="{StaticResource IconDashboard}"
14-
ContentTemplate="{DataTemplate pages:MainPage}"
15-
Route="main" />
16-
17-
<ShellContent
18-
Title="Projects"
19-
Icon="{StaticResource IconProjects}"
20-
ContentTemplate="{DataTemplate pages:ProjectListPage}"
21-
Route="projects" />
22-
2311
<ShellContent
2412
Title="Clock"
2513
Icon="{StaticResource IconClock}"
@@ -38,25 +26,4 @@
3826
ContentTemplate="{DataTemplate pages:TimerPage}"
3927
Route="timer" />
4028

41-
<ShellContent
42-
Title="Manage Meta"
43-
Icon="{StaticResource IconMeta}"
44-
ContentTemplate="{DataTemplate pages:ManageMetaPage}"
45-
Route="manage" />
46-
47-
<Shell.FlyoutFooter>
48-
<Grid Padding="15">
49-
<sf:SfSegmentedControl x:Name="ThemeSegmentedControl"
50-
VerticalOptions="Center" HorizontalOptions="Center" SelectionChanged="SfSegmentedControl_SelectionChanged"
51-
SegmentWidth="40" SegmentHeight="40">
52-
<sf:SfSegmentedControl.ItemsSource>
53-
<x:Array Type="{x:Type sf:SfSegmentItem}">
54-
<sf:SfSegmentItem ImageSource="{StaticResource IconLight}" SemanticProperties.Description="Light mode"/>
55-
<sf:SfSegmentItem ImageSource="{StaticResource IconDark}" SemanticProperties.Description="Dark mode"/>
56-
</x:Array>
57-
</sf:SfSegmentedControl.ItemsSource>
58-
</sf:SfSegmentedControl>
59-
</Grid>
60-
</Shell.FlyoutFooter>
61-
6229
</Shell>

NowPlus.Cross/AppShell.xaml.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ public partial class AppShell : Shell
99
public AppShell()
1010
{
1111
InitializeComponent();
12-
var currentTheme = Application.Current!.RequestedTheme;
13-
ThemeSegmentedControl.SelectedIndex = currentTheme == AppTheme.Light ? 0 : 1;
1412
}
1513
public static async Task DisplaySnackbarAsync(string message)
1614
{
@@ -43,9 +41,5 @@ public static async Task DisplayToastAsync(string message)
4341
await toast.Show(cts.Token);
4442
}
4543

46-
private void SfSegmentedControl_SelectionChanged(object? sender, Syncfusion.Maui.Toolkit.SegmentedControl.SelectionChangedEventArgs e)
47-
{
48-
Application.Current!.UserAppTheme = e.NewIndex == 0 ? AppTheme.Light : AppTheme.Dark;
49-
}
5044
}
5145
}

NowPlus.Cross/MauiProgram.cs

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using CommunityToolkit.Maui;
22
using Microsoft.Extensions.Logging;
33
using Syncfusion.Maui.Toolkit.Hosting;
4+
using NowPlus.Cross.PageModels;
5+
using NowPlus.Cross.Pages;
46

57
namespace NowPlus.Cross
68
{
@@ -13,23 +15,6 @@ public static MauiApp CreateMauiApp()
1315
.UseMauiApp<App>()
1416
.UseMauiCommunityToolkit()
1517
.ConfigureSyncfusionToolkit()
16-
.ConfigureMauiHandlers(handlers =>
17-
{
18-
#if WINDOWS
19-
Microsoft.Maui.Controls.Handlers.Items.CollectionViewHandler.Mapper.AppendToMapping("KeyboardAccessibleCollectionView", (handler, view) =>
20-
{
21-
handler.PlatformView.SingleSelectionFollowsFocus = false;
22-
});
23-
24-
Microsoft.Maui.Handlers.ContentViewHandler.Mapper.AppendToMapping(nameof(Pages.Controls.CategoryChart), (handler, view) =>
25-
{
26-
if (view is Pages.Controls.CategoryChart && handler.PlatformView is Microsoft.Maui.Platform.ContentPanel contentPanel)
27-
{
28-
contentPanel.IsTabStop = true;
29-
}
30-
});
31-
#endif
32-
})
3318
.ConfigureFonts(fonts =>
3419
{
3520
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
@@ -43,15 +28,6 @@ public static MauiApp CreateMauiApp()
4328
builder.Services.AddLogging(configure => configure.AddDebug());
4429
#endif
4530

46-
builder.Services.AddSingleton<ProjectRepository>();
47-
builder.Services.AddSingleton<TaskRepository>();
48-
builder.Services.AddSingleton<CategoryRepository>();
49-
builder.Services.AddSingleton<TagRepository>();
50-
builder.Services.AddSingleton<SeedDataService>();
51-
builder.Services.AddSingleton<ModalErrorHandler>();
52-
builder.Services.AddSingleton<MainPageModel>();
53-
builder.Services.AddSingleton<ProjectListPageModel>();
54-
builder.Services.AddSingleton<ManageMetaPageModel>();
5531
builder.Services.AddSingleton<ClockPageModel>();
5632
builder.Services.AddSingleton<StopwatchPageModel>();
5733
builder.Services.AddSingleton<TimerPageModel>();
@@ -60,9 +36,6 @@ public static MauiApp CreateMauiApp()
6036
builder.Services.AddSingleton<StopwatchPage>();
6137
builder.Services.AddSingleton<TimerPage>();
6238

63-
builder.Services.AddTransientWithShellRoute<ProjectDetailPage, ProjectDetailPageModel>("project");
64-
builder.Services.AddTransientWithShellRoute<TaskDetailPage, TaskDetailPageModel>("task");
65-
6639
return builder.Build();
6740
}
6841
}

NowPlus.Cross/PageModels/IProjectTaskPageModel.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

NowPlus.Cross/PageModels/MainPageModel.cs

Lines changed: 0 additions & 177 deletions
This file was deleted.

0 commit comments

Comments
 (0)