mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Data model node - Properly recover when data model path validates
This commit is contained in:
parent
0058322936
commit
eb9dd3b509
@ -7,10 +7,10 @@ using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.Modules;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Shared.Controls
|
||||
{
|
||||
@ -282,9 +282,18 @@ namespace Artemis.UI.Shared.Controls
|
||||
return;
|
||||
|
||||
if (e.OldValue is DataModelPath oldPath)
|
||||
{
|
||||
oldPath.PathInvalidated -= dataModelPicker.PathValidationChanged;
|
||||
oldPath.PathValidated -= dataModelPicker.PathValidationChanged;
|
||||
oldPath.Dispose();
|
||||
}
|
||||
|
||||
dataModelPicker.UpdateValueDisplay();
|
||||
if (e.NewValue is DataModelPath newPath)
|
||||
{
|
||||
newPath.PathInvalidated += dataModelPicker.PathValidationChanged;
|
||||
newPath.PathValidated += dataModelPicker.PathValidationChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowFullPathPropertyCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
@ -318,6 +327,11 @@ namespace Artemis.UI.Shared.Controls
|
||||
return;
|
||||
}
|
||||
|
||||
private void PathValidationChanged(object? sender, EventArgs e)
|
||||
{
|
||||
Dispatcher.Invoke(UpdateValueDisplay, DispatcherPriority.DataBind);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@
|
||||
using Artemis.Core;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.VisualScripting.Nodes.DataModel.CustomViewModels;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.DataModel
|
||||
{
|
||||
@ -84,7 +85,7 @@ namespace Artemis.VisualScripting.Nodes.DataModel
|
||||
|
||||
private void DataModelPathOnPathValidated(object sender, EventArgs e)
|
||||
{
|
||||
UpdateOutputPin(true);
|
||||
Execute.OnUIThread(() => UpdateOutputPin(true));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user