public static string ToDisplayText <T>(this IAutomationProperty <T> automationProperty) { T value; var success = automationProperty.TryGetValue(out value); return(success ? (value == null ? String.Empty : value.ToString()) : "Not Supported"); }
public static string ToDisplayText <T>(this IAutomationProperty <T> automationProperty) { try { var success = automationProperty.TryGetValue(out T value); return(success ? (value == null ? String.Empty : value.ToString()) : "Not Supported"); } catch (Exception ex) { return($"Exception getting value ({ex.HResult})"); } }
private string FromAutomationProperty(IAutomationProperty <string> value) { return(value.ToDisplayText()); }
public static DetailViewModel FromAutomationProperty <T>(string key, IAutomationProperty <T> value) { return(new DetailViewModel(key, value.ToDisplayText())); }