EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowCase", "Samples\ShowCase\ShowCase.csproj", "{56329D48-D382-4850-93DE-59C453894E8A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{C40A3F21-0558-4265-9251-718C1564D10A}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlLib", "Samples\ControlLib\ControlLib.csproj", "{91F1CE07-EECE-4F1D-A3EE-7239B563654A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{1E5C7065-28F9-4A1A-A2FB-DB5E03A63CB3}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU
{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.Build.0 = Release|Any CPU
{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}.Release|Any CPU.Build.0 = Release|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C40A3F21-0558-4265-9251-718C1564D10A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C40A3F21-0558-4265-9251-718C1564D10A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C40A3F21-0558-4265-9251-718C1564D10A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C40A3F21-0558-4265-9251-718C1564D10A}.Release|Any CPU.Build.0 = Release|Any CPU
{91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1E5C7065-28F9-4A1A-A2FB-DB5E03A63CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1E5C7065-28F9-4A1A-A2FB-DB5E03A63CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>netstandard2.0</TargetFrameworks>
+ <TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Crow</AssemblyName>
<Copyright>
</Copyright>
- <AssemblyVersion>0.8.6</AssemblyVersion>
+ <AssemblyVersion>0.8.7</AssemblyVersion>
<Description>C.R.O.W. is a widget toolkit and rendering engine entirely developed in C# with templates, styles, compositing, and bindings.</Description>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<PackageCopyright>Copyright 2013-2019</PackageCopyright>
<PackageReleaseNotes></PackageReleaseNotes>
<DefineConstants>DESIGN_MODE</DefineConstants>
+ <ReleaseVersion>0.8.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<?xml version="1.0"?>
<Border Background="{./Background}" MinimumSize="50,20" Name="Content"
Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
- MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black;caption.Foreground=White}"
- MouseLeave="{Foreground=Transparent;caption.Foreground=LightGrey}"
+ MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black};{caption.Foreground=White}"
+ MouseLeave="{Foreground=Transparent};{caption.Foreground=LightGrey}"
MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
>
<?xml version="1.0"?>
-<Border BorderWidth="1" Margin="1" MinimumSize="10,10">
+<Border BorderWidth="1" Margin="1" MinimumSize="10,10" Background="{./Background}">
<Scroller Name="scroller1" Margin="1" >
<VerticalStack
Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
<VerticalStack Spacing="0">
<!-- <Border Name="TitleBar" BorderWidth="1" Foreground="White" Width="{./WidthPolicy}" Height="Fit"
Background="vgradient|0:0.4,0.6,0.0,0.5|1:0.0,0.8,0.8,0.9">-->
- <HorizontalStack Background="{./TitleBarBackground}"
+ <HorizontalStack Background="{./TitleBarBackground}" Width="Stretched"
Name="hs" Margin="2" Spacing="0" Height="Fit">
<Widget Width="5"/>
<Image Margin="1" Width="12" Height="12" Path="{./Icon}"/>
}
public interface IObservableList {
event EventHandler<ListChangedEventArg> ListAdd;
- event EventHandler<ListChangedEventArg> ListRemove;
+ event EventHandler<ListChangedEventArg> ListRemove;
+ event EventHandler<ListChangedEventArg> ListEdit;
+
+ void Insert ();
+ void Remove ();
+ void RaiseEdit ();
}
}
-//
-// Instantiator.cs
+// Copyright (c) 2013-2019 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.Collections.Generic;
emitGOLoad (ctx, tmpXml);
ctx.curLine = curLine;
- //emitCheckAndBindValueChanged (ctx);
}
/// <summary>
/// Parses the item template tag.
Debug.WriteLine("\tDataSource Changed: " + dm.Name);
#endif
}
+
/// <summary>
/// create the valuechanged handler, the datasourcechanged handler and emit event handling
/// </summary>
- void emitDataSourceBindings(IMLContext ctx, BindingDefinition bindingDef){
+ void emitDataSourceBindings (IMLContext ctx, BindingDefinition bindingDef)
+ {
+ Delegate del = emitDataSourceBindings (ctx.CurrentNodeType.GetProperty (bindingDef.SourceMember), bindingDef);
+
+ //store dschange delegate in instatiator instance for access while instancing graphic object
+ int delDSIndex = cachedDelegates.Count;
+ cachedDelegates.Add (del);
+
+ ctx.emitCachedDelegateHandlerAddition (delDSIndex, CompilerServices.eiDSChange);
+ }
+
+ /// <summary>
+ /// create the valuechanged handler and the datasourcechanged handler and return the
+ /// DataSourceChange delegate
+ /// </summary>
+ public Delegate emitDataSourceBindings (PropertyInfo piSource, BindingDefinition bindingDef){
+
#if DEBUG_BINDING_FUNC_CALLS
Console.WriteLine ($"emitDataSourceBindings: {bindingDef}");
#endif
DynamicMethod dm = null;
ILGenerator il = null;
int dmVC = 0;
- PropertyInfo piSource = ctx.CurrentNodeType.GetProperty(bindingDef.SourceMember);
+
//if no dataSource member name is provided, valuechange is not handle and datasource change
//will be used as origine value
string delName = $"dyn_DSvalueChanged_{bindingDef.SourceMember}_{bindingDef.TargetMember}_{NewId}";
if (!string.IsNullOrEmpty(bindingDef.TargetMember)){
-#region create valuechanged method
+ #region create valuechanged method
dm = new DynamicMethod (delName,
typeof (void),
CompilerServices.argsBoundValueChange, true);
il.MarkLabel (newDSIsNull);
il.Emit (OpCodes.Ret);
- //store dschange delegate in instatiator instance for access while instancing graphic object
- int delDSIndex = cachedDelegates.Count;
- cachedDelegates.Add(dm.CreateDelegate (CompilerServices.ehTypeDSChange, this));
-#endregion
-
- ctx.emitCachedDelegateHandlerAddition(delDSIndex, CompilerServices.eiDSChange);
-
#if DEBUG_BINDING
Debug.WriteLine("\tDataSource ValueChanged: " + delName);
Debug.WriteLine("\tDataSource Changed: " + dm.Name);
#endif
+
+ return dm.CreateDelegate (CompilerServices.ehTypeDSChange, this);
+#endregion
}
static void emitSetValue (ILGenerator il, MemberInfo mi)
il.Emit (OpCodes.Stfld, mi as FieldInfo);
else if (mi.MemberType == MemberTypes.Property) {
MethodInfo mt = (mi as PropertyInfo).GetSetMethod ();
- //il.Emit (mt.IsVirtual?OpCodes.Callvirt:OpCodes.Call, mt);
- il.Emit (OpCodes.Callvirt, mt);
+ il.Emit (mt.IsVirtual?OpCodes.Callvirt:OpCodes.Call, mt);
} else
throw new NotImplementedException ();
}
loadStyling ();
initTooltip ();
- //initContextMenus ();
+ initContextMenus ();
Startup ();
}
-//
-// ItemTemplate.cs
+// Copyright (c) 2013-2019 Bruyère Jean-Philippe <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.IO;
-//
-// IListChanged.cs
+// Copyright (c) 2013-2019 Bruyère Jean-Philippe 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.Collections.Generic;
namespace Crow
-{
- public class ObservableList<T> : List<T> , IObservableList {
+{
+ public class ObservableList<T> : List<T>, IObservableList, IValueChange {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged (string MemberName, object _value)
+ {
+ ValueChanged?.Invoke (this, new ValueChangeEventArgs (MemberName, _value));
+ }
+ #endregion
+
+ #region IObservableList implementation
public event EventHandler<ListChangedEventArg> ListAdd;
- public event EventHandler<ListChangedEventArg> ListRemove;
+ public event EventHandler<ListChangedEventArg> ListRemove;
+ public event EventHandler<ListChangedEventArg> ListEdit;
+ #endregion
+
+ public ObservableList() : base () {}
+ public ObservableList (IEnumerable<T> collection) : base (collection) { }
+
+ int selectedIndex = -1;
+
+ public int SelectedIndex {
+ get => selectedIndex;
+ set {
+ if (selectedIndex == value)
+ return;
- public void AddElement (T elem) {
- this.Add(elem);
+ if (value > Count - 1)
+ selectedIndex = Count - 1;
+ else
+ selectedIndex = value;
+
+ NotifyValueChanged ("SelectedIndex", selectedIndex);
+ NotifyValueChanged ("SelectedItem", SelectedItem);
+ }
+ }
+ public T SelectedItem {
+ get => selectedIndex < 0 ? default(T) : this [selectedIndex];
+ set {
+ this [selectedIndex] = value;
+ }
+ }
+ public new void Add (T elem) {
+ base.Add (elem);
ListAdd.Raise (this, new ListChangedEventArg (this.Count - 1, elem));
+ SelectedIndex = this.Count - 1;
}
- public void RemoveElement (T elem) {
- System.Diagnostics.Debug.WriteLine ("remove elem:" + elem);
- int idx = this.IndexOf (elem);
- this.RemoveAt (idx);
+ public new void Remove (T elem) {
+ int idx = IndexOf (elem);
+ base.RemoveAt (idx);
ListRemove.Raise (this, new ListChangedEventArg (idx, elem));
}
+ public void Remove () {
+ if (selectedIndex < 0)
+ return;
+ RemoveAt (selectedIndex);
+ SelectedIndex--;
+ }
+ public void Insert ()
+ {
+ base.Insert (selectedIndex+1, default(T));
+ SelectedIndex++;
+ ListAdd.Raise (this, new ListChangedEventArg (selectedIndex, SelectedItem));
+ }
+ public void RaiseEdit () {
+ if (selectedIndex < 0)
+ return;
+ ListEdit.Raise (this, new ListChangedEventArg (selectedIndex, SelectedItem));
+ }
+
+ public new void RemoveAt (int index)
+ {
+ base.RemoveAt (index);
+ ListRemove.Raise (this, new ListChangedEventArg (index, null));
+ }
+ public void RaiseEditAt (int index) {
+ ListEdit.Raise (this, new ListChangedEventArg (index, this[index]));
+ }
}
}
-//
-// Image.cs
+// Copyright (c) 2013-2019 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 Crow.Cairo;
public ListBox (Interface iface) : base(iface) {}
#endregion
+
+
}
}
int rightSlope;
Measure tabHeight, tabWidth;
Orientation _orientation;
- int selectedTab;
+ int selectedTab = -1;
#endregion
#region public properties
--- /dev/null
+// Copyright (c) 2019 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+namespace Crow
+{
+ /// <summary>
+ /// Table column definition
+ /// </summary>
+ public class Column : IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged (string MemberName, object _value)
+ => ValueChanged.Raise (this, new ValueChangeEventArgs (MemberName, _value));
+ #endregion
+
+ string caption;
+ Measure width = Measure.Inherit;
+
+ public string Caption {
+ get => caption;
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ /// <summary>
+ /// column width, special value 'Inherit' will be used to share table width equaly among columns
+ /// </summary>
+ /// <value>The column's width.</value>
+ public Measure Width {
+ get => width;
+ set {
+ if (width == value)
+ return;
+ width = value;
+ NotifyValueChanged ("Width", width);
+ }
+ }
+
+ //public string Data {
+
+ //}
+ }
+
+
+ public class Table : TemplatedGroup
+ {
+ public Table () : base () {}
+ public Table (Interface iFace) : base (iFace) { }
+
+ public ObservableList<Column> Columns = new ObservableList<Column> ();
+ }
+}
IEnumerable data;
int _selectedIndex = -1;
Color selBackground, selForeground;
+ bool selColoring;
int itemPerPage = 50;
CrowThread loadingThread = null;
: items.Children;
}
}
+ /// <summary>
+ /// Enable SelectionBackground and SelectionForeground color for selected item
+ /// </summary>
+ [DefaultValue (false)]
+ public bool SelectionColoring {
+ get => selColoring;
+ set {
+ if (selColoring == value)
+ return;
+ selColoring = value;
+ NotifyValueChanged ("SelectionColoring", selColoring);
+ }
+ }
[DefaultValue(-1)]public virtual int SelectedIndex{
get { return _selectedIndex; }
set {
if (value == _selectedIndex)
return;
- /*if (_selectedIndex >= 0 && Items.Count > _selectedIndex) {
+ if (selColoring && _selectedIndex >= 0 && Items.Count > _selectedIndex) {
Items[_selectedIndex].Foreground = Color.Transparent;
Items[_selectedIndex].Background = Color.Transparent;
- }*/
+ }
_selectedIndex = value;
- /*if (_selectedIndex >= 0 && Items.Count > _selectedIndex) {
+ if (selColoring && _selectedIndex >= 0 && Items.Count > _selectedIndex) {
Items[_selectedIndex].Foreground = SelectionForeground;
Items[_selectedIndex].Background = SelectionBackground;
- }*/
+ }
NotifyValueChanged ("SelectedIndex", _selectedIndex);
NotifyValueChanged ("SelectedItem", SelectedItem);
IObservableList ol = data as IObservableList;
ol.ListAdd -= Ol_ListAdd;
ol.ListRemove -= Ol_ListRemove;
+ ol.ListEdit -= Ol_ListEdit;
}
data = value;
IObservableList ol = data as IObservableList;
ol.ListAdd += Ol_ListAdd;
ol.ListRemove += Ol_ListRemove;
+ ol.ListEdit += Ol_ListEdit;
}
NotifyValueChanged ("Data", data);
} else
loadItem (e.Element, items, dataTest);
}
+ void Ol_ListEdit (object sender, ListChangedEventArg e) {
+ if (this.isPaged) {
+ throw new NotImplementedException ();
+ } else
+ items.Children [e.Index].DataSource = e.Element;
+
+ }
[DefaultValue("SteelBlue")]
public virtual Color SelectionBackground {
}
}
internal virtual void itemClick(object sender, MouseButtonEventArgs e){
- SelectedIndex = (int)((IList)data)?.IndexOf((sender as Widget).DataSource);
+ //SelectedIndex = (int)((IList)data)?.IndexOf((sender as Widget).DataSource);
+ SelectedIndex = items.Children.IndexOf(sender as Widget);
}
bool emitHelperIsAlreadyExpanded (Widget go){
{
base.OnDataSourceChanged (sender, e);
}
+
+ public void OnInsertClick (object sender, MouseEventArgs e)
+ {
+ if (data is IObservableList)
+ (data as IObservableList).Insert ();
+ }
+ public void OnRemoveClick (object sender, MouseEventArgs e)
+ {
+ if (data is IObservableList)
+ (data as IObservableList).Remove ();
+ }
+ public void OnUpdateClick (object sender, MouseEventArgs e) {
+ if (data is IObservableList)
+ (data as IObservableList).RaiseEdit ();
+ }
}
}
-//
-// Window.cs
+// Copyright (c) 2013-2019 Bruyère Jean-Philippe 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;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
+ <TargetFramework>net472</TargetFramework>
<OutputType>Exe</OutputType>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
+ <ReleaseVersion>0.8.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net471</TargetFrameworks>
+ <TargetFrameworks>net472</TargetFrameworks>
<OutputType>Exe</OutputType>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<ReleaseVersion>0.8.0</ReleaseVersion>