updated tests

This commit is contained in:
Torben Nehmer 2024-07-31 17:50:03 +02:00
parent da94963c4f
commit 0d7c14e9a1
3 changed files with 44 additions and 39 deletions

View File

@ -10,7 +10,7 @@
</Application.DataTemplates> </Application.DataTemplates>
<Application.Styles> <Application.Styles>
<FluentTheme /> <FluentTheme DensityStyle="Compact" />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/> <StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
</Application.Styles> </Application.Styles>
</Application> </Application>

View File

@ -11,11 +11,9 @@
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup> </PropertyGroup>
<!-- PropertyGroup> <ItemGroup>
<OutputType>WinExe</OutputType> <AvaloniaResource Include="Assets\**" />
</PropertyGroup --> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />

View File

@ -6,6 +6,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="net.nehmer.sa.Views.MainWindow" x:Class="net.nehmer.sa.Views.MainWindow"
x:DataType="vm:MainWindowViewModel" x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
Title="GetStartedApp"> Title="GetStartedApp">
<!-- Icon="/Assets/avalonia-logo.ico" --> <!-- Icon="/Assets/avalonia-logo.ico" -->
@ -16,37 +17,43 @@
<vm:MainWindowViewModel/> <vm:MainWindowViewModel/>
</Design.DataContext> </Design.DataContext>
<StackPanel> <TabControl>
<Border Margin="5" CornerRadius="10" Background="LightBlue"> <TabItem Header="Home">
<TextBlock Margin="5" FontSize="24" HorizontalAlignment="Center" Text="{Binding Greeting}"></TextBlock> <StackPanel>
</Border> <Border Margin="5" CornerRadius="10" Background="LightBlue">
<Grid ShowGridLines="True" Margin="5" ColumnDefinitions="120, 100" RowDefinitions="Auto, Auto, Auto"> <TextBlock Margin="5" FontSize="24" HorizontalAlignment="Center" Text="{Binding Greeting}"></TextBlock>
<Label Grid.Row="0" Grid.Column="0" Margin="10">Celsius</Label> </Border>
<TextBox Grid.Row="0" Grid.Column="1" Margin="0 5" Text="0" Name="celsius"/> <Grid ShowGridLines="True" Margin="5" ColumnDefinitions="120, 100" RowDefinitions="Auto, Auto, Auto">
<Label Grid.Row="1" Grid.Column="0" Margin="10">Fahrenheit</Label> <Label Grid.Row="0" Grid.Column="0" Margin="10">Celsius</Label>
<TextBox Grid.Row="1" Grid.Column="1" Margin="0 5" Text="0" Name="fahrenheit"/> <TextBox Grid.Row="0" Grid.Column="1" Margin="0 5" Text="0" Name="celsius"/>
<Button Grid.Row="2" Grid.Column="1" Margin="0 5" Click="ButtonClicked">Calculate</Button> <Label Grid.Row="1" Grid.Column="0" Margin="10">Fahrenheit</Label>
</Grid> <TextBox Grid.Row="1" Grid.Column="1" Margin="0 5" Text="0" Name="fahrenheit"/>
<DataGrid Margin="20" ItemsSource="{Binding Planets}" <Button Grid.Row="2" Grid.Column="1" Margin="0 5" Click="ButtonClicked">Calculate</Button>
AutoGenerateColumns="True" IsReadOnly="True" </Grid>
GridLinesVisibility="All" </StackPanel>
BorderThickness="1" BorderBrush="Gray"> </TabItem>
</DataGrid> <TabItem Header="DataGrid">
<DataGrid ItemsSource="{Binding Planets}"
<!-- ScrollViewer> AutoGenerateColumns="True" IsReadOnly="True"
<ItemsControl ItemsSource="{Binding Planets}"> GridLinesVisibility="All"
<ItemsControl.ItemTemplate> FrozenColumnCount="1"
<DataTemplate DataType="vm:PlanetViewModel"> BorderThickness="1" BorderBrush="Gray">
<Grid ColumnDefinitions="200, 100, 50"> </DataGrid>
<TextBlock Grid.Column="0" Text="{Binding Name}"/> </TabItem>
<TextBlock Grid.Column="1" Text="{Binding Owner}"/> <TabItem Header="ScrollViewer">
<TextBlock Grid.Column="2" Text="{Binding Value}"/> <ScrollViewer>
</Grid> <ItemsControl ItemsSource="{Binding Planets}">
</DataTemplate> <ItemsControl.ItemTemplate>
</ItemsControl.ItemTemplate> <DataTemplate DataType="vm:PlanetViewModel">
</ItemsControl> <Grid ColumnDefinitions="200, 100, 50">
</ScrollViewer--> <TextBlock Grid.Column="0" Text="{Binding Name}"/>
<TextBlock Grid.Column="1" Text="{Binding Owner}"/>
</StackPanel> <TextBlock Grid.Column="2" Text="{Binding Value}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</TabItem>
</TabControl>
</Window> </Window>