diff options
Diffstat (limited to 'Samples/HelloWorld')
| -rw-r--r-- | Samples/HelloWorld/HelloWorld.csproj | 8 | ||||
| -rw-r--r-- | Samples/HelloWorld/main.cs | 17 | ||||
| -rw-r--r-- | Samples/HelloWorld/ui/helloworld.crow | 40 |
3 files changed, 8 insertions, 57 deletions
diff --git a/Samples/HelloWorld/HelloWorld.csproj b/Samples/HelloWorld/HelloWorld.csproj index 7ceb582d..178d4537 100644 --- a/Samples/HelloWorld/HelloWorld.csproj +++ b/Samples/HelloWorld/HelloWorld.csproj @@ -1,9 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <TargetFramework>netcoreapp3.1</TargetFramework> + <OutputType>Exe</OutputType> + </PropertyGroup> <ItemGroup> - <EmbeddedResource Include="ui\**\*.*"> - <LogicalName>HelloWorld.%(Filename)%(Extension)</LogicalName> - </EmbeddedResource> + <PackageReference Include="Crow" /> </ItemGroup> </Project>
\ No newline at end of file diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs index dc5e2a13..e60b9782 100644 --- a/Samples/HelloWorld/main.cs +++ b/Samples/HelloWorld/main.cs @@ -4,21 +4,10 @@ using Samples; namespace HelloWorld { - class Program : SampleBase { - public CommandGroup CMDTest = new CommandGroup ( - new ActionCommand("Action", ()=> Console.WriteLine ("Action executed")) - ); + class Program { static void Main (string[] args) { - DbgLogger.IncludedEvents.AddRange ( new DbgEvtType[] { - DbgEvtType.MouseEnter, - DbgEvtType.MouseLeave, - DbgEvtType.WidgetMouseDown, - DbgEvtType.WidgetMouseUp, - DbgEvtType.WidgetMouseClick, - DbgEvtType.HoverWidget - }); - using (Interface app = new Program ()) { - app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow").DataSource = sender; + using (Interface app = new Interface ()) { + app.Initialized += (sender, e) => app.LoadIMLFragment (@"<Label Text='Hello World'/>"); app.Run (); } } diff --git a/Samples/HelloWorld/ui/helloworld.crow b/Samples/HelloWorld/ui/helloworld.crow deleted file mode 100644 index a9dad40c..00000000 --- a/Samples/HelloWorld/ui/helloworld.crow +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Margin="50" Spacing="20"> - <HorizontalStack Height="Fit"> - <Label Text="Hover:" Width="50" Foreground="Grey"/> - <Label Text="{HoverWidget}" Font="mono, 8"/> - </HorizontalStack> - <HorizontalStack Height="Fit"> - <Label Text="Focus:" Width="50" Foreground="Grey"/> - <Label Text="{FocusedWidget}" Font="mono, 8"/> - </HorizontalStack> - <HorizontalStack Height="Fit"> - <Label Text="Active:" Width="50" Foreground="Grey"/> - <Label Text="{ActiveWidget}" Font="mono, 8"/> - </HorizontalStack> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> -</VerticalStack> |