Improve filtering

This commit is contained in:
TheXamlGuy
2024-07-17 22:13:39 +01:00
parent b08976025e
commit 9010b3bf3c
2 changed files with 3 additions and 11 deletions
+3 -3
View File
@@ -351,7 +351,7 @@ public partial class ObservableCollection<TItem> :
Disposer.Dispose(this); Disposer.Dispose(this);
} }
public void Activate(Func<ActivationBuilder> aggregateDelegate, public void Activate(Func<ActivationBuilder> activateDelegate,
bool reset = false) bool reset = false)
{ {
if (reset) if (reset)
@@ -359,8 +359,8 @@ public partial class ObservableCollection<TItem> :
Clear(); Clear();
} }
ActivationBuilder expression = aggregateDelegate.Invoke(); ActivationBuilder builder = activateDelegate.Invoke();
Publisher.Publish(expression.Value, expression.Key); Publisher.Publish(builder.Value, builder.Key);
} }
public IEnumerator<TItem> GetEnumerator() => public IEnumerator<TItem> GetEnumerator() =>
@@ -10,8 +10,6 @@ public class InvokeNavigationViewItemAction :
AvaloniaObject, AvaloniaObject,
IAction IAction
{ {
private int currentIndex;
public static readonly StyledProperty<int> SelectedIndexProperty = public static readonly StyledProperty<int> SelectedIndexProperty =
AvaloniaProperty.Register<InvokeNavigationViewItemAction, int>(nameof(SelectedIndex), 0); AvaloniaProperty.Register<InvokeNavigationViewItemAction, int>(nameof(SelectedIndex), 0);
@@ -32,11 +30,6 @@ public class InvokeNavigationViewItemAction :
public object? Execute(object? sender, object? parameter) public object? Execute(object? sender, object? parameter)
{ {
//if (SelectedIndex == currentIndex)
//{
// return false;
//}
if ((Target ?? sender) is NavigationViewItem navigationViewItem) if ((Target ?? sender) is NavigationViewItem navigationViewItem)
{ {
Dispatcher.UIThread.Post(() => Dispatcher.UIThread.Post(() =>
@@ -60,7 +53,6 @@ public class InvokeNavigationViewItemAction :
if (collection is { Count: > 0 }) if (collection is { Count: > 0 })
{ {
navigationView.SetValue(NavigationView.SelectedItemProperty, collection[SelectedIndex]); navigationView.SetValue(NavigationView.SelectedItemProperty, collection[SelectedIndex]);
currentIndex = SelectedIndex;
} }
else else
{ {