From f637c131c4d28e3b617f5e0701cc94eb9569d620 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 20 Nov 2020 21:27:30 +0000 Subject: [PATCH] Added reset layer property button --- .../Profile/LayerProperties/LayerProperty.cs | 8 ++++-- .../Tree/TreePropertyView.xaml | 28 +++++++++++++------ .../Tree/TreePropertyViewModel.cs | 6 ++++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs index fd9cab497..74ad46048 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -208,8 +208,10 @@ namespace Artemis.Core if (_disposed) throw new ObjectDisposedException("LayerProperty"); - BaseValue = DefaultValue; - CurrentValue = DefaultValue; + string json = JsonConvert.SerializeObject(DefaultValue, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }); + + BaseValue = JsonConvert.DeserializeObject(json); + CurrentValue = JsonConvert.DeserializeObject(json); } private void ReapplyUpdate() diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml index 8e29a9019..c0c51ccb0 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Tree/TreePropertyView.xaml @@ -1,4 +1,4 @@ - + - + - +