Browse Source

add source to allviewstester

Charlie Kindel 5 years ago
parent
commit
aa34bad858
1 changed files with 8 additions and 4 deletions
  1. 8 4
      UICatalog/Scenarios/AllViewsTester.cs

+ 8 - 4
UICatalog/Scenarios/AllViewsTester.cs

@@ -316,7 +316,7 @@ namespace UICatalog {
 
 
 		void UpdateTitle (View view)
 		void UpdateTitle (View view)
 		{
 		{
-			_hostPane.Title = $"{view.GetType().Name} - {view.X.ToString ()}, {view.Y.ToString ()}, {view.Width.ToString ()}, {view.Height.ToString ()}";
+			_hostPane.Title = $"{view.GetType ().Name} - {view.X.ToString ()}, {view.Y.ToString ()}, {view.Width.ToString ()}, {view.Height.ToString ()}";
 		}
 		}
 
 
 		List<Type> GetAllViewClassesCollection ()
 		List<Type> GetAllViewClassesCollection ()
@@ -361,13 +361,17 @@ namespace UICatalog {
 				}
 				}
 			}
 			}
 
 
-			if (view == null) return null;
-
 			// If the view supports a Title property, set it so we have something to look at
 			// If the view supports a Title property, set it so we have something to look at
-			if (view.GetType ().GetProperty ("Title") != null) {
+			if (view != null && view.GetType ().GetProperty ("Title") != null) {
 				view?.GetType ().GetProperty ("Title")?.GetSetMethod ()?.Invoke (view, new [] { ustring.Make ("Test Title") });
 				view?.GetType ().GetProperty ("Title")?.GetSetMethod ()?.Invoke (view, new [] { ustring.Make ("Test Title") });
 			}
 			}
 
 
+			// If the view supports a Source property, set it so we have something to look at
+			if (view != null && view.GetType ().GetProperty ("Source") != null) {
+				var source = new ListWrapper (new List<ustring> () { ustring.Make ("List Item #1"), ustring.Make ("List Item #2"), ustring.Make ("List Item #3")});
+				view?.GetType ().GetProperty ("Source")?.GetSetMethod ()?.Invoke (view, new [] { source });
+			}
+
 			// Set Settings
 			// Set Settings
 			_computedCheckBox.Checked = view.LayoutStyle == LayoutStyle.Computed;
 			_computedCheckBox.Checked = view.LayoutStyle == LayoutStyle.Computed;