Fixed various issues

This commit is contained in:
TheXamlGuy
2024-07-18 18:00:01 +01:00
parent 56c7831e6b
commit d35ec27570
8 changed files with 20 additions and 25 deletions
@@ -4,17 +4,17 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Wallet" xmlns:vm="using:Wallet"
x:DataType="vm:ItemCategoryNavigationCollectionViewModel"> x:DataType="vm:ItemCategoryNavigationCollectionViewModel">
<ListBox <ListView
Margin="2,-1,0,0" Margin="2,-1,0,0"
AutoScrollToSelectedItem="True" AutoScrollToSelectedItem="True"
ItemTemplate="{ReflectionBinding Template}" ItemContainerTemplateSelector="{ReflectionBinding Template}"
ItemsSource="{Binding}" ItemsSource="{Binding}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
SelectionMode="Single"> SelectionMode="Single">
<ListBox.Styles> <ListView.Styles>
<Style Selector="ListBoxItem"> <Style Selector="ListViewItem">
<Setter Property="IsSelected" Value="{ReflectionBinding Selected, Mode=TwoWay}" /> <Setter Property="IsSelected" Value="{ReflectionBinding Selected, Mode=TwoWay}" />
</Style> </Style>
</ListBox.Styles> </ListView.Styles>
</ListBox> </ListView>
</UserControl> </UserControl>
@@ -1,4 +1,4 @@
<ListBoxItem <ListViewItem
x:Class="Wallet.Avalonia.ItemCategoryNavigationView" x:Class="Wallet.Avalonia.ItemCategoryNavigationView"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -25,4 +25,4 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Name}" /> Text="{Binding Name}" />
</Grid> </Grid>
</ListBoxItem> </ListViewItem>
@@ -1,8 +1,9 @@
using Avalonia.Controls; using Toolkit.UI.Controls.Avalonia;
namespace Wallet.Avalonia; namespace Wallet.Avalonia;
public partial class ItemCategoryNavigationView : ListBoxItem public partial class ItemCategoryNavigationView :
ListViewItem
{ {
public ItemCategoryNavigationView() => public ItemCategoryNavigationView() =>
InitializeComponent(); InitializeComponent();
@@ -25,10 +25,10 @@
<NavigateAction Region="{Binding Named, StringFormat='{}{0}:Content'}" Route="EmptyItemCollection" /> <NavigateAction Region="{Binding Named, StringFormat='{}{0}:Content'}" Route="EmptyItemCollection" />
</DataTriggerBehavior> </DataTriggerBehavior>
</Interaction.Behaviors> </Interaction.Behaviors>
<TemplateListBox <ListView
Margin="2,-1,0,0" Margin="2,-1,0,0"
AutoScrollToSelectedItem="True" AutoScrollToSelectedItem="True"
ItemTemplate="{ReflectionBinding Template}" ItemContainerTemplateSelector="{ReflectionBinding Template}"
ItemsSource="{Binding}" ItemsSource="{Binding}"
SelectedItem="{Binding SelectedItem}" SelectedItem="{Binding SelectedItem}"
SelectionMode="Single" /> SelectionMode="Single" />
+4 -5
View File
@@ -1,14 +1,13 @@
<ListBoxItem <ListViewItem
x:Class="Wallet.Avalonia.ItemNavigationView" x:Class="Wallet.Avalonia.ItemNavigationView"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Wallet" xmlns:vm="using:Wallet"
x:DataType="vm:ItemNavigationViewModel" x:DataType="vm:ItemNavigationViewModel"
ContentTemplate="{x:Null}"
ListBoxExtension.IsItemInvokedEnabled="True"> ListBoxExtension.IsItemInvokedEnabled="True">
<ListBoxItem.Resources> <ListViewItem.Resources>
<SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" /> <SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" />
</ListBoxItem.Resources> </ListViewItem.Resources>
<Interaction.Behaviors> <Interaction.Behaviors>
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}"> <AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}">
<NavigateAction <NavigateAction
@@ -52,4 +51,4 @@
<TextBlock Opacity="0.7" Text="{Binding Name}" /> <TextBlock Opacity="0.7" Text="{Binding Name}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</ListBoxItem> </ListViewItem>
+2 -6
View File
@@ -1,14 +1,10 @@
using Avalonia.Controls; using Toolkit.UI.Controls.Avalonia;
using System;
namespace Wallet.Avalonia; namespace Wallet.Avalonia;
public partial class ItemNavigationView : public partial class ItemNavigationView :
ListBoxItem ListViewItem
{ {
public ItemNavigationView() => public ItemNavigationView() =>
InitializeComponent(); InitializeComponent();
protected override Type StyleKeyOverride =>
typeof(ListBoxItem);
} }
@@ -6,7 +6,7 @@
x:DataType="vm:WalletNavigationCollectionViewModel"> x:DataType="vm:WalletNavigationCollectionViewModel">
<Overflow <Overflow
HorizontalAlignment="Center" HorizontalAlignment="Center"
ItemTemplate="{ReflectionBinding Template}" ItemContainerTemplateSelector="{ReflectionBinding Template}"
ItemsSource="{Binding}" ItemsSource="{Binding}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"> SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
<Overflow.Styles> <Overflow.Styles>
@@ -9,7 +9,6 @@
BadgePath="F1 M 10 3.799999 C 8.559999 3.799999 7.226666 4.16 6 4.879999 C 4.773333 5.6 3.8 6.573334 3.08 7.799999 C 2.36 9.026667 2 10.360001 2 11.799999 C 2 13.24 2.36 14.573334 3.08 15.799999 C 3.8 17.026667 4.773333 18 6 18.719999 C 7.226666 19.439999 8.559999 19.799999 10 19.799999 C 11.439999 19.799999 12.773333 19.439999 14 18.719999 C 15.226665 18 16.199999 17.026667 16.92 15.799999 C 17.639999 14.573334 18 13.24 18 11.799999 C 18 10.360001 17.639999 9.026667 16.92 7.799999 C 16.199999 6.573334 15.226665 5.6 14 4.879999 C 12.773333 4.16 11.439999 3.799999 10 3.799999 Z " BadgePath="F1 M 10 3.799999 C 8.559999 3.799999 7.226666 4.16 6 4.879999 C 4.773333 5.6 3.8 6.573334 3.08 7.799999 C 2.36 9.026667 2 10.360001 2 11.799999 C 2 13.24 2.36 14.573334 3.08 15.799999 C 3.8 17.026667 4.773333 18 6 18.719999 C 7.226666 19.439999 8.559999 19.799999 10 19.799999 C 11.439999 19.799999 12.773333 19.439999 14 18.719999 C 15.226665 18 16.199999 17.026667 16.92 15.799999 C 17.639999 14.573334 18 13.24 18 11.799999 C 18 10.360001 17.639999 9.026667 16.92 7.799999 C 16.199999 6.573334 15.226665 5.6 14 4.879999 C 12.773333 4.16 11.439999 3.799999 10 3.799999 Z "
BadgePlacement="BottomRight" BadgePlacement="BottomRight"
BadgeSize="10" BadgeSize="10"
ContentTemplate="{x:Null}"
Foreground="#4CAF50" Foreground="#4CAF50"
IsBadgeVisible="{Binding IsOpened}" IsBadgeVisible="{Binding IsOpened}"
ListBoxExtension.IsItemInvokedEnabled="True" ListBoxExtension.IsItemInvokedEnabled="True"