Get favourites working
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
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">
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls">
|
||||
<Application.Styles>
|
||||
<ThemeResources PreferSystemTheme="True" PreferUserAccentColor="True" />
|
||||
<Style Selector="ui|SettingsExpanderItem">
|
||||
|
||||
@@ -94,6 +94,7 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
|
||||
|
||||
services.AddTemplate<FavouriteItemActionViewModel, FavouriteItemActionView>();
|
||||
services.AddTemplate<ConfirmItemActionViewModel, ConfirmItemActionView>();
|
||||
services.AddTemplate<DismissItemActionViewModel, DismissItemActionView>();
|
||||
services.AddTemplate<ArchiveItemActionViewModel, ArchiveItemActionView>();
|
||||
@@ -108,7 +109,8 @@ public partial class App : Application
|
||||
services.AddHandler<ConfirmItemHandler>(ServiceLifetime.Scoped);
|
||||
services.AddHandler<ArchiveItemHandler>(ServiceLifetime.Scoped);
|
||||
services.AddHandler<UnarchiveItemHandler>(ServiceLifetime.Scoped);
|
||||
|
||||
services.AddHandler<FavouriteItemHandler>(ServiceLifetime.Scoped);
|
||||
services.AddHandler<UnfavouriteItemHandler>(ServiceLifetime.Scoped);
|
||||
});
|
||||
})!);
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="18"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.FavouriteItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:FavouriteItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
ToolTip.Tip="Edit">
|
||||
<Grid>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
IsVisible="{Binding !Value}"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
IsVisible="{Binding Value}"
|
||||
Text="" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class FavouriteItemActionView : UserControl
|
||||
{
|
||||
public FavouriteItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -5,6 +5,9 @@
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemNavigationViewModel"
|
||||
IsSelected="{Binding Selected}">
|
||||
<ListBoxItem.Resources>
|
||||
<SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" />
|
||||
</ListBoxItem.Resources>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<NavigateAction
|
||||
@@ -17,6 +20,7 @@
|
||||
Scope="self">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Archived" Value="{Binding Archived}" />
|
||||
<ParameterBinding Key="Favourite" Value="{Binding Favourite}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
</NavigateAction>
|
||||
</DataTriggerBehavior>
|
||||
@@ -25,8 +29,17 @@
|
||||
<PersonPicture
|
||||
Grid.Column="0"
|
||||
Height="34"
|
||||
Margin="0"
|
||||
DisplayName="{Binding Name}" />
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="0,0,-2,10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource StarredIconForegroundBrush}"
|
||||
IsVisible="{Binding Favourite}"
|
||||
Text="" />
|
||||
<StackPanel Grid.Column="1" Margin="12,12,6,12">
|
||||
<TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
|
||||
<TextBlock Opacity="0.7" Text="{Binding Name}" />
|
||||
|
||||
Reference in New Issue
Block a user