Example #1
0
        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");
        }
Example #2
0
 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})");
     }
 }
Example #3
0
 private string FromAutomationProperty(IAutomationProperty <string> value)
 {
     return(value.ToDisplayText());
 }
Example #4
0
 public static DetailViewModel FromAutomationProperty <T>(string key, IAutomationProperty <T> value)
 {
     return(new DetailViewModel(key, value.ToDisplayText()));
 }