--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <ItemGroup>
+ <EmbeddedResource Include="ui\*.*">
+ <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.Runtime.CompilerServices;
+using Crow;
+
+namespace BindingTest
+{
+ class Program : SampleBase
+ {
+
+ static void Main ()
+ {
+ using (Program app = new Program ())
+ app.Run ();
+ }
+
+ protected override void OnInitialized ()
+ {
+ Load ("#ui.test.crow").DataSource = this;
+
+ }
+
+
+ void setDataSourceNull (object sender, MouseButtonEventArgs e)
+ {
+ TcVCInstance = null;
+ Console.WriteLine ("set data source null");
+ }
+ void setDataSourceThis (object sender, MouseButtonEventArgs e)
+ {
+ TcVCInstance = new TestClassVC () { Prop1 = "instance 1 prop1 value", Prop2 = "instance 1 prop2 value" };
+ Console.WriteLine ("set data source not null");
+ }
+
+ }
+}
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Margin="5">
+ <VerticalStack Margin="5" Background="Onyx" DataSource="{TcVCInstance}">
+ <Label Text="{}"/>
+ <Label Text="{Prop1}"/>
+ <Label Text="{Prop2}"/>
+ </VerticalStack>
+ <HorizontalStack Height="Fit" Margin="5" Background="DimGrey">
+ <Button Background="Jet" Caption="Set DataSource Null" MouseClick="setDataSourceNull"/>
+ <Button Background="Jet" Caption="Set DataSource This" MouseClick="setDataSourceThis"/>
+ </HorizontalStack>
+</VerticalStack>
ctx.SetSource (dbge.Color);
if (dbge.IsSelected) {
ctx.FillPreserve ();
- ctx.SetSourceRGB (1, 1, 1);
+ ctx.SetSource (1, 1, 1);
ctx.Stroke ();
}else
ctx.Fill ();
if (g.yIndex == 0)
gr.SetSource (Crow.Colors.LightSalmon);
else
- Foreground.SetAsSource (gr);
+ Foreground.SetAsSource (IFace, gr);
gr.MoveTo (penX, penY - gr.FontExtents.Descent);
gr.ShowText (g.name + gIdx);
r = new Rectangle (cb.Left, (int)y, cb.Width, (int)fe.Height);
ctx.Operator = Cairo.Operator.Add;
- ctx.SetSourceRGBA (0.1, 0.1, 0.1, 0.4);
+ ctx.SetSource (0.1, 0.1, 0.1, 0.4);
ctx.Rectangle (ContextCoordinates (r));
ctx.Fill ();
}
<?xml version="1.0"?>
<Container Background="Onyx">
<VerticalStack Background="Jet" Fit="true" Margin="10" Spacing="10">
- <Gauge Width="200" Height="10" Background="RoyalBlue" Value="50" CornerRadius="5"/>
+ <Gauge Width="200" Height="10" Background="DimGrey" Foreground="RoyalBlue" Value="50" CornerRadius="5"/>
<NumericControl Width="200" Height="10" Value="40">
<Template>
- <Gauge Maximum="{./Maximum}" Foreground="Black" BorderWidth="1" Background="RoyalBlue" Value="{./Value}" CornerRadius="5"/>
+ <Gauge Maximum="{./Maximum}" Background="DimGrey" Foreground="RoyalBlue" Value="{./Value}" CornerRadius="5"/>
</Template>
</NumericControl>
<HorizontalStack Width="200" Height="200">
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
using Crow;
-using Glfw;
namespace tests
{
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
using Crow;
-using Glfw;
namespace tests
{