From 12572347124d680f00753879e494f2ee8e72f59b Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 1 Jun 2024 12:13:57 +0800 Subject: [PATCH] fix: binding errors in xaml --- src/Resources/Styles.axaml | 6 +++--- src/Views/ChangeCollectionView.axaml.cs | 4 ++-- src/Views/Clone.axaml | 15 +++++++-------- src/Views/Clone.axaml.cs | 14 ++++++++------ src/Views/CommitChanges.axaml | 2 +- src/Views/CommitDetail.axaml | 2 +- src/Views/Launcher.axaml | 18 +++++++++--------- src/Views/RevisionCompare.axaml | 2 +- src/Views/TextDiffView.axaml | 7 +++---- src/Views/WorkingCopy.axaml | 7 +++---- 10 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 148f5a1d..c373d891 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -362,7 +362,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Width="12" - Fill="{Binding $parent.Foreground}"/> + Fill="{DynamicResource Brush.FG1}"/> + Fill="{DynamicResource Brush.FG1}"/> + Fill="{DynamicResource Brush.FG1}"/> diff --git a/src/Views/ChangeCollectionView.axaml.cs b/src/Views/ChangeCollectionView.axaml.cs index 6ce04ff6..81ce514c 100644 --- a/src/Views/ChangeCollectionView.axaml.cs +++ b/src/Views/ChangeCollectionView.axaml.cs @@ -11,9 +11,9 @@ namespace SourceGit.Views public partial class ChangeCollectionView : UserControl { public static readonly StyledProperty IsWorkingCopyChangeProperty = - AvaloniaProperty.Register(nameof(IsWorkingCopy), false); + AvaloniaProperty.Register(nameof(IsWorkingCopyChange), false); - public bool IsWorkingCopy + public bool IsWorkingCopyChange { get => GetValue(IsWorkingCopyChangeProperty); set => SetValue(IsWorkingCopyChangeProperty, value); diff --git a/src/Views/Clone.axaml b/src/Views/Clone.axaml index 627716b8..47dca098 100644 --- a/src/Views/Clone.axaml +++ b/src/Views/Clone.axaml @@ -2,7 +2,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:m="using:SourceGit.Models" xmlns:vm="using:SourceGit.ViewModels" xmlns:v="using:SourceGit.Views" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" @@ -11,14 +10,14 @@ - + - + - + @@ -44,11 +43,11 @@ - + - + diff --git a/src/Views/Clone.axaml.cs b/src/Views/Clone.axaml.cs index af13412f..a1e38050 100644 --- a/src/Views/Clone.axaml.cs +++ b/src/Views/Clone.axaml.cs @@ -15,11 +15,12 @@ namespace SourceGit.Views { var options = new FolderPickerOpenOptions() { AllowMultiple = false }; var toplevel = TopLevel.GetTopLevel(this); + if (toplevel == null) + return; + var selected = await toplevel.StorageProvider.OpenFolderPickerAsync(options); if (selected.Count == 1) - { - txtParentFolder.Text = selected[0].Path.LocalPath; - } + TxtParentFolder.Text = selected[0].Path.LocalPath; e.Handled = true; } @@ -28,11 +29,12 @@ namespace SourceGit.Views { var options = new FilePickerOpenOptions() { AllowMultiple = false, FileTypeFilter = [new FilePickerFileType("SSHKey") { Patterns = ["*.*"] }] }; var toplevel = TopLevel.GetTopLevel(this); + if (toplevel == null) + return; + var selected = await toplevel.StorageProvider.OpenFilePickerAsync(options); if (selected.Count == 1) - { - txtSSHKey.Text = selected[0].Path.LocalPath; - } + TxtSshKey.Text = selected[0].Path.LocalPath; e.Handled = true; } diff --git a/src/Views/CommitChanges.axaml b/src/Views/CommitChanges.axaml index eccd0952..8dd585bd 100644 --- a/src/Views/CommitChanges.axaml +++ b/src/Views/CommitChanges.axaml @@ -46,7 +46,7 @@ - @@ -200,7 +200,7 @@