Codemaid
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Toolkit.UI.Avalonia;
|
||||
|
||||
public class AttachedBehaviour :
|
||||
public class AttachedBehaviour :
|
||||
Trigger
|
||||
{
|
||||
protected override void OnAttachedToVisualTree()
|
||||
|
||||
@@ -8,7 +8,7 @@ public class BooleanToPasswordCharConverter :
|
||||
MarkupExtension,
|
||||
IValueConverter
|
||||
{
|
||||
public override object ProvideValue(IServiceProvider serviceProvider) =>
|
||||
public override object ProvideValue(IServiceProvider serviceProvider) =>
|
||||
this;
|
||||
|
||||
public char PasswordChar { get; set; }
|
||||
@@ -16,6 +16,6 @@ public class BooleanToPasswordCharConverter :
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value is bool boolValue ? boolValue ? '\0' : PasswordChar : (object)PasswordChar;
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,4 @@ namespace Toolkit.UI.Avalonia;
|
||||
public class ConditionCollection :
|
||||
ObservableCollection<ComparisonCondition>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Avalonia.Metadata;
|
||||
|
||||
namespace Toolkit.UI.Avalonia;
|
||||
|
||||
public class ConditionalExpression :
|
||||
AvaloniaObject,
|
||||
ICondition
|
||||
|
||||
@@ -10,6 +10,8 @@ public class InvokeNavigationViewItemAction :
|
||||
AvaloniaObject,
|
||||
IAction
|
||||
{
|
||||
private int currentIndex;
|
||||
|
||||
public static readonly StyledProperty<int> SelectedIndexProperty =
|
||||
AvaloniaProperty.Register<InvokeNavigationViewItemAction, int>(nameof(SelectedIndex), 0);
|
||||
|
||||
@@ -30,6 +32,11 @@ public class InvokeNavigationViewItemAction :
|
||||
|
||||
public object? Execute(object? sender, object? parameter)
|
||||
{
|
||||
//if (SelectedIndex == currentIndex)
|
||||
//{
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if ((Target ?? sender) is NavigationViewItem navigationViewItem)
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
@@ -53,6 +60,7 @@ public class InvokeNavigationViewItemAction :
|
||||
if (collection is { Count: > 0 })
|
||||
{
|
||||
navigationView.SetValue(NavigationView.SelectedItemProperty, collection[SelectedIndex]);
|
||||
currentIndex = SelectedIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -64,5 +72,4 @@ public class InvokeNavigationViewItemAction :
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,8 +4,8 @@ using System.Globalization;
|
||||
|
||||
namespace Toolkit.UI.Avalonia;
|
||||
|
||||
public class NamedTypeConverter :
|
||||
MarkupExtension,
|
||||
public class NamedTypeConverter :
|
||||
MarkupExtension,
|
||||
IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
@@ -20,4 +20,4 @@ public class NamedTypeConverter :
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider) => this;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Xaml.Interactivity;
|
||||
using Toolkit.Foundation;
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Toolkit.UI.Avalonia;
|
||||
|
||||
|
||||
@@ -65,4 +65,4 @@ public class NavigationViewExtension
|
||||
|
||||
public static void RemoveItemInvokedHandler(NavigationViewItem element, EventHandler<ItemInvokedEventArgs> handler) =>
|
||||
element.RemoveHandler(ItemInvokedEvent, handler);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user