File tree Expand file tree Collapse file tree 10 files changed +84
-12
lines changed Expand file tree Collapse file tree 10 files changed +84
-12
lines changed Original file line number Diff line number Diff line change 22bin
33obj
44Debug
5- Release
5+ Release
6+ * .zip
7+ publish
8+ Publish
Original file line number Diff line number Diff line change 1818 <EmbeddedResource Remove =" Release\**" />
1919 <None Remove =" Release\**" />
2020 </ItemGroup >
21+ <ItemGroup >
22+ <AvaloniaResource Remove =" Views\AboutWindow.xaml" />
23+ </ItemGroup >
24+ <ItemGroup >
25+ <None Remove =" Views\AboutWindow.xaml" />
26+ </ItemGroup >
2127 <ItemGroup >
2228 <PackageReference Include =" Avalonia" Version =" 0.9.10" />
23- <PackageReference Include =" Avalonia.Desktop" Version =" 0.9.10" />
29+ <PackageReference Include =" Avalonia.Desktop" Version =" 0.9.10" />
2430 <PackageReference Include =" Avalonia.ReactiveUI" Version =" 0.9.10" />
25- <PackageReference Include =" Avalonia.Controls.DataGrid" Version =" 0.9.10" />
31+ <PackageReference Include =" Avalonia.Controls.DataGrid" Version =" 0.9.10" />
32+ </ItemGroup >
33+ <ItemGroup >
34+ <EmbeddedResource Include =" Views\AboutWindow.xaml" >
35+ <Generator >MSBuild:Compile</Generator >
36+ </EmbeddedResource >
2637 </ItemGroup >
2738 <ItemGroup >
2839 <ProjectReference Include =" ..\CoroHeartFormats\CoroHeartFormats.csproj" />
2940 </ItemGroup >
41+ <ItemGroup >
42+ <Compile Update =" Views\AboutWindow.xaml.cs" >
43+ <DependentUpon >AboutWindow.xaml</DependentUpon >
44+ </Compile >
45+ </ItemGroup >
3046</Project >
Original file line number Diff line number Diff line change 33using ReactiveUI ;
44using Avalonia . Controls ;
55using CoroHeartToolkitGUI . Models ;
6+ using CoroHeartToolkitGUI . Views ;
7+ using Avalonia . Controls . ApplicationLifetimes ;
8+ using Avalonia ;
69
710namespace CoroHeartToolkitGUI . ViewModels
811{
@@ -18,6 +21,14 @@ public MainWindowViewModel()
1821 TopMenu = new TopMenuViewModel ( TopMenuItems ) ;
1922 }
2023
24+ void TriggerAboutWindow ( )
25+ {
26+ AboutWindow window = new AboutWindow ( ) ;
27+ IClassicDesktopStyleApplicationLifetime classicDesktopLifetime = ( IClassicDesktopStyleApplicationLifetime ) Application . Current . ApplicationLifetime ;
28+
29+ window . ShowDialog ( classicDesktopLifetime . MainWindow ) ;
30+ }
31+
2132 private void _initTopMenuItems ( )
2233 {
2334 TopMenuItems = new List < TopMenuItem >
@@ -41,16 +52,13 @@ private void _initTopMenuItems()
4152 } ,
4253 new TopMenuItem ( )
4354 {
44- Header = "Edit " ,
55+ Header = "Help " ,
4556 Items = new TopMenuItem [ ]
4657 {
4758 new TopMenuItem ( )
4859 {
49- Header = "Undo"
50- } ,
51- new TopMenuItem ( )
52- {
53- Header = "Redo"
60+ Header = "About" ,
61+ Command = ReactiveCommand . Create ( TriggerAboutWindow )
5462 }
5563 } } } ;
5664 }
Original file line number Diff line number Diff line change 1+ <Window xmlns =" https://github.com/avaloniaui"
2+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
3+ xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
4+ xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
5+ mc : Ignorable =" d" d : DesignWidth =" 200" d : DesignHeight =" 100"
6+ x : Class =" CoroHeartToolkitGUI.Views.AboutWindow"
7+ Title =" About" WindowStartupLocation =" CenterScreen" Background =" White" Width =" 250" Height =" 150" CanResize =" False" >
8+ <StackPanel HorizontalAlignment =" Center" VerticalAlignment =" Center" >
9+ <TextBlock Text =" CoroHeart Toolkit" TextAlignment =" Center" />
10+ <TextBlock Text =" Version 0.1 - Dev" TextAlignment =" Center" />
11+ <TextBlock Text =" 2020 - SeleDreams" TextAlignment =" Center" />
12+ </StackPanel >
13+ </Window >
Original file line number Diff line number Diff line change 1+ using Avalonia ;
2+ using Avalonia . Controls ;
3+ using Avalonia . Markup . Xaml ;
4+
5+ namespace CoroHeartToolkitGUI . Views
6+ {
7+ public class AboutWindow : Window
8+ {
9+ public AboutWindow ( )
10+ {
11+ this . InitializeComponent ( ) ;
12+ #if DEBUG
13+ this . AttachDevTools ( ) ;
14+ #endif
15+ }
16+
17+ private void InitializeComponent ( )
18+ {
19+ AvaloniaXamlLoader . Load ( this ) ;
20+ }
21+ }
22+ }
Original file line number Diff line number Diff line change 66 <Template >
77 <ContextMenu >
88 <MenuItem Header =" Export" Command =" {Binding $parent[4].DataContext.ExportFile}" />
9- <MenuItem Header =" Replace (Not implemented yet.)" />
9+ <MenuItem Header =" Replace (Not implemented yet.)" IsEnabled = " False " />
1010 </ContextMenu >
1111 </Template >
1212 </Setter >
Original file line number Diff line number Diff line change 44 xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
55 mc : Ignorable =" d" d : DesignWidth =" 800" d : DesignHeight =" 450"
66 x : Class =" CoroHeartToolkitGUI.Views.FilePropertiesView" >
7- <DataGrid Focusable =" False" Items =" {Binding Properties}" CanUserResizeColumns =" True" CanUserReorderColumns =" True" CanUserSortColumns =" False" >
7+ <DataGrid SelectedIndex = " 0 " Focusable =" False" Items =" {Binding Properties}" CanUserResizeColumns =" True" CanUserReorderColumns =" True" CanUserSortColumns =" False" >
88 <DataGrid .Columns>
99 <DataGridTextColumn IsReadOnly =" True" Header =" Property" MinWidth =" 100" Width =" 100*" Binding =" {Binding Property}" />
1010 <DataGridTextColumn IsReadOnly =" True" Header = " Value" MinWidth =" 100" Width =" 100*" Binding =" {Binding Value}" />
Original file line number Diff line number Diff line change 77 x : Class =" CoroHeartToolkitGUI.Views.MainWindow"
88 Icon =" /Assets/avalonia-logo.ico"
99 Title =" CoroHeartToolkitGUI"
10+ Height =" 500"
11+ Width =" 700"
1012 MinWidth =" 400"
11- MinHeight =" 300" >
13+ MinHeight =" 300"
14+ WindowStartupLocation =" CenterScreen" >
1215 <Grid x : Name =" Root" RowDefinitions =" 2,20,*" ShowGridLines =" False" >
1316 <ContentControl Content =" {Binding TopMenu}" Grid.Row=" 1" Grid.Column=" 0" />
1417 <Grid x : Name =" MainContainer" Grid.Row=" 2" ShowGridLines =" False" Background =" LightGray" >
Original file line number Diff line number Diff line change 1+ dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true -o " Publish/win-x64"
2+ dotnet publish -r win-x86 -c Release /p:PublishSingleFile=true -o " Publish/win-x86"
3+ dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true -o " Publish/linux-x64"
4+ ./zip.bat
Original file line number Diff line number Diff line change 1+ cmd.exe /c IF EXIST *-Release.zip (del /S *-Release.zip)
2+ echo " Test"
3+ for /d %%X in (Publish/*) do " C:\Program Files\7-Zip\7z.exe" a -tzip " %%X -Release.zip" " Publish/%%X /*"
You can’t perform that action at this time.
0 commit comments