Skip to content

Commit c4fdc5b

Browse files
committed
chore: added settings content
1 parent e8b6859 commit c4fdc5b

File tree

7 files changed

+118
-46
lines changed

7 files changed

+118
-46
lines changed

src/DevTKSS.Uno.Samples.MvuxGallery/App.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.Text.Json;
2+
using Microsoft.Extensions.Configuration;
23
using Uno.Resizetizer;
4+
using Windows.Media.Capture.Frames;
35

46
namespace DevTKSS.Uno.Samples.MvuxGallery;
57
public partial class App : Application
@@ -61,9 +63,9 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
6163
.UseConfiguration(configure: configBuilder =>
6264
configBuilder
6365
.EmbeddedSource<App>()
66+
.EmbeddedSource<App>("sampledata")
6467
.Section<AppConfig>()
6568

66-
.EmbeddedSource<App>("sampledata")
6769
.Section<CodeSampleOptionsConfiguration>("DashboardSampleConfiguration")
6870
.Section<CodeSampleOptionsConfiguration>("MainSampleConfiguration")
6971
.Section<CodeSampleOptionsConfiguration>("ListboardSampleConfiguration")
@@ -78,6 +80,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
7880

7981
.AddSingleton<IGalleryImageService, GalleryImageService>()
8082
.AddSingleton<ICodeSampleService, CodeSampleService>()
83+
8184
)
8285
.UseNavigation(ReactiveViewModelMappings.ViewModelMappings, RegisterRoutes)
8386
.UseSerialization((context, services) =>

src/DevTKSS.Uno.Samples.MvuxGallery/Assets/Samples/CodeSampleService.cs.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace DevTKSS.Uno.Samples.MvuxGallery.Models.CodeSamples;
22

3-
4-
53
public record CodeSampleService : ICodeSampleService
64
{
75
public CodeSampleService(
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<Page x:Class="DevTKSS.Uno.Samples.MvuxGallery.Presentation.Views.MainPage"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="using:DevTKSS.Uno.Samples.MvuxGallery.Presentation.Views"
5+
xmlns:uen="using:Uno.Extensions.Navigation.UI"
6+
xmlns:utu="using:Uno.Toolkit.UI"
7+
xmlns:um="using:Uno.Material"
8+
xmlns:ctk="using:CommunityToolkit.WinUI.Converters"
9+
uen:Region.Name="Main"
10+
NavigationCacheMode="Required"
11+
Background="{ThemeResource BackgroundBrush}">
12+
13+
<Page.Resources>
14+
<ctk:BoolNegationConverter x:Name="InvertBoolConv"/>
15+
</Page.Resources>
16+
<Grid x:Name="MainContentGrid"
17+
uen:Region.Attached="True">
18+
<Grid.RowDefinitions>
19+
<RowDefinition Height="Auto"/>
20+
<RowDefinition Height="*"/>
21+
</Grid.RowDefinitions>
22+
23+
<utu:NavigationBar x:Name="NavBar"
24+
Grid.Row="0"
25+
HorizontalAlignment="Stretch"
26+
HorizontalContentAlignment="Center"
27+
VerticalContentAlignment="Center"
28+
VerticalAlignment="Top"
29+
Content="{Binding Path=AppTitle, Mode=OneWay}"
30+
MainCommandMode="Action"
31+
Background="{ThemeResource PrimaryContainerBrush}"
32+
Foreground="{ThemeResource OnPrimaryContainerBrush}">
33+
<utu:NavigationBar.MainCommand>
34+
<AppBarButton Icon="GlobalNavigationButton"
35+
Command="{x:Bind NavView.IsPaneOpen, Converter={StaticResource InvertBoolConv}}"
36+
Width="{x:Bind NavView.CompactPaneLength, Mode=OneWay}"
37+
HorizontalContentAlignment="Center"/>
38+
</utu:NavigationBar.MainCommand>
39+
</utu:NavigationBar>
40+
41+
<NavigationView x:Name="NavView"
42+
IsBackButtonVisible="Collapsed"
43+
IsPaneToggleButtonVisible="False"
44+
Grid.Row="1"
45+
PaneDisplayMode="LeftCompact"
46+
uen:Region.Attached="True"
47+
HorizontalAlignment="Stretch">
48+
<NavigationView.MenuItems>
49+
<NavigationViewItem x:Name="NavItemDashboard"
50+
Content="Home"
51+
uen:Region.Name="Dashboard"
52+
Icon="Home" />
53+
<NavigationViewItem x:Name="NavItemCounter"
54+
Content="Counter"
55+
Icon="Calculator"
56+
uen:Region.Name="Counter" />
57+
58+
<NavigationViewItem Content="List View"
59+
uen:Region.Name="Listboard"
60+
Icon="List" />
61+
<NavigationViewItem Content="Let's play Cards!"
62+
uen:Region.Name="SimpleCards"
63+
Icon="Page" />
64+
</NavigationView.MenuItems>
65+
66+
<NavigationView.Content>
67+
<Grid x:Name="NavigationViewContentGrid"
68+
uen:Region.Attached="True"
69+
uen:Region.Navigator="Visibility"
70+
Visibility="Visible"/>
71+
</NavigationView.Content>
72+
</NavigationView>
73+
</Grid>
74+
75+
</Page>

src/DevTKSS.Uno.Samples.MvuxGallery/DevTKSS.Uno.Samples.MvuxGallery.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,8 @@
5656
<Resource Include="Assets\Samples\*" CopyToOutputDirectory="PerserveNewest" />
5757
<UnoSplashScreen Include="Assets\SplashScreens\*" />
5858
</ItemGroup>
59+
<ItemGroup>
60+
<Resource Remove="Assets\Samples\MainPage.xaml.txt" />
61+
</ItemGroup>
5962

6063
</Project>

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/MainModel.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
namespace DevTKSS.Uno.Samples.MvuxGallery.Presentation.ViewModels;
44
public partial record MainModel
55
{
6-
private readonly INavigator _navigator;
76
private readonly ILocalizationService _localizationService;
87
private readonly IStringLocalizer _stringLocalizer;
98

109
public MainModel(
11-
IOptions<AppConfig> appInfo,
12-
INavigator navigator,
1310
ILocalizationService localizationService,
1411
IStringLocalizer stringLocalizer)
1512
{
16-
_navigator = navigator;
1713
_localizationService = localizationService;
1814
_stringLocalizer = stringLocalizer;
1915

src/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/MainPage.xaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
<Grid x:Name="MainContentGrid"
1717
uen:Region.Attached="True">
1818
<Grid.RowDefinitions>
19-
<RowDefinition Height="Auto"/>
20-
<!--<RowDefinition Height="Auto"/>-->
19+
<RowDefinition Height="Auto" />
2120
<RowDefinition Height="*"/>
2221
</Grid.RowDefinitions>
2322

@@ -50,31 +49,27 @@
5049
<NavigationViewItem x:Name="NavItemDashboard"
5150
Content="Home"
5251
uen:Region.Name="Dashboard"
53-
Icon="Home"/>
52+
Icon="Home" />
5453
<NavigationViewItem x:Name="NavItemCounter"
5554
Content="Counter"
5655
Icon="Calculator"
57-
uen:Region.Name="Counter"/>
56+
uen:Region.Name="Counter" />
5857

5958
<NavigationViewItem Content="List View"
6059
uen:Region.Name="Listboard"
61-
Icon="List"/>
60+
Icon="List" />
6261
<NavigationViewItem Content="Let's play Cards!"
6362
uen:Region.Name="SimpleCards"
64-
Icon="Card"/>
63+
Icon="Page" />
6564
</NavigationView.MenuItems>
6665

6766
<NavigationView.Content>
6867
<Grid x:Name="NavigationViewContentGrid"
6968
uen:Region.Attached="True"
7069
uen:Region.Navigator="Visibility"
71-
Visibility="Visible">
72-
73-
74-
</Grid>
70+
Visibility="Visible"/>
7571
</NavigationView.Content>
7672
</NavigationView>
77-
7873
</Grid>
7974

8075
</Page>

src/DevTKSS.Uno.Samples.MvuxGallery/appsettings.sampledata.json

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
{
22
"DashboardSampleConfiguration": {
3-
"Samples": {
4-
"C# in Model": {
5-
"FilePath": "Assets/Samples/ModelBinding-Sample.cs.txt",
6-
"LineRanges": []
7-
},
8-
"DI Service Resw": {
9-
"FilePath": "Assets/Samples/GalleryImageService-resw.cs.txt",
10-
"LineRanges": []
11-
},
12-
"DI Service without Resw": {
13-
"FilePath": "Assets/Samples/GalleryImageService-noResw.cs.txt",
14-
"LineRanges": []
15-
},
16-
"C# Record": {
17-
"FilePath": "Assets/Samples/GalleryImageModel.cs.txt",
18-
"LineRanges": []
19-
},
20-
"XAML DataTemplate": {
21-
"FilePath": "Assets/Samples/Card-GalleryImage.DataTemplate.xaml.txt",
22-
"LineRanges": []
23-
},
24-
"FeedView + GridView XAML": {
25-
"FilePath": "Assets/Samples/FeedView-GridView-Sample.xaml.txt",
26-
"LineRanges": []
27-
}
3+
"C# in Model": {
4+
"Description": "This sample shows how to use a model with properties that are bound to the view. The model is a simple class with properties that are used in the view.",
5+
"FilePath": "Assets/Samples/ModelBinding-Sample.cs.txt",
6+
"LineRanges": []
7+
},
8+
"DI Service Resw": {
9+
"FilePath": "Assets/Samples/GalleryImageService-resw.cs.txt",
10+
"LineRanges": []
11+
},
12+
"DI Service without Resw": {
13+
"FilePath": "Assets/Samples/GalleryImageService-noResw.cs.txt",
14+
"LineRanges": []
15+
},
16+
"C# Record": {
17+
"FilePath": "Assets/Samples/GalleryImageModel.cs.txt",
18+
"LineRanges": []
19+
},
20+
"XAML DataTemplate": {
21+
"FilePath": "Assets/Samples/Card-GalleryImage.DataTemplate.xaml.txt",
22+
"LineRanges": []
23+
},
24+
"FeedView + GridView XAML": {
25+
"FilePath": "Assets/Samples/FeedView-GridView-Sample.xaml.txt",
26+
"LineRanges": []
2827
}
2928
},
30-
"MainSampleConfiguration" {
31-
"NavigationView XAML",
32-
"C# in Model"
29+
"MainSampleConfiguration": {
30+
"NavigationView XAML": {
31+
"Description": "This sample shows how to use the NavigationView control from Uno.Extensions.Navigation.UI. The NavigationView is used to navigate between different pages in the app, but enables to do this just by using xaml, making it optional to do so with csharp.",
32+
"FilePath": "Assets/Samples/MainPage.xaml.txt",
33+
"LineRanges": []
34+
}
3335
},
3436
"ListboardSampleConfiguration": {
3537
"FeedView + ListView XAML": {

0 commit comments

Comments
 (0)