Skip to content

Commit cd3129b

Browse files
committed
feat(MvuxListViewSample): Add Sampleapp from Mvux ListView Tutorial
1 parent 72b4c90 commit cd3129b

34 files changed

+1152
-1
lines changed

.vscode/launch.json

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

.vscode/tasks.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,32 @@
7878
"/consoleloggerparameters:NoSummary"
7979
],
8080
"problemMatcher": "$msCompile"
81+
},
82+
{
83+
"label": "build-desktop MvuxListApp",
84+
"command": "dotnet",
85+
"type": "process",
86+
"args": [
87+
"build",
88+
"${workspaceFolder}/MvuxListApp/MvuxListApp.csproj",
89+
"/property:GenerateFullPaths=true",
90+
"/property:TargetFramework=net9.0-desktop",
91+
"/consoleloggerparameters:NoSummary"
92+
],
93+
"problemMatcher": "$msCompile"
94+
},
95+
{
96+
"label": "publish-desktop MvuxListApp",
97+
"command": "dotnet",
98+
"type": "process",
99+
"args": [
100+
"publish",
101+
"${workspaceFolder}/MvuxListApp/MvuxListApp.csproj",
102+
"/property:GenerateFullPaths=true",
103+
"/property:TargetFramework=net9.0-desktop",
104+
"/consoleloggerparameters:NoSummary"
105+
],
106+
"problemMatcher": "$msCompile"
81107
}
82108
]
83109
}

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.SampleApps.slnx",
44
"projects": [
5-
"DevTKSS.Uno.XamlNavigationApp\\DevTKSS.Uno.XamlNavigationApp.csproj"
5+
"DevTKSS.Uno.XamlNavigationApp\\DevTKSS.Uno.XamlNavigationApp.csproj",
6+
"MvuxListApp\\MvuxListApp.csproj"
67
]
78
}
89
}

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
Lines changed: 137 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)