fix: add button, upgrade version individually.

This commit is contained in:
rabbitism 2023-11-08 15:07:08 +08:00
parent 98785417b2
commit 8ff8057f07
3 changed files with 12 additions and 1 deletions

View File

@ -167,6 +167,7 @@
Grid.Row="2"
Margin="12,0,12,12"
HorizontalAlignment="Right"
Command="{Binding AddCommand}"
Content="Add" />
</Grid>
</TabItem>

View File

@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using Avalonia.Collections;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace Semi.Avalonia.Demo.ViewModels;
@ -15,6 +16,8 @@ public class DataGridDemoViewModel: ObservableObject
public ObservableCollection<SongViewModel> GridData3 { get; set; }
public RelayCommand AddCommand { get; set; }
public DataGridDemoViewModel()
{
GridData1 = new ObservableCollection<Song>(Song.Songs);
@ -28,6 +31,12 @@ public class DataGridDemoViewModel: ObservableObject
CountOfComment = a.CountOfComment,
IsSelected = false
}));
AddCommand = new RelayCommand(Add);
}
private void Add()
{
GridData3.Add(new SongViewModel());
}
}

View File

@ -5,6 +5,7 @@
<PropertyGroup>
<Title>Semi.Avalonia.DataGrid</Title>
<PackageReleaseNotes>Update to 11.0.1</PackageReleaseNotes>
<Version>11.0.1.1</Version>
</PropertyGroup>
<ItemGroup>