mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
code_style: use readonly property instead of responsive property for Workspace.Brush
This commit is contained in:
parent
33f9ae0cd6
commit
687b58576d
1 changed files with 2 additions and 8 deletions
|
@ -1,8 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
namespace SourceGit.ViewModels
|
namespace SourceGit.ViewModels
|
||||||
|
@ -21,7 +18,7 @@ namespace SourceGit.ViewModels
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SetProperty(ref _color, value))
|
if (SetProperty(ref _color, value))
|
||||||
Brush = new SolidColorBrush(value);
|
OnPropertyChanged(nameof(Brush));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,11 +46,9 @@ namespace SourceGit.ViewModels
|
||||||
set => SetProperty(ref _restoreOnStartup, value);
|
set => SetProperty(ref _restoreOnStartup, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public IBrush Brush
|
public IBrush Brush
|
||||||
{
|
{
|
||||||
get => _brush;
|
get => new SolidColorBrush(_color);
|
||||||
private set => SetProperty(ref _brush, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddRepository(string repo)
|
public void AddRepository(string repo)
|
||||||
|
@ -66,6 +61,5 @@ namespace SourceGit.ViewModels
|
||||||
private uint _color = 4278221015;
|
private uint _color = 4278221015;
|
||||||
private bool _isActive = false;
|
private bool _isActive = false;
|
||||||
private bool _restoreOnStartup = true;
|
private bool _restoreOnStartup = true;
|
||||||
private IBrush _brush = new SolidColorBrush(4278221015);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue