wip
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.AddItemContentNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SettingsExpander Header="Add item" IsClickEnabled="True" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class AddItemContentNavigationView : UserControl
|
||||
{
|
||||
public AddItemContentNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -5,21 +5,5 @@
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls">
|
||||
<Application.Styles>
|
||||
<ThemeResources PreferSystemTheme="True" PreferUserAccentColor="True" />
|
||||
<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>
|
||||
</Application.Styles>
|
||||
<Application.Resources>
|
||||
<FontFamily x:Key="SymbolFontFamily">avares://HyperX.Launcher.Avalonia/Assets/SegoeIcons.ttf#Segoe Fluent Icons</FontFamily>
|
||||
<x:Double x:Key="SettingsExpanderItemAdaptiveWidthTrigger">0</x:Double>
|
||||
<Thickness x:Key="SettingsExpanderItemBottomFooterMargin">0,8,0,0</Thickness>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -108,6 +108,8 @@ public partial class App : Application
|
||||
services.AddTemplate<DeleteItemActionViewModel, DeleteItemActionView>();
|
||||
|
||||
services.AddTemplate<ItemHeaderViewModel, ItemHeaderView>();
|
||||
services.AddTemplate<ItemContentViewModel, ItemContentView>();
|
||||
services.AddTemplate<AddItemContentNavigationViewModel, AddItemContentNavigationView>();
|
||||
|
||||
services.AddScoped<IValueStore<Item>, ValueStore<Item>>();
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="AddItemContentNavigationViewModel.axaml.cs">
|
||||
<DependentUpon>AddItemContentNavigationViewModel.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="CreateItemActionView.axaml.cs">
|
||||
<DependentUpon>CreateItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -61,6 +64,9 @@
|
||||
<Compile Update="ItemHeaderView.axaml.cs">
|
||||
<DependentUpon>ItemHeaderView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemContentView.axaml.cs">
|
||||
<DependentUpon>ItemContentView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="OpenView.axaml.cs">
|
||||
<DependentUpon>OpenView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.ItemContentView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemContentViewModel">
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ItemContentView : UserControl
|
||||
{
|
||||
public ItemContentView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -13,6 +13,12 @@
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
<ScrollViewer Padding="12,12,12,0">
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}" />
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Spacing="24" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class AddItemContentNavigationViewModel : Observable,
|
||||
IItemEntryViewModel
|
||||
{
|
||||
public AddItemContentNavigationViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemContentViewModel :
|
||||
ObservableCollection<IItemEntryViewModel>,
|
||||
IItemEntryViewModel
|
||||
{
|
||||
public ItemContentViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory, IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
bool immutable = true) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
Template = template;
|
||||
|
||||
if (!immutable)
|
||||
{
|
||||
Insert<AddItemContentNavigationViewModel>();
|
||||
}
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
}
|
||||
@@ -45,6 +45,7 @@ public partial class ItemViewModel :
|
||||
Name = name;
|
||||
|
||||
Add<ItemHeaderViewModel>(immutable, name);
|
||||
Add<ItemContentViewModel>(immutable);
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user