Skip to content

Commit

Permalink
[Presentation] Fix issue with binding quantum nodes when associated n…
Browse files Browse the repository at this point in the history
…ame is not found (#2195)

Note: the solution is rather hackish at the moment. To be revisited once we have an Avalonia version.
Should we then introduce a service for setting/retrieving the Unset value
  • Loading branch information
Kryptos-FR authored Mar 23, 2024
1 parent feea912 commit 4a263c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sources/editor/Stride.Core.Assets.Editor/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public static void Initialize()
AssetsPlugin.RegisterPlugin(typeof(CoreAssetsEditorPlugin));
// Initialize translation
TranslationManager.Instance.RegisterProvider(new GettextTranslationProvider());
// HACK
Presentation.Quantum.ViewModels.NodeViewModel.UnsetValue = System.Windows.DependencyProperty.UnsetValue;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ internal class DifferentValuesObject { public readonly string Name = "DifferentV

public static readonly object DifferentValues = new DifferentValuesObject();

public static object UnsetValue;

static NodeViewModel()
{
typeof(NodeViewModel).GetProperties().Select(x => x.Name).ForEach(x => ReservedNames.Add(x));
Expand Down Expand Up @@ -317,7 +319,7 @@ public object GetAssociatedData(string name)
public object GetDynamicObject(string name)
{
name = EscapeName(name);
return GetChild(name) ?? GetCommand(name) ?? GetAssociatedData(name);
return GetChild(name) ?? GetCommand(name) ?? GetAssociatedData(name) ?? UnsetValue;
}

/// <inheritdoc/>
Expand Down

0 comments on commit 4a263c4

Please sign in to comment.