New AI actions panel. Replaced new command bar.
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Models.Menus;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Folders;
|
||||
|
||||
public class FolderOperationMenuItem : MenuOperationItemBase<FolderOperation>, IMenuOperation
|
||||
public class FolderOperationMenuItem : MenuOperationItemBase<FolderOperation>
|
||||
{
|
||||
protected FolderOperationMenuItem(FolderOperation operation, bool isEnabled) : base(operation, isEnabled) { }
|
||||
protected FolderOperationMenuItem(FolderOperation operation, bool isEnabled, bool isSecondaryMenuItem = false) : base(operation, isEnabled)
|
||||
{
|
||||
IsSecondaryMenuPreferred = isSecondaryMenuItem;
|
||||
}
|
||||
|
||||
public static FolderOperationMenuItem Create(FolderOperation operation, bool isEnabled = true)
|
||||
=> new FolderOperationMenuItem(operation, isEnabled);
|
||||
public static FolderOperationMenuItem Create(FolderOperation operation, bool isEnabled = true, bool isSecondaryMenuItem = false)
|
||||
=> new FolderOperationMenuItem(operation, isEnabled, isSecondaryMenuItem);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Menus;
|
||||
|
||||
public class MailOperationMenuItem : MenuOperationItemBase<MailOperation>, IMenuOperation
|
||||
public class MailOperationMenuItem : MenuOperationItemBase<MailOperation>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets whether this menu item should be placed in SecondaryCommands if used in CommandBar.
|
||||
/// </summary>
|
||||
public bool IsSecondaryMenuPreferred { get; set; }
|
||||
|
||||
protected MailOperationMenuItem(MailOperation operation, bool isEnabled, bool isSecondaryMenuItem = false) : base(operation, isEnabled)
|
||||
{
|
||||
IsSecondaryMenuPreferred = isSecondaryMenuItem;
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
using System;
|
||||
using System;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Menus;
|
||||
|
||||
public class MenuOperationItemBase<TOperation> where TOperation : Enum
|
||||
public class MenuOperationItemBase<TOperation> : ObservableObject, IMenuOperation where TOperation : Enum
|
||||
{
|
||||
private TOperation _operation;
|
||||
private string _identifier = string.Empty;
|
||||
private bool _isEnabled;
|
||||
private bool _isSecondaryMenuPreferred;
|
||||
|
||||
public MenuOperationItemBase(TOperation operation, bool isEnabled)
|
||||
{
|
||||
Operation = operation;
|
||||
@@ -11,7 +18,33 @@ public class MenuOperationItemBase<TOperation> where TOperation : Enum
|
||||
Identifier = operation.ToString();
|
||||
}
|
||||
|
||||
public TOperation Operation { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
public TOperation Operation
|
||||
{
|
||||
get => _operation;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _operation, value))
|
||||
{
|
||||
Identifier = value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Identifier
|
||||
{
|
||||
get => _identifier;
|
||||
protected set => SetProperty(ref _identifier, value);
|
||||
}
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => _isEnabled;
|
||||
set => SetProperty(ref _isEnabled, value);
|
||||
}
|
||||
|
||||
public bool IsSecondaryMenuPreferred
|
||||
{
|
||||
get => _isSecondaryMenuPreferred;
|
||||
set => SetProperty(ref _isSecondaryMenuPreferred, value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user