diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-03-02 11:57:39 +0100 |
|---|---|---|
| committer | j-p <jp_bruyere@hotmail.com> | 2021-03-02 12:01:06 +0100 |
| commit | 25a2b0d668dfea62e53a1fcf50ed32b43cfc2c68 (patch) | |
| tree | bc77c325f93fb136b7a0ba977982d1262338ecf7 /Samples/PathPainter/Program.cs | |
| parent | 5b5150e5e7e1eca0aa99de8b8a7aa6f38b7310d8 (diff) | |
implement theme from directory
Diffstat (limited to 'Samples/PathPainter/Program.cs')
| -rw-r--r-- | Samples/PathPainter/Program.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Samples/PathPainter/Program.cs b/Samples/PathPainter/Program.cs new file mode 100644 index 00000000..5993c852 --- /dev/null +++ b/Samples/PathPainter/Program.cs @@ -0,0 +1,76 @@ +using Crow; +using System; + +namespace PathPainter +{ + class Program : SampleBase + { + static void Main (string[] args) { + using (Program app = new Program ()) + app.Run (); + } + + protected override void OnInitialized () { + base.OnInitialized (); + Load ("#ui.main.crow").DataSource = this; + } + string currentPath = "M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z F"; + int currentSize = 11; + double zoom = 1.0; + double strokeWidth = 1.0; + Color foreground = Colors.Black; + Color background = Colors.White; + + public Measure DesignSize => (int)(zoom * currentSize); + + public double StrokeWidth { + get => strokeWidth; + set { + if (strokeWidth == value) + return; + strokeWidth = value; + NotifyValueChanged (strokeWidth); + } + } + public string CurrentPath { + get => currentPath; + set { + if (currentPath == value) + return; + currentPath = value; + NotifyValueChanged (currentPath); + } + } + public Size Size => new Size (currentSize); + public int CurrentSize { + get => currentSize; + set { + if (currentSize == value) + return; + currentSize = value; + NotifyValueChanged (currentSize); + NotifyValueChanged ("Size", (object)new Size (currentSize)); + NotifyValueChanged ("CurrentPath", (object)CurrentPath); + } + } + public Color Foreground { + get => foreground; + set { + if (foreground == value) + return; + foreground = value; + NotifyValueChanged (foreground); + } + } + public Color Background { + get => background; + set { + if (background == value) + return; + background = value; + NotifyValueChanged (background); + } + } + + } +} |