From a4a96cbf4f2d3600accf7a34ed6fec898d5a261b Mon Sep 17 00:00:00 2001 From: Patrick Kranz Date: Wed, 23 May 2018 13:23:19 +0200 Subject: [PATCH] Fix exception in sample Project. --- NSCI/UI/Controls/TextBlock.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NSCI/UI/Controls/TextBlock.cs b/NSCI/UI/Controls/TextBlock.cs index d170949..83a83df 100644 --- a/NSCI/UI/Controls/TextBlock.cs +++ b/NSCI/UI/Controls/TextBlock.cs @@ -12,7 +12,8 @@ public partial class TextBlock : FrameworkElement [NDProperty.NDP] protected virtual void OnTextChanging(NDProperty.Propertys.OnChangingArg arg) { - arg.Provider.MutatedValue = arg.Provider.NewValue?.Replace("\t", " ").Replace("\r", ""); + if (arg.Provider.CanMutate) + arg.Provider.MutatedValue = arg.Provider.NewValue?.Replace("\t", " ").Replace("\r", ""); if (arg.Property.IsObjectValueChanging) arg.ExecuteAfterChange += (sender, e) => {