public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (fcm is null) { fcm = new FileConfigModel(); } this.SetValue(fcm, (string)parameter, value); return(JsonConvert.SerializeObject(fcm)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(null); } try { fcm = JsonConvert.DeserializeObject <FileConfigModel>((string)value); return(this.GetValue <string>(fcm, (string)parameter)); } catch { return(null); } }