Skip to content

Commit 8f7eb98

Browse files
committed
feat(MvuxListViewSample): Add Sampleapp from Mvux ListView Tutorial
1 parent 672b81c commit 8f7eb98

35 files changed

+1179
-1
lines changed

src/.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,25 @@
4444
"console": "internalConsole",
4545
"stopAtEntry": false
4646
},
47+
{
48+
// Use IntelliSense to find out which attributes exist for C# debugging
49+
// Use hover for the description of the existing attributes
50+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
51+
"name": "Uno Platform Desktop Debug (MvuxListApp)",
52+
"type": "coreclr",
53+
"request": "launch",
54+
"preLaunchTask": "build-desktop",
55+
// If you have changed target frameworks, make sure to update the program path.
56+
"program": "${workspaceFolder}/MvuxListApp/bin/Debug/net9.0-desktop/MvuxListApp.dll",
57+
"args": [],
58+
"launchSettingsProfile": "MvuxListApp (Desktop)",
59+
"env": {
60+
"DOTNET_MODIFIABLE_ASSEMBLIES": "debug"
61+
},
62+
"cwd": "${workspaceFolder}/MvuxListApp",
63+
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
64+
"console": "internalConsole",
65+
"stopAtEntry": false
66+
},
4767
]
4868
}

src/.vscode/tasks.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,32 @@
5252
"/consoleloggerparameters:NoSummary"
5353
],
5454
"problemMatcher": "$msCompile"
55+
},
56+
{
57+
"label": "build-desktop MvuxListApp",
58+
"command": "dotnet",
59+
"type": "process",
60+
"args": [
61+
"build",
62+
"${workspaceFolder}/MvuxListApp/MvuxListApp.csproj",
63+
"/property:GenerateFullPaths=true",
64+
"/property:TargetFramework=net9.0-desktop",
65+
"/consoleloggerparameters:NoSummary"
66+
],
67+
"problemMatcher": "$msCompile"
68+
},
69+
{
70+
"label": "publish-desktop MvuxListApp",
71+
"command": "dotnet",
72+
"type": "process",
73+
"args": [
74+
"publish",
75+
"${workspaceFolder}/MvuxListApp/MvuxListApp.csproj",
76+
"/property:GenerateFullPaths=true",
77+
"/property:TargetFramework=net9.0-desktop",
78+
"/consoleloggerparameters:NoSummary"
79+
],
80+
"problemMatcher": "$msCompile"
5581
}
5682
]
5783
}

src/DevTKSS.Uno.SampleApps-Tutorials.slnf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"solution": {
33
"path": "DevTKSS.Uno.Samples.sln",
44
"projects": [
5-
"DevTKSS.Uno.XamlNavigationApp-1\\DevTKSS.Uno.XamlNavigationApp.csproj"
5+
"DevTKSS.Uno.XamlNavigationApp-1\\DevTKSS.Uno.XamlNavigationApp.csproj",
6+
"MvuxListApp\\MvuxListApp.csproj"
67
]
78
}
89
}

src/DevTKSS.Uno.Samples.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ VisualStudioVersion = 17.12.35521.163
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E743ECB2-9BD7-4FBF-B90B-AA75D48758DB}"
77
ProjectSection(SolutionItems) = preProject
8+
..\.editorconfig = ..\.editorconfig
89
.gitignore = .gitignore
910
Directory.Build.props = Directory.Build.props
1011
Directory.Build.targets = Directory.Build.targets
@@ -19,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTKSS.Uno.XamlNavigationA
1920
EndProject
2021
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTKSS.Extensions.Uno.Storage", "DevTKSS.Extensions.Uno.Storage\DevTKSS.Extensions.Uno.Storage.csproj", "{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}"
2122
EndProject
23+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvuxListApp", "MvuxListApp\MvuxListApp.csproj", "{0E9C14E0-567C-0677-1002-D73C19C0F098}"
24+
EndProject
2225
Global
2326
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2427
Debug|Any CPU = Debug|Any CPU
@@ -65,6 +68,30 @@ Global
6568
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x64.Build.0 = Release|Any CPU
6669
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x86.ActiveCfg = Release|Any CPU
6770
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x86.Build.0 = Release|Any CPU
71+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Debug|x64.ActiveCfg = Debug|Any CPU
74+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Debug|x64.Build.0 = Debug|Any CPU
75+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Debug|x86.ActiveCfg = Debug|Any CPU
76+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Debug|x86.Build.0 = Debug|Any CPU
77+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|Any CPU.Build.0 = Release|Any CPU
79+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x64.ActiveCfg = Release|Any CPU
80+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x64.Build.0 = Release|Any CPU
81+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x86.ActiveCfg = Release|Any CPU
82+
{0C51BF5A-7C98-4BE2-3ED6-A5796C06AB8E}.Release|x86.Build.0 = Release|Any CPU
83+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Debug|Any CPU.Build.0 = Debug|Any CPU
85+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Debug|x64.ActiveCfg = Debug|Any CPU
86+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Debug|x64.Build.0 = Debug|Any CPU
87+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Debug|x86.ActiveCfg = Debug|Any CPU
88+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Debug|x86.Build.0 = Debug|Any CPU
89+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Release|Any CPU.ActiveCfg = Release|Any CPU
90+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Release|Any CPU.Build.0 = Release|Any CPU
91+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Release|x64.ActiveCfg = Release|Any CPU
92+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Release|x64.Build.0 = Release|Any CPU
93+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Release|x86.ActiveCfg = Release|Any CPU
94+
{0E9C14E0-567C-0677-1002-D73C19C0F098}.Release|x86.Build.0 = Release|Any CPU
6895
EndGlobalSection
6996
GlobalSection(SolutionProperties) = preSolution
7097
HideSolutionNode = FALSE

src/MvuxListApp/App.xaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Application x:Class="MvuxListApp.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:utum="using:Uno.Toolkit.UI.Material">
5+
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<!-- Load WinUI resources -->
10+
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
11+
<utum:MaterialToolkitTheme
12+
ColorOverrideSource="ms-appx:///Styles/ColorPaletteOverride.xaml">
13+
<!-- NOTE: You can override the default Roboto font by providing your font assets here. -->
14+
<!-- <utum:MaterialToolkitTheme.FontOverrideDictionary>
15+
<ResourceDictionary>
16+
<FontFamily x:Key="MaterialLightFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf#Roboto</FontFamily>
17+
<FontFamily x:Key="MaterialMediumFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf#Roboto</FontFamily>
18+
<FontFamily x:Key="MaterialRegularFontFamily">ms-appx:///Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf#Roboto</FontFamily>
19+
</ResourceDictionary>
20+
</utum:MaterialToolkitTheme.FontOverrideDictionary> -->
21+
</utum:MaterialToolkitTheme>
22+
</ResourceDictionary.MergedDictionaries>
23+
24+
<!-- Add resources here -->
25+
26+
</ResourceDictionary>
27+
</Application.Resources>
28+
29+
</Application>

src/MvuxListApp/App.xaml.cs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
using Uno.Resizetizer;
2+
3+
namespace MvuxListApp;
4+
public partial class App : Application
5+
{
6+
/// <summary>
7+
/// Initializes the singleton application object. This is the first line of authored code
8+
/// executed, and as such is the logical equivalent of main() or WinMain().
9+
/// </summary>
10+
public App()
11+
{
12+
this.InitializeComponent();
13+
}
14+
15+
protected Window? MainWindow { get; private set; }
16+
protected IHost? Host { get; private set; }
17+
18+
protected async override void OnLaunched(LaunchActivatedEventArgs args)
19+
{
20+
var builder = this.CreateBuilder(args)
21+
// Add navigation support for toolkit controls such as TabBar and NavigationView
22+
.UseToolkitNavigation()
23+
.Configure(host => host
24+
#if DEBUG
25+
// Switch to Development environment when running in DEBUG
26+
.UseEnvironment(Environments.Development)
27+
#endif
28+
.UseLogging(configure: (context, logBuilder) =>
29+
{
30+
// Configure log levels for different categories of logging
31+
logBuilder
32+
.SetMinimumLevel(
33+
context.HostingEnvironment.IsDevelopment() ?
34+
LogLevel.Information :
35+
LogLevel.Warning)
36+
37+
// Default filters for core Uno Platform namespaces
38+
.CoreLogLevel(LogLevel.Warning);
39+
40+
// Uno Platform namespace filter groups
41+
// Uncomment individual methods to see more detailed logging
42+
//// Generic Xaml events
43+
//logBuilder.XamlLogLevel(LogLevel.Debug);
44+
//// Layout specific messages
45+
//logBuilder.XamlLayoutLogLevel(LogLevel.Debug);
46+
//// Storage messages
47+
//logBuilder.StorageLogLevel(LogLevel.Debug);
48+
//// Binding related messages
49+
//logBuilder.XamlBindingLogLevel(LogLevel.Debug);
50+
//// Binder memory references tracking
51+
//logBuilder.BinderMemoryReferenceLogLevel(LogLevel.Debug);
52+
//// DevServer and HotReload related
53+
//logBuilder.HotReloadCoreLogLevel(LogLevel.Information);
54+
//// Debug JS interop
55+
//logBuilder.WebAssemblyLogLevel(LogLevel.Debug);
56+
57+
}, enableUnoLogging: true)
58+
.UseConfiguration(configure: configBuilder =>
59+
configBuilder
60+
.EmbeddedSource<App>()
61+
.Section<AppConfig>()
62+
)
63+
.ConfigureServices((context, services) =>
64+
{
65+
// TODO: Register your services
66+
//services.AddSingleton<IMyService, MyService>();
67+
})
68+
.UseNavigation(ReactiveViewModelMappings.ViewModelMappings, RegisterRoutes)
69+
);
70+
MainWindow = builder.Window;
71+
72+
#if DEBUG
73+
MainWindow.UseStudio();
74+
#endif
75+
MainWindow.SetWindowIcon();
76+
77+
Host = await builder.NavigateAsync<Shell>();
78+
}
79+
80+
private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
81+
{
82+
views.Register(
83+
new ViewMap(ViewModel: typeof(ShellModel)),
84+
new ViewMap<MainPage, MainModel>(),
85+
new DataViewMap<SecondPage, SecondModel, Entity>()
86+
);
87+
88+
routes.Register(
89+
new RouteMap("", View: views.FindByViewModel<ShellModel>(),
90+
Nested:
91+
[
92+
new ("Main", View: views.FindByViewModel<MainModel>(), IsDefault:true),
93+
new ("Second", View: views.FindByViewModel<SecondModel>()),
94+
]
95+
)
96+
);
97+
}
98+
}
Lines changed: 42 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)