Amend reading config
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.1.0-beta1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Bitvault.Avalonia\Bitvault.Avalonia.csproj" />
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Bitvault.Avalonia.AllNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="All" />
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class AllNavigationView : NavigationViewItem
|
||||
{
|
||||
public AllNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -1,10 +1,64 @@
|
||||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="Bitvault.Avalonia.App"
|
||||
RequestedThemeVariant="Default">
|
||||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
|
||||
|
||||
<Application
|
||||
x:Class="Bitvault.Avalonia.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
RequestedThemeVariant="Default">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
<ThemeResources />
|
||||
<Style Selector="ui|SettingsExpanderItem">
|
||||
<Style Selector="^ /template/ Expander#Expander">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:footerBottom /template/ ContentPresenter#FooterPresenter">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="ui|SettingsExpander /template/ Expander#Expander ToggleButton">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||||
</Style>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
<Setter Property="BorderThickness" Value="0 0 0 2" />
|
||||
<Style Selector="^:focus">
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0 0 0 2" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="OverlayPopupHost">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<!-- Do not forget to update Templated_Control_With_Popup_In_Template_Should_Set_TemplatedParent test -->
|
||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||
<VisualLayerManager IsPopup="True">
|
||||
<LayoutTransformControl>
|
||||
<LayoutTransformControl.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.4" ScaleY="1.4" />
|
||||
</LayoutTransformControl.LayoutTransform>
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</LayoutTransformControl>
|
||||
</VisualLayerManager>
|
||||
</LayoutTransformControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
<Application.Resources>
|
||||
<Thickness x:Key="TextControlThemePadding">0,5,6,6</Thickness>
|
||||
<FontFamily x:Key="SymbolFontFamily">avares://HyperX.Launcher.Avalonia/Assets/SegoeIcons.ttf#Segoe Fluent Icons</FontFamily>
|
||||
<StaticResource x:Key="TextControlBackground" ResourceKey="ControlFillColorTransparentBrush" />
|
||||
<StaticResource x:Key="TextControlBackgroundPointerOver" ResourceKey="ControlFillColorTransparentBrush" />
|
||||
<x:Double x:Key="SettingsExpanderItemAdaptiveWidthTrigger">0</x:Double>
|
||||
<Thickness x:Key="SettingsExpanderItemBottomFooterMargin">0,8,0,0</Thickness>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Toolkit.Avalonia;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
@@ -10,8 +15,39 @@ public partial class App : Application
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
public override async void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
IHost? host = DefaultBuilder.Create()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddAvalonia();
|
||||
services.AddHandler<AppHandler>();
|
||||
|
||||
//services.AddTransient<IVaultComponent, VaultComponent>();
|
||||
//services.AddInitializer<VaultComponentsCollectionInitializer>();
|
||||
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime)
|
||||
{
|
||||
services.AddTemplate<MainWindowViewModel, MainWindow>("MainWindow");
|
||||
}
|
||||
|
||||
services.AddTemplate<MainViewModel, MainView>("Main");
|
||||
services.AddHandler<MainViewHandler>();
|
||||
|
||||
services.AddTemplate<VaultNavigationViewModel, VaultNavigationView>();
|
||||
services.AddTemplate<AllNavigationViewModel, AllNavigationView>();
|
||||
services.AddTemplate<StarredNavigationViewModel, StarredNavigationView>();
|
||||
services.AddTemplate<CategoriesNavigationViewModel, CategoriesNavigationView>();
|
||||
services.AddTemplate<ArchiveNavigationViewModel, ArchiveNavigationView>();
|
||||
|
||||
services.AddTemplate<VaultViewModel, VaultView>("Vault");
|
||||
|
||||
services.AddConfiguration<VaultConfiguration>(args => args.Name = "foo1", $"{nameof(VaultConfiguration)}:Personal");
|
||||
services.AddConfiguration<VaultConfiguration>(args => args.Name = "foo2", $"{nameof(VaultConfiguration)}:Test");
|
||||
|
||||
})
|
||||
.Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public class AppHandler(IPublisher publisher) :
|
||||
INotificationHandler<Started>
|
||||
{
|
||||
public async Task Handle(Started args, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (Application.Current is Application application)
|
||||
{
|
||||
if (application.ApplicationLifetime is IApplicationLifetime lifetime)
|
||||
{
|
||||
await publisher.Publish(new Navigate(lifetime is IClassicDesktopStyleApplicationLifetime ? "MainWindow" : "Main",
|
||||
lifetime is IClassicDesktopStyleApplicationLifetime ? typeof(IClassicDesktopStyleApplicationLifetime) :
|
||||
typeof(ISingleViewApplicationLifetime)), cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Bitvault.Avalonia.ArchiveNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="Archive" />
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ArchiveNavigationView : NavigationViewItem
|
||||
{
|
||||
public ArchiveNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -9,11 +9,22 @@
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
|
||||
<PackageReference Include="Avalonia" Version="11.1.0-beta1" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.0-beta1" />
|
||||
<PackageReference Include="Avalonia.Labs.Controls" Version="11.0.10.1" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="FluentAvaloniaUI" Version="2.1.0-preview2" />
|
||||
<PackageReference Include="System.Reactive" Version="6.0.1-preview.1" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.1.0-beta1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.3.24172.9" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0-beta1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Bitvault\Bitvault.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.Avalonia\Toolkit.Avalonia.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.Foundation\Toolkit.Foundation.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Avalonia\Toolkit.UI.Avalonia.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,5 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Bitvault.Avalonia.CategoriesNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="Categories" />
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class CategoriesNavigationView : NavigationViewItem
|
||||
{
|
||||
public CategoriesNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -1,8 +1,17 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Bitvault.Avalonia.MainView">
|
||||
Welcome to Avalonia!
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:MainViewModel">
|
||||
<NavigationView MenuItemTemplate="{Binding Template}" MenuItemsSource="{Binding}">
|
||||
<Frame x:Name="Main">
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Loaded">
|
||||
<NavigateAction Context="Main" Route="Vault" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Frame>
|
||||
</NavigationView>
|
||||
</UserControl>
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
|
||||
[NavigationTarget("Main")]
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
public MainView() => InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Bitvault.Avalonia.MainWindow"
|
||||
Title="MainWindow">
|
||||
Welcome to Avalonia!
|
||||
</Window>
|
||||
<windowing:AppWindow
|
||||
x:Class="Bitvault.Avalonia.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:windowing="using:FluentAvalonia.UI.Windowing"
|
||||
Background="Transparent"
|
||||
TransparencyLevelHint="Mica">
|
||||
<!--<ContentControl x:Name="Window">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehavior>
|
||||
<NavigateAction Context="Window" Route="Main" />
|
||||
</AttachedBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>-->
|
||||
</windowing:AppWindow>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
[NavigationTarget("Window")]
|
||||
public partial class MainWindow : AppWindow
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
public MainWindow()
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
TitleBar.ExtendsContentIntoTitleBar = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Bitvault.Avalonia.StarredNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="Starred" />
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class StarredNavigationView : NavigationViewItem
|
||||
{
|
||||
public StarredNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public class VaultComponent :
|
||||
IVaultComponent
|
||||
{
|
||||
public IComponentBuilder Create() =>
|
||||
ComponentBuilder.Create()
|
||||
.AddServices(services =>
|
||||
{
|
||||
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Bitvault.Avalonia.VaultNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:VaultNavigationViewModel"
|
||||
Content="Test"
|
||||
MenuItemsSource="{Binding}" />
|
||||
@@ -0,0 +1,9 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
{
|
||||
public partial class VaultNavigationView : NavigationViewItem
|
||||
{
|
||||
public VaultNavigationView() => InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.VaultView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
|
||||
<Grid ColumnDefinitions="1*, Auto, 2*">
|
||||
<ListBox Grid.Column="0" />
|
||||
<GridSplitter Grid.Column="1" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class VaultView : UserControl
|
||||
{
|
||||
public VaultView() => InitializeComponent();
|
||||
}
|
||||
+25
-1
@@ -7,7 +7,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bitvault.Avalonia", "Bitvau
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bitvault.Avalonia.Desktop", "Bitvault.Avalonia.Desktop\Bitvault.Avalonia.Desktop.csproj", "{D0067AEC-503B-4C6F-B3C9-728CA2E42B6F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bitvault", "Bitvault\Bitvault.csproj", "{CE10F8C0-B0DB-40F1-9B6C-517C008B4E8F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bitvault", "Bitvault\Bitvault.csproj", "{CE10F8C0-B0DB-40F1-9B6C-517C008B4E8F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit.Avalonia", "Toolkit\Toolkit.Avalonia\Toolkit.Avalonia.csproj", "{D6AAB1E0-7E3E-4E0B-A70D-D23DC9CE50C7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit.Foundation", "Toolkit\Toolkit.Foundation\Toolkit.Foundation.csproj", "{E2E3E066-869A-40A4-8F22-657E4AD3718C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit.UI.Avalonia", "Toolkit\Toolkit.UI.Avalonia\Toolkit.UI.Avalonia.csproj", "{6EB99311-D120-4BE3-971C-BFC5BA94F9A1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit.UI.Controls.Avalonia", "Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj", "{716E252B-B758-4134-9D34-50FC42B414C6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -27,6 +35,22 @@ Global
|
||||
{CE10F8C0-B0DB-40F1-9B6C-517C008B4E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE10F8C0-B0DB-40F1-9B6C-517C008B4E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE10F8C0-B0DB-40F1-9B6C-517C008B4E8F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D6AAB1E0-7E3E-4E0B-A70D-D23DC9CE50C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D6AAB1E0-7E3E-4E0B-A70D-D23DC9CE50C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D6AAB1E0-7E3E-4E0B-A70D-D23DC9CE50C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D6AAB1E0-7E3E-4E0B-A70D-D23DC9CE50C7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E2E3E066-869A-40A4-8F22-657E4AD3718C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E2E3E066-869A-40A4-8F22-657E4AD3718C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E2E3E066-869A-40A4-8F22-657E4AD3718C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E2E3E066-869A-40A4-8F22-657E4AD3718C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6EB99311-D120-4BE3-971C-BFC5BA94F9A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6EB99311-D120-4BE3-971C-BFC5BA94F9A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6EB99311-D120-4BE3-971C-BFC5BA94F9A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6EB99311-D120-4BE3-971C-BFC5BA94F9A1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{716E252B-B758-4134-9D34-50FC42B414C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{716E252B-B758-4134-9D34-50FC42B414C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{716E252B-B758-4134-9D34-50FC42B414C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{716E252B-B758-4134-9D34-50FC42B414C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class AllNavigationViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer),
|
||||
IMainNavigationViewModel;
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ArchiveNavigationViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer),
|
||||
IMainNavigationViewModel;
|
||||
@@ -1,9 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.3.24172.9" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.Avalonia\Toolkit.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class CategoriesNavigationViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer),
|
||||
IMainNavigationViewModel;
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public interface IMainNavigationViewModel;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public interface IVaultComponent : IComponent;
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public record Locked;
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class LockerNavigationViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer);
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class LockerViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer);
|
||||
@@ -1,14 +1,10 @@
|
||||
namespace Bitvault
|
||||
{
|
||||
public class LockViewModel;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
public class VaultViewModel;
|
||||
namespace Bitvault;
|
||||
|
||||
public class VaultNavigationViewModel;
|
||||
|
||||
public class AllNavigationViewModel;
|
||||
|
||||
public class FavouriteNavigationViewModel;
|
||||
|
||||
public class CategoryNavigationViewModel;
|
||||
}
|
||||
public class LockViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer);
|
||||
@@ -0,0 +1,14 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class MainViewHandler(IPublisher publisher,
|
||||
IServiceFactory factory) :
|
||||
INotificationHandler<Enumerate<IMainNavigationViewModel>>
|
||||
{
|
||||
public async Task Handle(Enumerate<IMainNavigationViewModel> args,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class MainViewModel :
|
||||
ObservableCollectionViewModel<IMainNavigationViewModel>
|
||||
{
|
||||
public MainViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template) : base(serviceProvider, serviceFactory, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
Add<VaultNavigationViewModel>();
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class MainWindowViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer);
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class StarredNavigationViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer),
|
||||
IMainNavigationViewModel;
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public class SystemIdleTimer;
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public record Unlocked;
|
||||
@@ -0,0 +1,50 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class VaultComponentsCollectionInitializer(IServiceProvider provider,
|
||||
IProxyServiceCollection<IComponentBuilder> proxy,
|
||||
VaultConfigurationCollection configurations) : IInitializer
|
||||
{
|
||||
public Task Initialize()
|
||||
{
|
||||
//for (int index = 0; index < configurations.Count; index++)
|
||||
//{
|
||||
// VaultConfiguration configuration = configurations[index];
|
||||
// if (provider.GetRequiredService<IVaultComponent>() is IVaultComponent component)
|
||||
// {
|
||||
// IComponentBuilder builder = component.Create();
|
||||
// builder.AddServices(services =>
|
||||
// {
|
||||
// services.AddTransient(_ =>
|
||||
// provider.GetRequiredService<IProxyService<IPublisher>>());
|
||||
|
||||
// services.AddTransient(_ =>
|
||||
// provider.GetRequiredService<IProxyService<IComponentHostCollection>>());
|
||||
|
||||
// services.AddScoped(_ =>
|
||||
// provider.GetRequiredService<INavigationContextCollection>());
|
||||
|
||||
// services.AddScoped(_ =>
|
||||
// provider.GetRequiredService<INavigationContextProvider>());
|
||||
|
||||
// services.AddScoped(_ =>
|
||||
// provider.GetRequiredService<IComponentScopeCollection>());
|
||||
|
||||
// services.AddTransient(_ =>
|
||||
// provider.GetRequiredService<IComponentScopeProvider>());
|
||||
|
||||
// services.AddRange(proxy.Services);
|
||||
// });
|
||||
|
||||
// builder.AddConfiguration<VaultConfiguration>(name: $"{nameof(VaultConfigurationCollection)}:{configuration.Name}");
|
||||
|
||||
// IComponentHost host = builder.Build();
|
||||
// host.StartAsync();
|
||||
// }
|
||||
//}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public record VaultConfiguration : ComponentConfiguration
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class VaultConfigurationCollection : DynamicObject;
|
||||
@@ -0,0 +1,25 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class VaultNavigationViewModel :
|
||||
ObservableCollectionViewModel<IMainNavigationViewModel>,
|
||||
IMainNavigationViewModel
|
||||
{
|
||||
public VaultNavigationViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template) : base(serviceProvider, serviceFactory, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
|
||||
Add<AllNavigationViewModel>();
|
||||
Add<StarredNavigationViewModel>();
|
||||
Add<ArchiveNavigationViewModel>();
|
||||
Add<CategoriesNavigationViewModel>();
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class VaultViewModel(IServiceProvider serviceProvider,
|
||||
IServiceFactory serviceFactory,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) :
|
||||
ObservableViewModel(serviceProvider, serviceFactory, publisher, subscriber, disposer);
|
||||
+1
-1
Submodule Toolkit updated: 5b055bb2d7...e0f49832f8
Reference in New Issue
Block a user