]> O.S.I.I.S - jp/crow.git/commitdiff
use [CallerMemberName] for value change notify
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 4 Jun 2020 17:58:26 +0000 (19:58 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 4 Jun 2020 17:58:26 +0000 (19:58 +0200)
44 files changed:
Crow/src/Interface.cs
Crow/src/Widgets/Border.cs
Crow/src/Widgets/Button.cs
Crow/src/Widgets/CheckBox.cs
Crow/src/Widgets/ColorPicker.cs
Crow/src/Widgets/ColorSlider.cs
Crow/src/Widgets/ComboBox.cs
Crow/src/Widgets/DirectoryView.cs
Crow/src/Widgets/DockWindow.cs
Crow/src/Widgets/EnumSelector.cs
Crow/src/Widgets/Expandable.cs
Crow/src/Widgets/FileDialog.cs
Crow/src/Widgets/GenericStack.cs
Crow/src/Widgets/Grid.cs
Crow/src/Widgets/HueSelector.cs
Crow/src/Widgets/IMLContainer.cs
Crow/src/Widgets/Image.cs
Crow/src/Widgets/Label.cs
Crow/src/Widgets/Menu.cs
Crow/src/Widgets/MenuItem.cs
Crow/src/Widgets/MessageBox.cs
Crow/src/Widgets/NumericControl.cs
Crow/src/Widgets/Popper.cs
Crow/src/Widgets/RadioButton.cs
Crow/src/Widgets/SaturationValueSelector.cs
Crow/src/Widgets/Scalable.cs
Crow/src/Widgets/ScrollBar.cs
Crow/src/Widgets/Scroller.cs
Crow/src/Widgets/ScrollingObject.cs
Crow/src/Widgets/Shape.cs
Crow/src/Widgets/Slider.cs
Crow/src/Widgets/Splitter.cs
Crow/src/Widgets/TabItem.cs
Crow/src/Widgets/TabView.cs
Crow/src/Widgets/TemplatedControl.cs
Crow/src/Widgets/TemplatedGroup.cs
Crow/src/Widgets/TextRun.cs
Crow/src/Widgets/TreeView.cs
Crow/src/Widgets/Trend.cs
Crow/src/Widgets/Widget.cs
Crow/src/Widgets/Window.cs
Samples/ShowCase/ShowCase.cs
Samples/ShowCase/ui/showcase.crow
Samples/common/SampleBase.cs

index 5adf3172cf4f38b96c6b65e3d5d6e1ec86c81aad..9757e76ee0a189416525de337b6457e2af0ac0ed 100644 (file)
@@ -9,6 +9,7 @@ using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Threading;
 using Crow.Cairo;
@@ -45,11 +46,15 @@ namespace Crow
        {
                #region IValueChange implementation
                public event EventHandler<ValueChangeEventArgs> ValueChanged;
-               public virtual void NotifyValueChanged (string MemberName, object _value)
+               public void NotifyValueChanged (string MemberName, object _value)
                {
                        //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
                        ValueChanged.Raise (this, new ValueChangeEventArgs (MemberName, _value));
                }
+               public void NotifyValueChanged (object _value, [CallerMemberName] string caller = null)
+               {
+                       NotifyValueChanged (caller, _value);
+               }
                #endregion
 
                internal static List<Assembly> crowAssemblies = new List<Assembly> ();
index cc331e78e11656787cfe3c76012647bd54d0fe59..e0a9ba5e40b432ba1ed3904a451d1ac08de0d5e7 100644 (file)
@@ -43,7 +43,7 @@ namespace Crow
                                if (raisedColor == value)
                                        return;
                                raisedColor = value;
-                               NotifyValueChanged ("RaisedColor", raisedColor);
+                               NotifyValueChangedAuto (raisedColor);
                                RegisterForRedraw ();
                        }
                }
@@ -56,7 +56,7 @@ namespace Crow
                                if (sunkenColor == value)
                                        return;
                                sunkenColor = value;
-                               NotifyValueChanged ("SunkenColor", sunkenColor);
+                               NotifyValueChangedAuto (sunkenColor);
                                RegisterForRedraw ();
                        }
                }
index 6d997a23560b5ad5d1a8ce06230947857095edd2..db83d4b295b192810b5c91f0323ef7fbb0bc765c 100644 (file)
@@ -29,18 +29,12 @@ namespace Crow
                        IsPressed = true;
 
                        base.onMouseDown (sender, e);
-
-                       //TODO:remove
-                       NotifyValueChanged ("State", "pressed");
                }
                public override void onMouseUp (object sender, MouseButtonEventArgs e)
                {
                        IsPressed = false;
 
                        base.onMouseUp (sender, e);
-
-                       //TODO:remove
-                       NotifyValueChanged ("State", "normal");
                }
                #endregion
 
@@ -51,7 +45,7 @@ namespace Crow
                                if (image == value)
                                        return;
                                image = value;
-                               NotifyValueChanged ("Image", image);
+                               NotifyValueChangedAuto (image);
                        }
                }
                [DefaultValue(false)]
@@ -65,7 +59,7 @@ namespace Crow
 
                                isPressed = value;
 
-                               NotifyValueChanged ("IsPressed", isPressed);
+                               NotifyValueChangedAuto (isPressed);
 
                                if (isPressed)
                                        Pressed.Raise (this, null);
index 50215241abe89a426d668517e16441bba16e6a0e..cd0297f7a728d07c38151f80fb1e859309894175 100644 (file)
@@ -34,7 +34,7 @@ namespace Crow
 
                                isChecked = value;
 
-                               NotifyValueChanged ("IsChecked", value);
+                               NotifyValueChangedAuto (isChecked);
 
                                if (isChecked)
                                        Checked.Raise (this, null);
index c62659a00a106766ed00149c31ebc5eea3574fda..4f5c0539c010f411e614185673b958c3fa64b3b3 100644 (file)
@@ -29,7 +29,7 @@ namespace Crow
                                if (currentColor.Equals(value))
                                        return;
                                currentColor = value;
-                               NotifyValueChanged ("CurrentColor", currentColor);
+                               NotifyValueChangedAuto (currentColor);
                                NotifyValueChanged ("CurrentColor2", Color.FromHSV (currentColor.Hue, currentColor.Value, currentColor.Saturation, currentColor.A));
                        }
                }
index 1e4029dcda8f8db8e03d6791031ab1ae76d7f7db..52e7e620702a5e73d0a5eedf929fa77625c95017 100644 (file)
@@ -34,7 +34,7 @@ namespace Crow
                                if (orientation == value)
                                        return;
                                orientation = value;
-                               NotifyValueChanged ("Orientation", orientation);
+                               NotifyValueChangedAuto (orientation);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -45,7 +45,7 @@ namespace Crow
                                if (cursorType == value)
                                        return;
                                cursorType = value;
-                               NotifyValueChanged ("CursorType", cursorType);
+                               NotifyValueChangedAuto (cursorType);
                                RegisterForRedraw ();
                        }
                }
@@ -56,7 +56,7 @@ namespace Crow
                                if (component == value)
                                        return;
                                component = value;
-                               NotifyValueChanged ("Component", component);
+                               NotifyValueChangedAuto (component);
                                RegisterForRedraw ();
                        }
                }
@@ -68,7 +68,7 @@ namespace Crow
 
                                currentColor = value;
 
-                               NotifyValueChanged ("CurrentColor", currentColor);
+                               NotifyValueChangedAuto (currentColor);
                                RegisterForRedraw ();
 
                                switch (component) {
index cf706318df92de3446b971f8f14065373c5f947d..22672645c4f79cc1f50a23473513c0d53ae74cf0 100644 (file)
@@ -19,7 +19,7 @@ namespace Crow
                        get { return minimumPopupSize; }
                        set {
                                minimumPopupSize = value;
-                               NotifyValueChanged ("MinimumPopupSize", minimumPopupSize);
+                               NotifyValueChangedAuto (minimumPopupSize);
                        }
                }
 
index 8768d65f029db7970b3950fd496aab181be1e340..89f388d17d4fc8a9192aba4cdca504234b6c049a 100644 (file)
@@ -37,7 +37,7 @@ namespace Crow
                                if (value == _selectedItem)
                                        return;
                                _selectedItem = value;
-                               NotifyValueChanged ("SelectedItem", _selectedItem);
+                               NotifyValueChangedAuto (_selectedItem);
                        }
                }
                [DefaultValue(true)]
@@ -47,7 +47,7 @@ namespace Crow
                                if (showFiles == value)
                                        return;
                                showFiles = value;
-                               NotifyValueChanged ("ShowFiles", showFiles);
+                               NotifyValueChangedAuto (showFiles);
                                NotifyValueChanged ("FileSystemEntries", FileSystemEntries);
                        }
                }
@@ -58,7 +58,7 @@ namespace Crow
                                if (showHidden == value)
                                        return;
                                showHidden = value;
-                               NotifyValueChanged ("ShowHidden", showHidden);
+                               NotifyValueChangedAuto (showHidden);
                                NotifyValueChanged ("FileSystemEntries", FileSystemEntries);
                        }
                }
@@ -69,7 +69,7 @@ namespace Crow
                                if (fileMask == value)
                                        return;
                                fileMask = value;
-                               NotifyValueChanged ("FileMask", fileMask);
+                               NotifyValueChangedAuto (fileMask);
                                NotifyValueChanged ("FileSystemEntries", FileSystemEntries);
                        }
                }
@@ -80,7 +80,7 @@ namespace Crow
                                if (currentDirectory == value)
                                        return;
                                currentDirectory = value;
-                               NotifyValueChanged ("CurrentDirectory", currentDirectory);
+                               NotifyValueChangedAuto (currentDirectory);
                                NotifyValueChanged ("FileSystemEntries", FileSystemEntries);
                        }
                }
index 1c2f95a55a310c90c2a0748cf78aa7efb750f43e..e9c371795cc0ac0198a75c2d6a5fe323a588bd6e 100644 (file)
@@ -29,7 +29,7 @@ namespace Crow
                                if (isDocked == value)
                                        return;
                                isDocked = value;
-                               NotifyValueChanged ("IsDocked", isDocked);
+                               NotifyValueChangedAuto (isDocked);
                                NotifyValueChanged ("IsFloating", !isDocked);
                        }
                }
@@ -41,7 +41,7 @@ namespace Crow
                                if (docking == value)
                                        return;
                                docking = value;
-                               NotifyValueChanged ("DockingPosition", DockingPosition);
+                               NotifyValueChangedAuto (DockingPosition);
                        }
                }
                public override bool PointIsIn (ref Point m)
index bac4f5f6cd15b829d8f37323a0772df12a4b549e..7e0fd476593a20dc29677a34d2fde99c02b1cff1 100644 (file)
@@ -49,7 +49,7 @@ namespace Crow
                                        return;
                                iconsPrefix = value;
                                forceRefresh ();
-                               NotifyValueChanged ("IconsPrefix", iconsPrefix);
+                               NotifyValueChangedAuto (iconsPrefix);
                        }
                }
                [DefaultValue (".svg")]
@@ -60,7 +60,7 @@ namespace Crow
                                        return;
                                iconsExtension = value;
                                forceRefresh ();
-                               NotifyValueChanged ("IconsExtension", iconsExtension);
+                               NotifyValueChangedAuto (iconsExtension);
                        }
                }
                /// <summary>
@@ -76,7 +76,7 @@ namespace Crow
                                rbStyle = value;
                                radioButtonITor = null;
                                forceRefresh ();
-                               NotifyValueChanged ("RadioButtonStyle", rbStyle);
+                               NotifyValueChangedAuto (rbStyle);
                        }
                }
                /// <summary>
@@ -120,7 +120,7 @@ namespace Crow
                                } else
                                        enumValueContainer.ClearChildren ();
 
-                               NotifyValueChanged ("EnumValue", enumValue);
+                               NotifyValueChangedAuto (enumValue);
                                RegisterForRedraw ();
                        }
                }
index 3a480b244f502908124228df226196d226b0acbe..e0b3c72a6d8b09f79cef8c64e2474439ec4404f5 100644 (file)
@@ -74,7 +74,7 @@ namespace Crow
                                if (image == value)
                                        return;
                                image = value;
-                               NotifyValueChanged ("Image", image);
+                               NotifyValueChangedAuto (image);
                        }
                }
                [DefaultValue(false)]
@@ -93,7 +93,7 @@ namespace Crow
                                if (!isExp)
                                        _isExpanded = false;
 
-                               NotifyValueChanged ("IsExpanded", _isExpanded);
+                               NotifyValueChangedAuto (_isExpanded);
 
                                if (_isExpanded)
                                        onExpand (this, null);
index 4a095e1faf57df2a33a32bc2cc3a25122757c42d..8c58e632cf3efabff8adae788f4c682915514816 100644 (file)
@@ -35,7 +35,7 @@ namespace Crow
                                if (curDir == value)
                                        return;
                                curDir = value;
-                               NotifyValueChanged ("CurrentDirectory", curDir);
+                               NotifyValueChangedAuto (curDir);
                                SelectedDirectory = curDir;
                        }
                }
@@ -47,7 +47,7 @@ namespace Crow
                                if (searchPattern == value)
                                        return;
                                searchPattern = value;
-                               NotifyValueChanged ("SearchPattern", searchPattern);
+                               NotifyValueChangedAuto (searchPattern);
 
                        }
                }
@@ -58,7 +58,7 @@ namespace Crow
                                if (showHidden == value)
                                        return;
                                showHidden = value;
-                               NotifyValueChanged ("ShowHidden", showHidden);
+                               NotifyValueChangedAuto (showHidden);
                        }
                }
                [DefaultValue(true)]
@@ -68,7 +68,7 @@ namespace Crow
                                if (showFiles == value)
                                        return;
                                showFiles = value;
-                               NotifyValueChanged ("ShowFiles", showFiles);
+                               NotifyValueChangedAuto (showFiles);
                        }
                }
                public string SelectedFile {
@@ -77,7 +77,7 @@ namespace Crow
                                if (value == _selectedFile)
                                        return;
                                _selectedFile = value;
-                               NotifyValueChanged ("SelectedFile", _selectedFile);
+                               NotifyValueChangedAuto (_selectedFile);
                        }
                }
                public string SelectedDirectory {
@@ -86,7 +86,7 @@ namespace Crow
                                if (value == _selectedDir)
                                        return;
                                _selectedDir = value;
-                               NotifyValueChanged ("SelectedDirectory", _selectedDir);
+                               NotifyValueChangedAuto (_selectedDir);
                        }
                }
 
index a0fb4d0c680bfb29111100f86ca1564ea140075b..f44732521287bb0768eff30093279fec579d4e4c 100644 (file)
@@ -31,8 +31,8 @@ namespace Crow
             set { 
                                if (_spacing == value)
                                        return;
-                               _spacing = value; 
-                               NotifyValueChanged ("Spacing", Spacing);
+                               _spacing = value;
+                               NotifyValueChangedAuto (Spacing);
                                RegisterForLayouting (LayoutingType.Sizing|LayoutingType.ArrangeChildren);
                        }
         }
index ad776bd3c991e3eda20016fffcad795e70cb2e6b..56b37f169ca1f98f97a33aa580f2725718fc18e8 100644 (file)
@@ -70,9 +70,9 @@ namespace Crow
                                if (_columnCount == value)
                                        return;
 
-                               _columnCount = value; 
+                               _columnCount = value;
 
-                               NotifyValueChanged ("ColumnCount", ColumnCount);
+                               NotifyValueChangedAuto (ColumnCount);
                                this.RegisterForLayouting (LayoutingType.ArrangeChildren);
                        }
         }
@@ -84,9 +84,9 @@ namespace Crow
                                if (_rowCount == value)
                                        return;
 
-                               _rowCount = value; 
+                               _rowCount = value;
 
-                               NotifyValueChanged ("RowCount", RowCount);
+                               NotifyValueChangedAuto (RowCount);
                                this.RegisterForLayouting (LayoutingType.ArrangeChildren);
                        }
                }
index 3e761b300121e6518b2fa538e0109d265456c606..7bf2895c78818c19659908e3230c3e668eb93c2c 100644 (file)
@@ -53,7 +53,7 @@ namespace Crow
                                if (_orientation == value)
                                        return;
                                _orientation = value;
-                               NotifyValueChanged ("Orientation", _orientation);
+                               NotifyValueChangedAuto (_orientation);
                                RegisterForGraphicUpdate ();
                        }
                }
index 174ef08315dbc131987a1e43ccfad39eedd3ecbb..2dd74e7c292719d1167658b1af739bf4f263357a 100644 (file)
@@ -21,7 +21,7 @@ namespace Crow
                                        return;
                                path = value;
                                this.SetChild (IFace.CreateInstance (path));
-                               NotifyValueChanged ("Path", path);
+                               NotifyValueChangedAuto (path);
                        }
                }
        }
index b67c9d7057497bc9378c5913d60000a6072259da..04cb2e225478fabbf8e03c52b35fcdbbcbe2f0b2 100644 (file)
@@ -34,7 +34,7 @@ namespace Crow
                                if (scaled == value)
                                        return;
                                scaled = value;
-                               NotifyValueChanged ("Scaled", scaled);
+                               NotifyValueChangedAuto (scaled);
                                if (_pic == null)
                                        return;
                                _pic.Scaled = scaled;
@@ -51,7 +51,7 @@ namespace Crow
                                if (keepProps == value)
                                        return;
                                keepProps = value;
-                               NotifyValueChanged ("KeepProportions", keepProps);
+                               NotifyValueChangedAuto (keepProps);
                                if (_pic == null)
                                        return;
                                _pic.KeepProportions = keepProps;
@@ -78,7 +78,7 @@ namespace Crow
                                        Debug.WriteLine (ex.Message);
                                        _pic = null;
                                }
-                               NotifyValueChanged ("Path", Path);
+                               NotifyValueChangedAuto (Path);
                        }
                }
                /// <summary>
@@ -104,7 +104,7 @@ namespace Crow
                                if (_pic == value)
                                        return;
                                _pic = value;
-                               NotifyValueChanged ("Picture", _pic);
+                               NotifyValueChangedAuto (_pic);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -119,7 +119,7 @@ namespace Crow
                                if (opacity == value)
                                        return;
                                opacity = value;
-                               NotifyValueChanged ("Faded", opacity);
+                               NotifyValueChangedAuto (opacity);
                                RegisterForRedraw ();
                        }
                }
index e500b98f0944b78f74335926055a9bee80185f63..68541c5f1acc1300017e571150568f4ad835bf23 100644 (file)
@@ -60,7 +60,7 @@ namespace Crow {
                                if (selBackground == value)
                                        return;
                                selBackground = value;
-                               NotifyValueChanged ("SelectionBackground", selBackground);
+                               NotifyValueChangedAuto (selBackground);
                                RegisterForRedraw ();
                        }
                }
@@ -71,7 +71,7 @@ namespace Crow {
                                if (selForeground == value)
                                        return;
                                selForeground = value;
-                               NotifyValueChanged ("SelectionForeground", selForeground);
+                               NotifyValueChangedAuto (selForeground);
                                RegisterForRedraw ();
                        }
                }
@@ -84,7 +84,7 @@ namespace Crow {
                                        return;
                                _textAlignment = value;
                                RegisterForRedraw ();
-                               NotifyValueChanged ("TextAlignment", _textAlignment);
+                               NotifyValueChangedAuto (_textAlignment);
                        }
         }
                [DefaultValue(false)]
@@ -95,7 +95,7 @@ namespace Crow {
                                        return;
                                horizontalStretch = value;
                                RegisterForRedraw ();
-                               NotifyValueChanged ("HorizontalStretch", horizontalStretch);
+                               NotifyValueChangedAuto (horizontalStretch);
                        }
                }
                [DefaultValue(false)]
@@ -106,7 +106,7 @@ namespace Crow {
                                        return;
                                verticalStretch = value;
                                RegisterForRedraw ();
-                               NotifyValueChanged ("VerticalStretch", verticalStretch);
+                               NotifyValueChangedAuto (verticalStretch);
                        }
                }
                [DefaultValue("label")]
@@ -141,7 +141,7 @@ namespace Crow {
                                if (value == _selectable)
                                        return;
                                _selectable = value;
-                               NotifyValueChanged ("Selectable", _selectable);
+                               NotifyValueChangedAuto (_selectable);
                                SelBegin = -1;
                                SelRelease = -1;
                                RegisterForRedraw ();
@@ -156,7 +156,7 @@ namespace Crow {
                                if (value == _multiline)
                                        return;
                                _multiline = value;
-                               NotifyValueChanged ("Multiline", _multiline);
+                               NotifyValueChangedAuto (_multiline);
                                RegisterForGraphicUpdate();
                        }
                }
@@ -172,7 +172,7 @@ namespace Crow {
                                        _currentCol = lines [_currentLine].Length;
                                else
                                        _currentCol = value;
-                               NotifyValueChanged ("CurrentColumn", _currentCol);
+                               NotifyValueChangedAuto (_currentCol);
 
                                Rectangle cb = ClientRectangle;
 
@@ -227,7 +227,7 @@ namespace Crow {
                                int cc = _currentCol;
                                _currentCol = 0;
                                CurrentColumn = cc;
-                               NotifyValueChanged ("CurrentLine", _currentLine);
+                               NotifyValueChangedAuto (_currentLine);
                        }
                }
                [XmlIgnore]public Point CurrentPosition {
@@ -246,7 +246,7 @@ namespace Crow {
                                if (value == _selBegin)
                                        return;
                                _selBegin = value;
-                               NotifyValueChanged ("SelBegin", _selBegin);
+                               NotifyValueChangedAuto (_selBegin);
                                NotifyValueChanged ("SelectedText", SelectedText);
                        }
                }
@@ -259,7 +259,7 @@ namespace Crow {
                                if (value == _selRelease)
                                        return;
                                _selRelease = value;
-                               NotifyValueChanged ("SelRelease", _selRelease);
+                               NotifyValueChangedAuto (_selRelease);
                                NotifyValueChanged ("SelectedText", SelectedText);
                        }
                }
index 85f5485c4699dca5c5da4bb9245e583cba2e3814..afd4006035eaa3f2120ce206cd06560f37452c37 100644 (file)
@@ -48,7 +48,7 @@ namespace Crow
                                if (orientation == value)
                                        return;
                                orientation = value;
-                               NotifyValueChanged ("Orientation", orientation);
+                               NotifyValueChangedAuto (orientation);
                        }
                }
                [XmlIgnore]public bool AutomaticOpening
@@ -58,7 +58,7 @@ namespace Crow
                                if (autoOpen == value)
                                        return;
                                autoOpen = value;
-                               NotifyValueChanged ("AutomaticOpening", autoOpen);
+                               NotifyValueChangedAuto (autoOpen);
                        }
                }
                #endregion
index fe8cfe954aa4af4d028c89e462db3045dc7ae32e..2491c49b516e6d9b41a790d4b8c70ec2b008e22c 100644 (file)
@@ -53,7 +53,7 @@ namespace Crow
                                if (isOpened == value)
                                        return;
                                isOpened = value;
-                               NotifyValueChanged ("IsOpened", isOpened);
+                               NotifyValueChangedAuto (isOpened);
 
                                if (isOpened) {
                                        onOpen (this, null);
@@ -82,7 +82,7 @@ namespace Crow
                                        command.raiseAllValuesChanged ();
                                }
 
-                               NotifyValueChanged ("Command", command);
+                               NotifyValueChangedAuto (command);
                        }
                }
                
@@ -103,7 +103,7 @@ namespace Crow
                                        return;
                                icon = value;
                                if (command == null)
-                                       NotifyValueChanged ("Icon", icon);
+                                       NotifyValueChangedAuto (icon);
                        }
                }
                [DefaultValue("Fit")]
@@ -113,7 +113,7 @@ namespace Crow
                                if (popWidth == value)
                                        return;
                                popWidth = value;
-                               NotifyValueChanged ("PopWidth", popWidth);
+                               NotifyValueChangedAuto (popWidth);
                        }
                }
                [DefaultValue("Fit")]
@@ -123,7 +123,7 @@ namespace Crow
                                if (popHeight == value)
                                        return;
                                popHeight = value;
-                               NotifyValueChanged ("PopHeight", popHeight);
+                               NotifyValueChangedAuto (popHeight);
                        }
                }
                #endregion
index e5746c6060ed3dabdad325ad4d0514fbe9bad903..495d82d679da16947cd9ed053d8a74e1404478b6 100644 (file)
@@ -67,7 +67,7 @@ namespace Crow
                                if (message == value)
                                        return;
                                message = value;
-                               NotifyValueChanged ("Message", message);
+                               NotifyValueChangedAuto (message);
                        }
                }
                [DefaultValue("Ok")]
@@ -78,7 +78,7 @@ namespace Crow
                                if (okMessage == value)
                                        return;
                                okMessage = value;
-                               NotifyValueChanged ("OkMessage", okMessage);
+                               NotifyValueChangedAuto (okMessage);
                        }
                }
                [DefaultValue("Cancel")]
@@ -89,7 +89,7 @@ namespace Crow
                                if (cancelMessage == value)
                                        return;
                                cancelMessage = value;
-                               NotifyValueChanged ("CancelMessage", cancelMessage);
+                               NotifyValueChangedAuto (cancelMessage);
                        }
                }
                [DefaultValue("No")]
@@ -100,7 +100,7 @@ namespace Crow
                                if (noMessage == value)
                                        return;
                                noMessage = value;
-                               NotifyValueChanged ("NoMessage", noMessage);
+                               NotifyValueChangedAuto (noMessage);
                        }
                }
                [DefaultValue("Information")]
@@ -111,7 +111,7 @@ namespace Crow
                                if (msgType == value)
                                        return;
                                msgType = value;
-                               NotifyValueChanged ("MsgType", msgType);
+                               NotifyValueChangedAuto (msgType);
                                switch (msgType) {
                                case Type.Information:
                                        MsgIcon = "#Crow.Icons.iconInfo.svg";
@@ -155,7 +155,7 @@ namespace Crow
                                if (value == MsgIcon)
                                        return;
                                msgIcon = value;
-                               NotifyValueChanged ("MsgIcon", MsgIcon);
+                               NotifyValueChangedAuto (MsgIcon);
                        }
                }
                void onOkButtonClick (object sender, EventArgs e)
index 9359d648e060a046932fb55bc691dba3aa5753fb..8a0eb7d65de9149867b236c42f1d7cabedc0f9e9 100644 (file)
@@ -56,7 +56,7 @@ namespace Crow
                                if (value == _decimals)
                                        return;
                                _decimals = value;
-                               NotifyValueChanged("Decimals",  _decimals);
+                               NotifyValueChangedAuto (_decimals);
                                RegisterForGraphicUpdate();
                        }
                }
@@ -68,7 +68,7 @@ namespace Crow
                                        return;
 
                                minValue = value;
-                               NotifyValueChanged ("Minimum", minValue);
+                               NotifyValueChangedAuto (minValue);
                                RegisterForRedraw ();
                        }
                }
@@ -81,7 +81,7 @@ namespace Crow
                                        return;
 
                                maxValue = value;
-                               NotifyValueChanged ("Maximum", maxValue);
+                               NotifyValueChangedAuto (maxValue);
                                RegisterForRedraw ();
                        }
                }
@@ -94,7 +94,7 @@ namespace Crow
                                        return;
 
                                smallStep = value;
-                               NotifyValueChanged ("SmallIncrement", smallStep);
+                               NotifyValueChangedAuto (smallStep);
                                RegisterForRedraw ();
                        }
                }
@@ -107,7 +107,7 @@ namespace Crow
                                        return;
 
                                bigStep = value;
-                               NotifyValueChanged ("LargeIncrement", bigStep);
+                               NotifyValueChangedAuto (bigStep);
                                RegisterForRedraw ();
                        }
                }
@@ -129,7 +129,7 @@ namespace Crow
 
                                _actualValue = Math.Round (_actualValue, _decimals);
 
-                               NotifyValueChanged("Value",  _actualValue);
+                               NotifyValueChangedAuto (_actualValue);
                                RegisterForGraphicUpdate();
                        }
                }
index fc5ff0daf8cd6eae2687712a281c61e5af9d0d5e..2fc5629da42b753d6578064f99ed8989fe4abee9 100644 (file)
@@ -30,7 +30,7 @@ namespace Crow
                                if (popWidth == value)
                                        return;
                                popWidth = value;
-                               NotifyValueChanged ("PopWidth", popWidth);
+                               NotifyValueChangedAuto (popWidth);
                        }
                }
                [DefaultValue("Fit")]
@@ -40,7 +40,7 @@ namespace Crow
                                if (popHeight == value)
                                        return;
                                popHeight = value;
-                               NotifyValueChanged ("PopHeight", popHeight);
+                               NotifyValueChangedAuto (popHeight);
                        }
                }
                [DefaultValue(false)]
@@ -57,7 +57,7 @@ namespace Crow
 
                                _isPopped = value;
 
-                               NotifyValueChanged ("IsPopped", _isPopped);
+                               NotifyValueChangedAuto (_isPopped);
 
                                if (_isPopped)
                                        onPop (this, null);
@@ -76,7 +76,7 @@ namespace Crow
                                        return;
 
                                _canPop = value;
-                               NotifyValueChanged ("CanPop", _canPop);
+                               NotifyValueChangedAuto (_canPop);
                        }
                }
                [DefaultValue(Alignment.Bottom)]
@@ -86,7 +86,7 @@ namespace Crow
                                if (popDirection == value)
                                        return;
                                popDirection = value;
-                               NotifyValueChanged ("PopDirection", popDirection);
+                               NotifyValueChangedAuto (popDirection);
                        }
                }
                #endregion
index 220e56e84e6d60ac6b8546f1aed7dab35b288ff4..116863b48e69434ad60b0ccc71fc1935e9925a4e 100644 (file)
@@ -50,7 +50,7 @@ namespace Crow
 
                                isChecked = value;
 
-                               NotifyValueChanged ("IsChecked", value);
+                               NotifyValueChangedAuto (value);
 
                                if (isChecked)
                                        Checked.Raise (this, null);
index 9732878b695ce8cf7aaa8bcc87ffc4b776bd5849..a2b39567c639594223b0111a608ce979357fda08 100644 (file)
@@ -23,7 +23,7 @@ namespace Crow
                                if (v == value)
                                        return;
                                v = value;
-                               NotifyValueChanged ("V", v);
+                               NotifyValueChangedAuto (v);
                                mousePos.Y = (int)Math.Floor((1.0-v) * (double)ClientRectangle.Height);
 
                                RegisterForRedraw ();
@@ -36,7 +36,7 @@ namespace Crow
                                if (s == value)
                                        return;
                                s = value;
-                               NotifyValueChanged ("S", s);
+                               NotifyValueChangedAuto (s);
                                mousePos.X = (int)Math.Floor(s * (double)ClientRectangle.Width);
 
                                RegisterForRedraw ();
index e38aded02aca6cc211a744c831f08f87c5e9a423..1d69161250bb950b30be829f72dc5013d4bf37e9 100644 (file)
@@ -27,7 +27,7 @@ namespace Crow
                                if (scaled == value)
                                        return;
                                scaled = value;
-                               NotifyValueChanged ("Scaled", scaled);
+                               NotifyValueChangedAuto (scaled);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -41,7 +41,7 @@ namespace Crow
                                if (keepProps == value)
                                        return;
                                keepProps = value;
-                               NotifyValueChanged ("KeepProportions", keepProps);
+                               NotifyValueChangedAuto (keepProps);
                                RegisterForGraphicUpdate ();
                        }
                }
index 612a3e6349a94e8937ebf07639bcef493fb9c350..15695e5d8395704fd65f44beddd51c40f771064f 100644 (file)
@@ -30,7 +30,7 @@ namespace Crow
                                if (_orientation == value)
                                        return;
                                _orientation = value;
-                               NotifyValueChanged ("Orientation", _orientation);
+                               NotifyValueChangedAuto (_orientation);
                                if (_orientation == Orientation.Horizontal)
                                        NotifyValueChanged ("ScrollBackShape", "M 1.5,3.5 L 6.5,0.5 L 6.5,6.5 Z G");
                                else
@@ -47,7 +47,7 @@ namespace Crow
                                        return;
                                _cursorSize = value;
                                RegisterForGraphicUpdate ();
-                               NotifyValueChanged ("CursorSize", _cursorSize);
+                               NotifyValueChangedAuto (_cursorSize);
                        }
                }
                public void onScrollBack (object sender, MouseButtonEventArgs e)
index 33695df090c6c0bda33f17d69b4fe7c10ba9135b..0314be5033dcb14a18df171677c29e909240fe33 100644 (file)
@@ -48,7 +48,7 @@ namespace Crow
 
                                scrollX = newS;
 
-                               NotifyValueChanged ("ScrollX", scrollX);
+                               NotifyValueChangedAuto (scrollX);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -71,7 +71,7 @@ namespace Crow
 
                                scrollY = newS;
 
-                               NotifyValueChanged ("ScrollY", scrollY);
+                               NotifyValueChangedAuto (scrollY);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -91,7 +91,7 @@ namespace Crow
                                if (scrollX > maxScrollX)
                                        ScrollX = maxScrollX;
 
-                               NotifyValueChanged ("MaxScrollX", maxScrollX);
+                               NotifyValueChangedAuto (maxScrollX);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -112,7 +112,7 @@ namespace Crow
                                if (scrollY > maxScrollY)
                                        ScrollY = maxScrollY;
 
-                               NotifyValueChanged ("MaxScrollY", maxScrollY);
+                               NotifyValueChangedAuto (maxScrollY);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -126,7 +126,7 @@ namespace Crow
 
                                scrollSpeed = value;
 
-                               NotifyValueChanged ("ScrollSpeed", scrollSpeed);
+                               NotifyValueChangedAuto (scrollSpeed);
                        }
                }
                #endregion
index 8f0c81a4f1cdb4efd590780cad0c3bbaf57cde44..2545ffc7cb6752a3095ec273977d41a81f1dcebe 100644 (file)
@@ -45,7 +45,7 @@ namespace Crow
 
                                scrollX = newS;
 
-                               NotifyValueChanged ("ScrollX", scrollX);
+                               NotifyValueChangedAuto (scrollX);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -68,7 +68,7 @@ namespace Crow
 
                                scrollY = newS;
 
-                               NotifyValueChanged ("ScrollY", scrollY);
+                               NotifyValueChangedAuto (scrollY);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -85,7 +85,7 @@ namespace Crow
                                if (scrollX > maxScrollX)
                                        ScrollX = maxScrollX;
 
-                               NotifyValueChanged ("MaxScrollX", maxScrollX);
+                               NotifyValueChangedAuto (maxScrollX);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -102,7 +102,7 @@ namespace Crow
                                if (scrollY > maxScrollY)
                                        ScrollY = maxScrollY;
 
-                               NotifyValueChanged ("MaxScrollY", maxScrollY);
+                               NotifyValueChangedAuto (maxScrollY);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -116,7 +116,7 @@ namespace Crow
                                
                                mouseWheelSpeed = value;
 
-                               NotifyValueChanged ("MouseWheelSpeed", mouseWheelSpeed);
+                               NotifyValueChangedAuto (mouseWheelSpeed);
                        }
                }
 
index c30099a4e063ef274c7201fc566ea33c2c65bef8..7f43061dec98a58515f67bd5de3a5571c4c00c7f 100644 (file)
@@ -155,7 +155,7 @@ namespace Crow
                                        return;
                                path = value;
                                contentSize = default (Size);
-                               NotifyValueChanged ("Path", path);
+                               NotifyValueChangedAuto (path);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -171,7 +171,7 @@ namespace Crow
                                        return;
                                strokeWidth = value;
                                contentSize = default (Size);
-                               NotifyValueChanged ("StrokeWidth", strokeWidth);
+                               NotifyValueChangedAuto (strokeWidth);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -186,7 +186,7 @@ namespace Crow
                                        return;
                                size = value;
                                contentSize = default (Size);
-                               NotifyValueChanged ("Size", size);
+                               NotifyValueChangedAuto (size);
                                RegisterForLayouting (LayoutingType.Sizing);
                        }
                }
index 73518ecb11fb58abc00edcfafefc3bc6d98c8d7a..4a6d8bb0416904e242e18fc75a3e834662a31439 100644 (file)
@@ -52,7 +52,7 @@ namespace Crow
                                        return;
                                _cursorColor = value;
                                RegisterForRedraw ();
-                               NotifyValueChanged ("CursorColor", _cursorColor);
+                               NotifyValueChangedAuto (_cursorColor);
                        }
                }
                [DefaultValue(20)]
@@ -63,7 +63,7 @@ namespace Crow
                                        return;
                                _cursorSize = value;
                                RegisterForGraphicUpdate ();
-                               NotifyValueChanged ("CursorSize", _cursorSize);
+                               NotifyValueChangedAuto (_cursorSize);
                        }
                }
                [DefaultValue(Orientation.Horizontal)]
@@ -76,7 +76,7 @@ namespace Crow
                                _orientation = value; 
 
                                RegisterForLayouting (LayoutingType.All);
-                               NotifyValueChanged ("Orientation", _orientation);
+                               NotifyValueChangedAuto (_orientation);
                        }
                }
                [DefaultValue (CursorType.Rectangle)]
@@ -86,7 +86,7 @@ namespace Crow
                                if (cursorType == value)
                                        return;
                                cursorType = value;
-                               NotifyValueChanged ("CursorType", cursorType);
+                               NotifyValueChangedAuto (cursorType);
                                RegisterForRedraw ();
                        }
                }
index f2c0a084935878fd28c9e46850f940de297c297b..f385534cba79563287f48fb461a453dbbe112f1b 100644 (file)
@@ -26,8 +26,8 @@ namespace Crow
                        set {
                                if (thickness == value)
                                        return;
-                               thickness = value; 
-                               NotifyValueChanged ("Thickness", thickness);
+                               thickness = value;
+                               NotifyValueChangedAuto (thickness);
                                RegisterForLayouting (LayoutingType.Sizing);
                                RegisterForGraphicUpdate ();
                        }
index c57807c8c74cae4cb51a4056819ac1c3f91f00e6..25c89ae32cd466d5c5098072a997d8cee728de03 100644 (file)
@@ -63,7 +63,7 @@ namespace Crow
                                if (viewIndex == value)
                                        return;
                                viewIndex = value;
-                               NotifyValueChanged ("ViewIndex", viewIndex);
+                               NotifyValueChangedAuto (viewIndex);
                        }
                }
                        
@@ -74,7 +74,7 @@ namespace Crow
                                if (tabOffset == value)
                                        return;
                                tabOffset = value;
-                               NotifyValueChanged ("TabOffset", tabOffset);
+                               NotifyValueChangedAuto (tabOffset);
 
                                RegisterForLayouting (LayoutingType.X);
                                RegisterForGraphicUpdate ();
@@ -97,7 +97,7 @@ namespace Crow
                                        tview.SelectedTab = tview.Children.IndexOf(this);
                                
                                isSelected = value;
-                               NotifyValueChanged ("IsSelected", isSelected);
+                               NotifyValueChangedAuto (isSelected);
                                RegisterForRedraw ();
                        }
                }
@@ -114,7 +114,7 @@ namespace Crow
                                if (value == null)
                                        return;
                                selectedBackground = value;
-                               NotifyValueChanged ("SelectedBackground", selectedBackground);
+                               NotifyValueChangedAuto (selectedBackground);
                                RegisterForRedraw ();
                        }
                }
index 8699d3165d443ab48a95e8c2032b3e7af324bd90..cce3288316264db53019a909cc6dc85efeb58ab7 100644 (file)
@@ -34,7 +34,7 @@ namespace Crow
                                if (_orientation == value)
                                        return;
                                _orientation = value;
-                               NotifyValueChanged ("Orientation", _orientation);
+                               NotifyValueChangedAuto (_orientation);
                                if (_orientation == Orientation.Horizontal)
                                        NotifyValueChanged ("TabOrientation", Orientation.Vertical);
                                else
@@ -50,7 +50,7 @@ namespace Crow
                                if (leftSlope == value)
                                        return;
                                leftSlope = value;
-                               NotifyValueChanged ("leftSlope", leftSlope);
+                               NotifyValueChangedAuto (leftSlope);
                                //tabSizeHasChanged = true;
                                //RegisterForLayouting (LayoutingType.ArrangeChildren);
                        }
@@ -64,7 +64,7 @@ namespace Crow
                                if (rightSlope == value)
                                        return;
                                rightSlope = value;
-                               NotifyValueChanged ("RightSlope", rightSlope);
+                               NotifyValueChangedAuto (rightSlope);
                                //tabSizeHasChanged = true;
                                //RegisterForLayouting (LayoutingType.ArrangeChildren);
                        }
@@ -76,7 +76,7 @@ namespace Crow
                                if (tabHeight == value)
                                        return;
                                tabHeight = value;
-                               NotifyValueChanged ("TabHeight", tabHeight);
+                               NotifyValueChangedAuto (tabHeight);
 //                             childrenRWLock.EnterReadLock ();
 //                             foreach (GraphicObject ti in Children) {
 //                                     ti.NotifyValueChanged ("TabHeight", tabHeight);
@@ -92,7 +92,7 @@ namespace Crow
                                if (tabWidth == value)
                                        return;
                                tabWidth = value;
-                               NotifyValueChanged ("TabWidth", TabWidth);
+                               NotifyValueChangedAuto (TabWidth);
 //
 //                             childrenRWLock.EnterReadLock ();
 //                             foreach (GraphicObject ti in Children) { 
@@ -117,7 +117,7 @@ namespace Crow
                                if (selectedTab < Children.Count && selectedTab >= 0)
                                        (Children [selectedTab] as TabItem).IsSelected = true;
 
-                               NotifyValueChanged ("SelectedTab", selectedTab);
+                               NotifyValueChangedAuto (selectedTab);
                                RegisterForRedraw ();
                        }
                }
index 965676e7465d1a802c5b6e89012f3a4d3c2c599e..614bc1ac09c2ac565366c7c5dcb852430c13aaab 100644 (file)
@@ -67,7 +67,7 @@ namespace Crow
                                if (caption == value)
                                        return;
                                caption = value;
-                               NotifyValueChanged ("Caption", caption);
+                               NotifyValueChangedAuto (caption);
                        }
                }
 
index 72cd452cf8261e74bb7b42b3f2ccbf4db7cb3bc6..5916af843d8cbc67be8b077f2123c3612cb3ee87 100644 (file)
@@ -80,7 +80,7 @@ namespace Crow {
                                _itemTemplate = value;
 
                                //TODO:reload list with new template?
-                               NotifyValueChanged("ItemTemplate", _itemTemplate);
+                               NotifyValueChangedAuto (_itemTemplate);
                        }
                }
                protected override void loadTemplate(Widget template = null)
@@ -110,7 +110,7 @@ namespace Crow {
 
                                dataTest = value;
 
-                               NotifyValueChanged("DataTest", dataTest);
+                               NotifyValueChangedAuto (dataTest);
                        }
                }
                #endregion
@@ -131,7 +131,7 @@ namespace Crow {
                                if (selColoring == value)
                                        return;
                                selColoring = value;
-                               NotifyValueChanged ("SelectionColoring", selColoring);
+                               NotifyValueChangedAuto (selColoring);
                        }
                }
                [DefaultValue(-1)]public virtual int SelectedIndex{
@@ -152,7 +152,7 @@ namespace Crow {
                                        Items[_selectedIndex].Background = SelectionBackground;
                                }
 
-                               NotifyValueChanged ("SelectedIndex", _selectedIndex);
+                               NotifyValueChangedAuto (_selectedIndex);
                                NotifyValueChanged ("SelectedItem", SelectedItem);
                                SelectedItemChanged.Raise (this, new SelectionChangeEventArgs (SelectedItem));
                        }
@@ -198,7 +198,7 @@ namespace Crow {
                                        ol.ListEdit += Ol_ListEdit;
                                }
 
-                               NotifyValueChanged ("Data", data);
+                               NotifyValueChangedAuto (data);
 
                                lock (IFace.UpdateMutex)
                                        ClearItems ();
@@ -252,7 +252,7 @@ namespace Crow {
                                if (value == selBackground)
                                        return;
                                selBackground = value;
-                               NotifyValueChanged ("SelectionBackground", selBackground);
+                               NotifyValueChangedAuto (selBackground);
                                RegisterForRedraw ();
                        }
                }
@@ -263,7 +263,7 @@ namespace Crow {
                                if (value == selForeground)
                                        return;
                                selForeground = value;
-                               NotifyValueChanged ("SelectionForeground", selForeground);
+                               NotifyValueChangedAuto (selForeground);
                                RegisterForRedraw ();
                        }
                }
index 09720baf53c1dd84ed75cd2f067a789e33883ad8..042dbdbce959b15538ae95f96abd03552f03d313 100644 (file)
@@ -51,7 +51,7 @@ namespace Crow
                                        return;
                                horizontalStretch = value;
                                RegisterForRedraw ();
-                               NotifyValueChanged ("HorizontalStretch", horizontalStretch);
+                               NotifyValueChangedAuto (horizontalStretch);
                        }
                }
                
@@ -63,7 +63,7 @@ namespace Crow
                                        return;
                                verticalStretch = value;
                                RegisterForRedraw ();
-                               NotifyValueChanged ("VerticalStretch", verticalStretch);
+                               NotifyValueChangedAuto (verticalStretch);
                        }
                }
                
index 87d220068eb9d07dffb75a1da32bdd184a95e19c..e150ef8671893f94b0d83bdeb439f43f2720b84d 100644 (file)
@@ -26,7 +26,7 @@ namespace Crow
                                if (isRoot == value)
                                        return;
                                isRoot = value;
-                               NotifyValueChanged ("IsRoot", isRoot);
+                               NotifyValueChangedAuto (isRoot);
                        }
                }
                [XmlIgnore]public override object SelectedItem {
index 414ee82a15d180c049671a6987959740d07c22ca..ebc3cedbf1d3b10430f51c60f61bd10787ce4f78 100644 (file)
@@ -43,7 +43,7 @@ namespace Crow
                                        return;
 
                                nbValues = value;
-                               NotifyValueChanged ("NbValues", minValue);
+                               NotifyValueChangedAuto (minValue);
                                RegisterForRedraw ();
                        }
                }
@@ -55,7 +55,7 @@ namespace Crow
                                        return;
 
                                minValue = value;
-                               NotifyValueChanged ("Minimum", minValue);
+                               NotifyValueChangedAuto (minValue);
                                RegisterForRedraw ();
                        }
                }
@@ -68,7 +68,7 @@ namespace Crow
                                        return;
 
                                maxValue = value;
-                               NotifyValueChanged ("Maximum", maxValue);
+                               NotifyValueChangedAuto (maxValue);
                                RegisterForRedraw ();
                        }
                }
@@ -79,7 +79,7 @@ namespace Crow
                                if (lowThreshold == value)
                                        return;
                                lowThreshold = value;
-                               NotifyValueChanged ("LowThreshold", lowThreshold);
+                               NotifyValueChangedAuto (lowThreshold);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -90,7 +90,7 @@ namespace Crow
                                if (highThreshold == value)
                                        return;
                                highThreshold = value;
-                               NotifyValueChanged ("HighThreshold", highThreshold);
+                               NotifyValueChangedAuto (highThreshold);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -101,7 +101,7 @@ namespace Crow
                                if (lowThresholdFill == value)
                                        return;
                                lowThresholdFill = value;
-                               NotifyValueChanged ("LowThresholdFill", lowThresholdFill);
+                               NotifyValueChangedAuto (lowThresholdFill);
                                RegisterForRedraw ();
                        }
                }
@@ -112,7 +112,7 @@ namespace Crow
                                if (highThresholdFill == value)
                                        return;
                                highThresholdFill = value;
-                               NotifyValueChanged ("HighThresholdFill", highThresholdFill);
+                               NotifyValueChangedAuto (highThresholdFill);
                                RegisterForRedraw ();
                        }
                }
index b103ac56ddd92f51cd33603d96ca085804f14c3d..de079e1500d1ca16dd6519a3bddd488b44c9c093 100644 (file)
@@ -212,6 +212,10 @@ namespace Crow
                        //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
                        ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
                }
+               public void NotifyValueChangedAuto (object _value, [CallerMemberName] string caller = null)
+               {
+                       NotifyValueChanged (caller, _value);
+               }
                #endregion
 
                #region CTOR
@@ -469,7 +473,7 @@ namespace Crow
                                if (tag == value)
                                        return;
                                tag = value;
-                               NotifyValueChanged ("Tag", tag);
+                               NotifyValueChangedAuto (tag);
                        }
                }
                /// <summary>
@@ -483,7 +487,7 @@ namespace Crow
                                if (cacheEnabled == value)
                                        return;
                                cacheEnabled = value;
-                               NotifyValueChanged ("CacheEnabled", cacheEnabled);
+                               NotifyValueChangedAuto (cacheEnabled);
                        }
                }
                /// <summary>
@@ -496,7 +500,7 @@ namespace Crow
                                if (clipToClientRect == value)
                                        return;
                                clipToClientRect = value;
-                               NotifyValueChanged ("ClipToClientRect", clipToClientRect);
+                               NotifyValueChangedAuto (clipToClientRect);
                                this.RegisterForRedraw ();
                        }
                }
@@ -523,7 +527,7 @@ namespace Crow
                                if (name == value)
                                        return;
                                name = value;
-                               NotifyValueChanged("Name", name);
+                               NotifyValueChangedAuto (name);
                        }
                }
                /// <summary>
@@ -538,7 +542,7 @@ namespace Crow
                                        return;
 
                                verticalAlignment = value;
-                               NotifyValueChanged("VerticalAlignment", verticalAlignment);
+                               NotifyValueChangedAuto (verticalAlignment);
                                RegisterForLayouting (LayoutingType.Y);
                        }
                }
@@ -553,7 +557,7 @@ namespace Crow
                                if (horizontalAlignment == value)
                                        return;
                                horizontalAlignment = value;
-                               NotifyValueChanged("HorizontalAlignment", horizontalAlignment);
+                               NotifyValueChangedAuto (horizontalAlignment);
                                RegisterForLayouting (LayoutingType.X);
                        }
                }
@@ -567,7 +571,7 @@ namespace Crow
                                if (left == value)
                                        return;
                                left = value;
-                               NotifyValueChanged ("Left", left);
+                               NotifyValueChangedAuto (left);
                                this.RegisterForLayouting (LayoutingType.X);
                        }
                }
@@ -581,7 +585,7 @@ namespace Crow
                                if (top == value)
                                        return;
                                top = value;
-                               NotifyValueChanged ("Top", top);
+                               NotifyValueChangedAuto (top);
                                this.RegisterForLayouting (LayoutingType.Y);
                        }
                }
@@ -617,7 +621,7 @@ namespace Crow
                                                return;
                                }
                                width = value;
-                               NotifyValueChanged ("Width", width);
+                               NotifyValueChangedAuto (width);
                                RegisterForLayouting (LayoutingType.Width);
                        }
                }
@@ -640,7 +644,7 @@ namespace Crow
                                                return;
                                }
                                height = value;
-                               NotifyValueChanged ("Height", height);
+                               NotifyValueChangedAuto (height);
                                RegisterForLayouting (LayoutingType.Height);
                        }
                }
@@ -667,7 +671,7 @@ namespace Crow
                                if (focusable == value)
                                        return;
                                focusable = value;
-                               NotifyValueChanged ("Focusable", focusable);
+                               NotifyValueChangedAuto (focusable);
                        }
                }
                /// <summary>
@@ -684,7 +688,7 @@ namespace Crow
                                        onFocused (this, null);
                                else
                                        onUnfocused (this, null);
-                               NotifyValueChanged ("HasFocus", hasFocus);
+                               NotifyValueChangedAuto (hasFocus);
                        }
                }
                /// <summary>
@@ -698,7 +702,7 @@ namespace Crow
                                        return;
 
                                isActive = value;
-                               NotifyValueChanged ("IsActive", isActive);
+                               NotifyValueChangedAuto (isActive);
                        }
                }
                /// <summary>
@@ -715,7 +719,7 @@ namespace Crow
                                if (isHover)
                                        Hover.Raise (this, null);
 
-                               NotifyValueChanged ("IsHover", isHover);
+                               NotifyValueChangedAuto (isHover);
                        }
                }
                /// <summary>
@@ -728,7 +732,7 @@ namespace Crow
                                if (mouseRepeat == value)
                                        return;
                                mouseRepeat = value;
-                               NotifyValueChanged ("MouseRepeat", mouseRepeat);
+                               NotifyValueChangedAuto (mouseRepeat);
                        }
                }
                /// <summary>
@@ -742,7 +746,7 @@ namespace Crow
                                if (mouseCursor == value)
                                        return;
                                mouseCursor = value;
-                               NotifyValueChanged ("MouseCursor", mouseCursor);
+                               NotifyValueChangedAuto (mouseCursor);
                                this.RegisterForRedraw ();
 
                                if (isHover)
@@ -777,7 +781,7 @@ namespace Crow
                                if (value == null)
                                        return;
                                background = value;
-                               NotifyValueChanged ("Background", background);
+                               NotifyValueChangedAuto (background);
                                RegisterForRedraw ();
                                if (background is SolidColor sc && sc.Equals (Colors.Clear))
                                        clearBackground = true;                         
@@ -793,7 +797,7 @@ namespace Crow
                                if (foreground == value)
                                        return;
                                foreground = value;
-                               NotifyValueChanged ("Foreground", foreground);
+                               NotifyValueChangedAuto (foreground);
                                RegisterForRedraw ();
                        }
                }
@@ -807,7 +811,7 @@ namespace Crow
                                if (value == font)
                                        return;
                                font = value;
-                               NotifyValueChanged ("Font", font);
+                               NotifyValueChangedAuto (font);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -821,7 +825,7 @@ namespace Crow
                                if (value == cornerRadius)
                                        return;
                                cornerRadius = value;
-                               NotifyValueChanged ("CornerRadius", cornerRadius);
+                               NotifyValueChangedAuto (cornerRadius);
                                RegisterForRedraw ();
                        }
                }
@@ -836,7 +840,7 @@ namespace Crow
                                if (value == margin)
                                        return;
                                margin = value;
-                               NotifyValueChanged ("Margin", margin);
+                               NotifyValueChangedAuto (margin);
                                RegisterForGraphicUpdate ();
                        }
                }
@@ -861,7 +865,7 @@ namespace Crow
                                        }
                                }
 
-                               NotifyValueChanged ("Visible", isVisible);
+                               NotifyValueChangedAuto (isVisible);
                        }
                }
                /// <summary>
@@ -882,7 +886,7 @@ namespace Crow
                                else
                                        onDisable (this, null);
 
-                               NotifyValueChanged ("IsEnabled", isEnabled);
+                               NotifyValueChangedAuto (isEnabled);
                                RegisterForRedraw ();
                        }
                }
@@ -898,7 +902,7 @@ namespace Crow
 
                                minimumSize = value;
 
-                               NotifyValueChanged ("MinimumSize", minimumSize);
+                               NotifyValueChangedAuto (minimumSize);
                                RegisterForLayouting (LayoutingType.Sizing);
                        }
                }
@@ -914,7 +918,7 @@ namespace Crow
 
                                maximumSize = value;
 
-                               NotifyValueChanged (nameof(MaximumSize), maximumSize);
+                               NotifyValueChangedAuto (maximumSize);
                                RegisterForLayouting (LayoutingType.Sizing);
                        }
                }
@@ -954,7 +958,7 @@ namespace Crow
                                #endif
                                lock (IFace.UpdateMutex) {
                                        OnDataSourceChanged (this, dse);
-                                       NotifyValueChanged ("DataSource", DataSource);
+                                       NotifyValueChangedAuto (DataSource);
                                }
                                #if DEBUG_LOG
                                dbgEvt.end = DebugLog.chrono.ElapsedTicks;
@@ -977,7 +981,7 @@ namespace Crow
                                if (rootDataLevel == value)
                                        return;
                                rootDataLevel = value;
-                               NotifyValueChanged ("RootDataLevel", rootDataLevel);
+                               NotifyValueChangedAuto (rootDataLevel);
                                this.RegisterForRedraw ();
                        }
                }
@@ -1010,7 +1014,7 @@ namespace Crow
 
                                style = value;
 
-                               NotifyValueChanged ("Style", style);
+                               NotifyValueChangedAuto (style);
                        }
                }
                [DesignCategory ("Divers")]
@@ -1020,7 +1024,7 @@ namespace Crow
                                if (tooltip == value)
                                        return;
                                tooltip = value;
-                               NotifyValueChanged("Tooltip", tooltip);
+                               NotifyValueChangedAuto (tooltip);
                        }
                }
                [DesignCategory ("Divers")]
@@ -1030,7 +1034,7 @@ namespace Crow
                                if (contextCommands == value)
                                        return;
                                contextCommands = value;
-                               NotifyValueChanged("ContextCommands", contextCommands);
+                               NotifyValueChangedAuto (contextCommands);
                        }
                }
                #endregion
index ddf730ade09966efd8899be67d651707450b7a1e..fb09ba04d49089b52a71840faae3d22a013372e1 100644 (file)
@@ -68,7 +68,7 @@ namespace Crow
                                if (_icon == value)
                                        return;
                                _icon = value;
-                               NotifyValueChanged ("Icon", _icon);
+                               NotifyValueChangedAuto (_icon);
                        }
                } 
                /// <summary>
@@ -81,7 +81,7 @@ namespace Crow
                                if (titleBarBackground == value)
                                        return;
                                titleBarBackground = value;
-                               NotifyValueChanged ("TitleBarBackground", titleBarBackground);
+                               NotifyValueChangedAuto (titleBarBackground);
                                RegisterForRedraw ();
                        }
                }
@@ -95,7 +95,7 @@ namespace Crow
                                if (titleBarForeground == value)
                                        return;
                                titleBarForeground = value;
-                               NotifyValueChanged ("TitleBarForeground", titleBarForeground);
+                               NotifyValueChangedAuto (titleBarForeground);
                                RegisterForRedraw ();
                        }
                }
@@ -108,7 +108,7 @@ namespace Crow
                                if (resizable == value)
                                        return;
                                resizable = value;
-                               NotifyValueChanged ("Resizable", resizable);
+                               NotifyValueChangedAuto (resizable);
                        }
                }
                [DefaultValue(true)]
@@ -120,7 +120,7 @@ namespace Crow
                                if (movable == value)
                                        return;
                                movable = value;
-                               NotifyValueChanged ("Movable", movable);
+                               NotifyValueChangedAuto (movable);
                        }
                }
                [DefaultValue(false)]
@@ -132,7 +132,7 @@ namespace Crow
                                if (modal == value)
                                        return;
                                modal = value;
-                               NotifyValueChanged ("Modal", modal);
+                               NotifyValueChangedAuto (modal);
                        }
                }
                [DefaultValue(false)]
@@ -145,7 +145,7 @@ namespace Crow
                                _minimized = value;
                                _contentContainer.Visible = !_minimized;
 
-                               NotifyValueChanged ("IsMinimized", _minimized);
+                               NotifyValueChangedAuto (_minimized);
                        }
                }
                [XmlIgnore]public bool IsMaximized {
@@ -168,7 +168,7 @@ namespace Crow
                                if (AlwaysOnTop && Parent != null)
                                        IFace.PutOnTop (this);
 
-                               NotifyValueChanged ("AlwaysOnTop", AlwaysOnTop);
+                               NotifyValueChangedAuto (AlwaysOnTop);
                        }
                }
 //             [DefaultValue(WindowState.Normal)]
index daab96e2699b30068c585e0841612a16d97ec3a0..346c2d1da6760461e747d5a3db8ebdc6805a373e 100644 (file)
@@ -7,6 +7,7 @@ using Crow;
 using System.IO;
 using System.Text;
 using Crow.IML;
+using System.Runtime.CompilerServices;
 
 namespace ShowCase
 {
@@ -24,14 +25,28 @@ namespace ShowCase
                public Container crowContainer;
 
                public string CurrentDir {
-                       get { return Configuration.Global.Get<string> ("CurrentDir"); }
+                       get { return Configuration.Global.Get<string> (nameof (CurrentDir)); }
                        set {
                                if (CurrentDir == value)
                                        return;
-                               Configuration.Global.Set ("CurrentDir", value);
-                               NotifyValueChanged ("CurrentDir",CurrentDir);
+                               Configuration.Global.Set (nameof (CurrentDir), value);
+                               NotifyValueChanged (CurrentDir);
                        }
                }
+
+               string source = @"<Label Text='Hello World' Background='MediumSeaGreen' Margin='10'/>";
+
+               public string Source {
+                       get => Source;
+                       set {
+                               if (source == value)
+                                       return;
+                               source = value;
+                               reloadFromSource ();
+                               NotifyValueChanged (source);
+                       }
+               }
+
                public void goUpDirClick (object sender, MouseButtonEventArgs e)
                {
                        string root = Directory.GetDirectoryRoot (CurrentDir);
@@ -42,6 +57,8 @@ namespace ShowCase
 
                protected override void OnInitialized ()
                {
+                       base.OnInitialized ();
+
                        if (string.IsNullOrEmpty (CurrentDir))
                                CurrentDir = Path.Combine (Directory.GetCurrentDirectory (), "Interfaces");
                        Widget g = Load ("#ShowCase.showcase.crow");
@@ -71,18 +88,16 @@ namespace ShowCase
                                return;
                        if (fi is DirectoryInfo)
                                return;
-
-                       string source = "";
+                               
                        using (Stream s = new FileStream (fi.FullName, FileMode.Open)) {
                                using (StreamReader sr = new StreamReader (s))
-                                       source = sr.ReadToEnd ();
+                                       Source = sr.ReadToEnd ();
                        }
-                       NotifyValueChanged ("source", source);
                }
 
                void showError (Exception ex)
                {
-                       NotifyValueChanged ("ErrorMessage", ex.Message);
+                       NotifyValueChanged ("ErrorMessage", (object)ex.Message);
                        NotifyValueChanged ("ShowError", true);
                }
                void hideError ()
@@ -90,14 +105,14 @@ namespace ShowCase
                        NotifyValueChanged ("ShowError", false);
                }
 
-               void Tb_TextChanged (object sender, TextChangeEventArgs e)
+               void reloadFromSource ()
                {
                        hideError ();
                        Widget g = null;
                        try {
                                lock (UpdateMutex) {
                                        Instantiator inst = null;
-                                       using (MemoryStream ms = new MemoryStream (Encoding.UTF8.GetBytes (e.Text))) {
+                                       using (MemoryStream ms = new MemoryStream (Encoding.UTF8.GetBytes (source))) {
                                                inst = new Instantiator (this, ms);
                                        }
                                        g = inst.CreateInstance ();
@@ -105,7 +120,7 @@ namespace ShowCase
                                        g.DataSource = this;
                                }
                        } catch (InstantiatorException itorex) {
-                               Console.WriteLine (itorex.ToString ());
+                               Console.WriteLine (itorex);
                                showError (itorex.InnerException);
                        } catch (Exception ex) {
                                Console.WriteLine (ex);
index ae8912fe8aecf73beabbe10f113a5a6933676ac6..4805e96e339ca5c633ed749088cc30aa8e7a37bc 100644 (file)
@@ -2,7 +2,8 @@
 <HorizontalStack Background="DarkGrey" Margin="2">
        <VerticalStack  Width="25%">
                <HorizontalStack Height="Fit">
-                       <Image Margin="2" Width="14" Height="14" Path="#Crow.Icons.level-up.svg" MouseClick="./goUpDirClick"/>                  
+                       <Image Margin="2" Width="16" Height="16" Path="#Crow.Icons.level-up.svg" MouseClick="./goUpDirClick"
+                                                Background="Jet" MouseEnter="{Background=Grey}" MouseLeave="{Background=Jet}" />                       
                        <TextBox Text="{²CurrentDir}" Margin="2"/>
                </HorizontalStack>              
                <DirectoryView Name="dv" CurrentDirectory="{CurrentDir}" SelectedItemChanged="Dv_SelectedItemChanged"/>
@@ -15,8 +16,8 @@
                        <Scroller Name="scroller1" Background="White"
                                        Margin="2" ScrollY="{../scrollbar1.Value}"
                                        ValueChanged="./_scroller_ValueChanged">
-                               <TextBox VerticalAlignment="Top" TextChanged="Tb_TextChanged"
-                                       Text="{source}" Multiline="true" TextAlignment="TopLeft"
+                               <TextBox VerticalAlignment="Top"
+                                       Text="{²Source}" Multiline="true" TextAlignment="TopLeft"
                                        Font="Courriernew 10"/>
                        </Scroller>
                        <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
index 0007fc23b8e5bb0fd53b79888932fc46dc78a88f..aea139c36e9c680ad7d0dff03e984e8e145e70fd 100644 (file)
@@ -104,7 +104,7 @@ namespace Crow
                                        return;
                                prop1 = value;
 
-                               NotifyValueChanged ("TestList3SelProp1", prop1);
+                               NotifyValueChanged (prop1);
                        }
                }
 
@@ -115,7 +115,7 @@ namespace Crow
                                if (selString == value)
                                        return;
                                selString = value;
-                               NotifyValueChanged ("TestList2SelectedString", selString);
+                               NotifyValueChanged (selString);
                        }
                }
 
@@ -141,7 +141,7 @@ namespace Crow
                                if (value == curSources)
                                        return;
                                curSources = value;
-                               NotifyValueChanged ("CurSources", curSources);
+                               NotifyValueChanged (curSources);
                        }
                }
                bool boolVal = true;
@@ -151,13 +151,21 @@ namespace Crow
                                if (boolVal == value)
                                        return;
                                boolVal = value;
-                               NotifyValueChanged ("BoolVal", boolVal);
+                               NotifyValueChanged (boolVal);
                        }
                }
 
                #endregion
 
-
+               protected override void OnInitialized ()
+               {
+                       Commands = new List<Command> {
+                               new Command(() => MessageBox.ShowModal(this, MessageBox.Type.Information, "context menu 1 clicked")) { Caption = "Action 1" },
+                               new Command(() => MessageBox.ShowModal(this, MessageBox.Type.Information, "context menu 2 clicked")) { Caption = "Action 2" },
+                               new Command(() => MessageBox.ShowModal(this, MessageBox.Type.Information, "context menu 3 clicked")) { Caption = "Action 3" }
+                       };
+                       base.OnInitialized ();
+               }
 
        }
 }
\ No newline at end of file