misc: format code for consistency and readability.

This commit is contained in:
Zhang Dian
2025-05-29 18:40:03 +08:00
parent 14a3384cd2
commit d03fe72fc2
64 changed files with 131 additions and 298 deletions

View File

@@ -2,11 +2,10 @@ using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo.ViewModels;
public partial class ApplicationViewModel: ObservableObject
public partial class ApplicationViewModel : ObservableObject
{
[RelayCommand]
private void Exit()

View File

@@ -30,7 +30,7 @@ public partial class FilesPageViewModel : ObservableObject
Source.Items = [Root];
}
}
partial void OnSelectedPathChanged(string? value)
{
SetSelectedPath(value);

View File

@@ -27,25 +27,25 @@ public class SongsPageViewModel : ObservableObject
{
new CheckBoxColumn<SongViewModel>(
"IsSelected",
a => a.IsSelected,
a => a.IsSelected,
(model, b) => { model.IsSelected = b; },
new GridLength(108, GridUnitType.Pixel)),
new TextColumn<SongViewModel, string>(
"Title",
a => a.Title,
"Title",
a => a.Title,
(o, a) => o.Title = a,
new GridLength(6, GridUnitType.Star)),
new TextColumn<SongViewModel, string>("Artist",
a => a.Artist,
new TextColumn<SongViewModel, string>("Artist",
a => a.Artist,
(o, a) => o.Artist = a,
new GridLength(6, GridUnitType.Star)),
new TemplateColumn<SongViewModel>("Album",
"AlbumCell",
new TemplateColumn<SongViewModel>("Album",
"AlbumCell",
"AlbumEditCell",
new GridLength(6, GridUnitType.Star)),
new TemplateColumn<SongViewModel>(
"Comments",
"CommentsCell",
"Comments",
"CommentsCell",
"CommentsEditCell",
new GridLength(6, GridUnitType.Star)),
}

View File

@@ -2,7 +2,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.ViewModels;
public class TreeDataGridDemoViewModel: ObservableObject
public class TreeDataGridDemoViewModel : ObservableObject
{
public SongsPageViewModel SongsContext { get; } = new();
public FilesPageViewModel FilesContext { get; } = new();