feat: remove comment, add pseudo class.
This commit is contained in:
@@ -8,11 +8,13 @@ using Avalonia.Data;
|
|||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Logging;
|
using Avalonia.Logging;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
|
using Irihi.Avalonia.Shared.Common;
|
||||||
using Irihi.Avalonia.Shared.Helpers;
|
using Irihi.Avalonia.Shared.Helpers;
|
||||||
|
|
||||||
namespace Ursa.Controls;
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
[TemplatePart(Name = PART_Button, Type = typeof(Button))]
|
[TemplatePart(Name = PART_Button, Type = typeof(Button))]
|
||||||
|
[PseudoClasses(PseudoClassName.PC_Empty)]
|
||||||
public class PathPicker : TemplatedControl
|
public class PathPicker : TemplatedControl
|
||||||
{
|
{
|
||||||
public const string PART_Button = "PART_Button";
|
public const string PART_Button = "PART_Button";
|
||||||
@@ -164,14 +166,6 @@ public class PathPicker : TemplatedControl
|
|||||||
{
|
{
|
||||||
_twoConvertLock = true;
|
_twoConvertLock = true;
|
||||||
string[] separatedStrings = ["\r", "\n", "\r\n"];
|
string[] separatedStrings = ["\r", "\n", "\r\n"];
|
||||||
// var list = SelectedPathsText?.Split(separatedStrings, StringSplitOptions.RemoveEmptyEntries)
|
|
||||||
// .Select(RemoveNewLine).ToArray()
|
|
||||||
// ?? [];
|
|
||||||
// if (list.Length == SelectedPaths.Count)
|
|
||||||
// {
|
|
||||||
// if (SelectedPaths.Select(x => list.Any(y => x == y)).All(x => x is false))
|
|
||||||
// }
|
|
||||||
|
|
||||||
SelectedPaths = SelectedPathsText?.Split(separatedStrings, StringSplitOptions.RemoveEmptyEntries)
|
SelectedPaths = SelectedPathsText?.Split(separatedStrings, StringSplitOptions.RemoveEmptyEntries)
|
||||||
.Select(RemoveNewLine).ToArray()
|
.Select(RemoveNewLine).ToArray()
|
||||||
?? [];
|
?? [];
|
||||||
@@ -288,9 +282,11 @@ public class PathPicker : TemplatedControl
|
|||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
|
this.PseudoClasses.Set(PseudoClassName.PC_Empty, SelectedPaths.Count == 0);
|
||||||
if (SelectedPaths.Count != 0 || IsOmitCommandOnCancel is false)
|
if (SelectedPaths.Count != 0 || IsOmitCommandOnCancel is false)
|
||||||
|
{
|
||||||
Command?.Execute(SelectedPaths);
|
Command?.Execute(SelectedPaths);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user