</Template>
</CheckBox>
</Template>
- <Border Background="DimGrey" BorderWidth="1" Margin="1"
- MinimumSize="{../../MinimumPopupSize}" Fit="true">
+ <Border Background="DimGrey" BorderWidth="1" Margin="1" Height="Fit" Width="1"
+ MinimumSize="{../../MinimumPopupSize}" >
<Scroller Name="scroller1" Margin="2"
MaximumSize="0,200"
HorizontalAlignment="Left">
<?xml version="1.0"?>
-<Container Fit="true" Margin="0" Focusable="true"
+<Container Height="Fit" Margin="0" Focusable="true"
HorizontalAlignment="Left"
MouseEnter="{Background=SteelBlue}"
MouseLeave="{Background=Transparent}">
- <Label Text="{}"/>
+ <Label Text="{}" HorizontalAlignment="Left" />
</Container>
-//
-// Configuration.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Reflection;
static Configuration ()
{
string configRoot =
- Path.Combine(
-
- Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
- ".config");
+ Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile), ".config");
Assembly a = Assembly.GetEntryAssembly ();
string appName = a.GetName().Name;
-//
-// ValueChangeEventArgs.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
namespace Crow
{
+ /// <summary>
+ /// Arguments for the ValueChange event used for Binding
+ /// </summary>
public class ValueChangeEventArgs: EventArgs
{
+ /// <summary>The name of the member whose value has changed</summary>
public string MemberName;
+ /// <summary>New value for that member</summary>
public object NewValue;
-
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:Crow.ValueChangeEventArgs"/> class.
+ /// </summary>
+ /// <param name="_memberName">Member name.</param>
+ /// <param name="_newValue">New value.</param>
public ValueChangeEventArgs (string _memberName, object _newValue) : base()
{
MemberName = _memberName;
-//
-// ComboBox.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Xml.Serialization;
-//
-// Popper.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Xml.Serialization;
-//
-// TabItem.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
-using System.Xml.Serialization;
using System.ComponentModel;
-using System.Diagnostics;
using Crow.Cairo;
using System.Linq;
{
gr.Save ();
+ parentRWLock.EnterReadLock ();
+
TabView tv = Parent as TabView;
+ //TODO:this appens in designView
+ if (tv == null) {
+ parentRWLock.ExitReadLock ();
+ return;
+ }
+
Rectangle r = TabTitle.Slot;
r.Width = TabWidth;
r.Right + tv.RightSlope, r.Bottom-0.5);
gr.LineTo (Slot.Width-0.5, r.Bottom-0.5);
+ parentRWLock.ExitReadLock ();
gr.LineTo (Slot.Width-0.5, Slot.Height-0.5);
gr.LineTo (0.5, Slot.Height-0.5);
}
}
[XmlIgnore]public virtual object SelectedItem{
- get { return data == null ? null : _selectedIndex < 0 ? data.GetDefaultValue() : ((IList)data)?[_selectedIndex]; }
+ get { return data == null ? null : _selectedIndex < 0 ? data.GetDefaultValue() : data is IList tmp ? tmp[_selectedIndex] : null; }
set {
if (data == null) {
SelectedIndex = -1;
//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 ();
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 ();
<LogicalName>ui.%(Filename)%(Extension)</LogicalName>
<Link>Templates\%(Filename)%(Extension)</Link>
</EmbeddedResource>
- </ItemGroup>
+ </ItemGroup>
</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Width="60%" Height="60%" Spacing="10" Background="DimGrey" Margin="20" ClipToClientRect="false" CornerRadius="10">
+ <Label Background="Jet" Text="{TestList3SelProp1}"/>
+ <ComboBox Data="{TestList3Props1}">
+ </ComboBox>
+
+</VerticalStack>
\ No newline at end of file