diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-02-08 07:33:36 +0100 |
|---|---|---|
| committer | j-p <jp_bruyere@hotmail.com> | 2020-05-10 00:50:02 +0200 |
| commit | 2774a37e0a20412971e17571e152768b299318db (patch) | |
| tree | c3f377df1a1d730442cf728c6174f98c9ab12a12 /Samples/BasicTests | |
| parent | a58f28741bf91be4d0fc077a6088bd8864e12c1f (diff) | |
wip
Diffstat (limited to 'Samples/BasicTests')
| -rw-r--r-- | Samples/BasicTests/BasicTests.cs | 75 | ||||
| -rw-r--r-- | Samples/BasicTests/BasicTests.csproj | 2 |
2 files changed, 62 insertions, 15 deletions
diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index 059bf852..54bb8215 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -30,7 +30,7 @@ namespace tests //testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" }; //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" }; - testFiles = new string [] { @"Interfaces/Group/5.crow" }; + testFiles = new string [] { @"Interfaces/TemplatedGroup/3.crow" }; //testFiles = new string [] { @"Interfaces/Divers/perfMeasures.crow" }; //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" }; testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); @@ -138,31 +138,78 @@ namespace tests return; NotifyValueChanged ("alignment", Enum.Parse (typeof (Alignment), rb.Caption)); } - public IList<String> List2 = new List<string> (new string [] + public IEnumerable<String> List2 = new List<string> (new string [] { "string1", "string2", "string3", -// "string4", -// "string5", -// "string6", -// "string7", -// "string8", -// "string8", -// "string8", -// "string8", -// "string8", -// "string8", -// "string9" + "string4", + "string5", + "string6", + "string7", + "string8", + "string8", + "string8", + "string8", + "string8", + "string8", + "string9" } ); - public IList<String> TestList2 { + public IEnumerable<String> TestList2 { set { List2 = value; NotifyValueChanged ("TestList2", testList); } get { return List2; } } + public class TestClass + { + public string Prop1 { get; set; } + public string Prop2 { get; set; } + + public override string ToString () + => $"{Prop1}, {Prop2}"; + + } + public IEnumerable<TestClass> List3 = new List<TestClass> (new TestClass [] + { + new TestClass { Prop1 = "string1", Prop2="prop2-1" }, + new TestClass { Prop1 = "string2", Prop2="prop2-2" }, + new TestClass { Prop1 = "string3", Prop2="prop2-3" }, + } + ); + public IEnumerable<string> TestList3Props1 => List3.Select (sc => sc.Prop1).ToList(); + public IEnumerable<TestClass> TestList3 { + set { + List3 = value; + NotifyValueChanged ("TestList3", testList); + } + get { return List3; } + } + string prop1; + public string TestList3SelProp1 { + get => prop1; + set { + if (prop1 == value) + return; + prop1 = value; + + NotifyValueChanged ("TestList3SelProp1", prop1); + } + } + + string selString; + public string TestList2SelectedString { + get => selString; + set { + if (selString == value) + return; + selString = value; + NotifyValueChanged ("TestList2SelectedString", selString); + } + } + List<Color> testList = Color.ColorDic.Values//.OrderBy(c=>c.Hue) //.ThenBy(c=>c.Value).ThenBy(c=>c.Saturation) .ToList (); diff --git a/Samples/BasicTests/BasicTests.csproj b/Samples/BasicTests/BasicTests.csproj index e1208a42..813b9b66 100644 --- a/Samples/BasicTests/BasicTests.csproj +++ b/Samples/BasicTests/BasicTests.csproj @@ -29,5 +29,5 @@ <LogicalName>ui.%(Filename)%(Extension)</LogicalName> <Link>Templates\%(Filename)%(Extension)</Link> </EmbeddedResource> - </ItemGroup> + </ItemGroup> </Project>
\ No newline at end of file |