示例#1
0
 private void PopulateColorsClick(object sender, RoutedEventArgs e)
 {
     foreach (var p in typeof(Windows.UI.Colors).GetTypeInfo().DeclaredProperties)
     {
         if (p.PropertyType == typeof(Color))
         {
             ColorEntry ce = new ColorEntry()
             {
                 ColorName = p.Name
             };
             ce.Color = (Color)p.GetMethod.Invoke(null, new object[0]);
             ColorEntries.Add(ce);
         }
     }
 }
 private void PopulateColorsClick(object sender, RoutedEventArgs e)
 {
     foreach (var p in typeof(Windows.UI.Colors).GetTypeInfo().DeclaredProperties)
     {
         if (p.PropertyType == typeof(Color))
         {
             ColorEntry ce = new ColorEntry() { ColorName = p.Name };
             ce.Color = (Color)p.GetMethod.Invoke(null, new object[0]);
             ColorEntries.Add(ce);
         }
     }
 }