mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 09:14:25 +08:00
0.7.3.1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Avalonia.Controls;
|
||||
using LanMountainDesktop.PluginSdk;
|
||||
using LanMountainDesktop.Services.Settings;
|
||||
using LanMountainDesktop.ViewModels;
|
||||
@@ -15,7 +16,7 @@ namespace LanMountainDesktop.Views.SettingsPages;
|
||||
public partial class PluginsSettingsPage : SettingsPageBase
|
||||
{
|
||||
public PluginsSettingsPage()
|
||||
: this(new PluginsSettingsPageViewModel(HostSettingsFacadeProvider.GetOrCreate()))
|
||||
: this(Design.IsDesignMode ? CreateDesignTimeViewModel() : new PluginsSettingsPageViewModel(HostSettingsFacadeProvider.GetOrCreate()))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,6 +32,11 @@ public partial class PluginsSettingsPage : SettingsPageBase
|
||||
|
||||
public override async void OnNavigatedTo(object? parameter)
|
||||
{
|
||||
if (Design.IsDesignMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await ViewModel.InitializeAsync();
|
||||
}
|
||||
|
||||
@@ -38,4 +44,47 @@ public partial class PluginsSettingsPage : SettingsPageBase
|
||||
{
|
||||
RequestRestart(ViewModel.RestartRequiredMessage);
|
||||
}
|
||||
|
||||
private static PluginsSettingsPageViewModel CreateDesignTimeViewModel()
|
||||
{
|
||||
var viewModel = new PluginsSettingsPageViewModel(HostSettingsFacadeProvider.GetOrCreate());
|
||||
viewModel.InstalledPlugins.Add(new InstalledPluginItemViewModel(new InstalledPluginInfo(
|
||||
new PluginManifest(
|
||||
"calendar-plus",
|
||||
"Calendar Plus",
|
||||
"CalendarPlus.dll",
|
||||
"Adds a compact agenda widget and richer date cards.",
|
||||
"LanMountain Labs",
|
||||
"1.4.0"),
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
null)));
|
||||
viewModel.InstalledPlugins.Add(new InstalledPluginItemViewModel(new InstalledPluginInfo(
|
||||
new PluginManifest(
|
||||
"focus-mode",
|
||||
"Focus Mode",
|
||||
"FocusMode.dll",
|
||||
"Provides a distraction-free overlay and quick toggles.",
|
||||
"Studio North",
|
||||
"0.9.2"),
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
null)));
|
||||
viewModel.InstalledPlugins.Add(new InstalledPluginItemViewModel(new InstalledPluginInfo(
|
||||
new PluginManifest(
|
||||
"notes-dock",
|
||||
"Notes Dock",
|
||||
"NotesDock.dll",
|
||||
"Pins short markdown notes directly on the desktop.",
|
||||
"Aster Team",
|
||||
"2.1.0"),
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
null)));
|
||||
viewModel.StatusMessage = "Loaded 3 mocked plugins for Avalonia design mode.";
|
||||
return viewModel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user