using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.ExtensionMethods; using Tango.FSE.Common; namespace Tango.FSE.Procedures.Dialogs { public class BreakPointValueDialogViewVM : FSEDialogViewVM { public String Name { get; set; } public Object DebugObject { get; set; } private bool _asJson; public bool AsJson { get { return _asJson; } set { _asJson = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(DisplayValue)); } } public BreakPointValueDialogViewVM(String name, Object debugObject) { AutoMode = false; CanCancel = true; CanClose = true; Name = name; DebugObject = debugObject; } public String DisplayValue { get { if (DebugObject != null) { if (AsJson) { try { return DebugObject.ToJsonString(); } catch { return DebugObject.ToString(); } } else { return DebugObject.ToString(); } } return "null"; } } } }