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