forked from Blazor-Diagrams/Blazor.Diagrams
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial version of selectables' ordering (nodes, groups and links)
- Loading branch information
Showing
6 changed files
with
310 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
namespace Blazor.Diagrams.Core.Models.Base | ||
using System; | ||
|
||
namespace Blazor.Diagrams.Core.Models.Base | ||
{ | ||
public abstract class SelectableModel : Model | ||
{ | ||
public SelectableModel() { } | ||
private int _order; | ||
|
||
public event Action<SelectableModel>? OrderChanged; | ||
|
||
public SelectableModel(string id) : base(id) { } | ||
protected SelectableModel() { } | ||
|
||
protected SelectableModel(string id) : base(id) { } | ||
|
||
public bool Selected { get; internal set; } | ||
public int Order | ||
{ | ||
get => _order; | ||
set | ||
{ | ||
if (value == Order) | ||
return; | ||
|
||
_order = value; | ||
OrderChanged?.Invoke(this); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.