mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix<Launcher>: INotifyPropertyChanged event not raised when IsActive changed
This commit is contained in:
parent
a2254ae578
commit
d993147107
2 changed files with 18 additions and 4 deletions
|
@ -79,7 +79,7 @@
|
|||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type local:Launcher+RepoTab}">
|
||||
<Grid MinWidth="72" Margin="12,0">
|
||||
<Grid MinWidth="80" Margin="8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
|
|
|
@ -21,18 +21,32 @@ namespace SourceGit.UI {
|
|||
/// Tab data.
|
||||
/// </summary>
|
||||
public class Tab : INotifyPropertyChanged {
|
||||
private bool isActive = false;
|
||||
|
||||
public string Title { get; set; }
|
||||
public string Tooltip { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public Git.Repository Repo { get; set; }
|
||||
public object Page { get; set; }
|
||||
public bool IsRepo => Repo != null;
|
||||
|
||||
public bool IsRepo {
|
||||
get { return Repo != null; }
|
||||
}
|
||||
|
||||
public int Color {
|
||||
get { return Repo == null ? 0 : Repo.Color; }
|
||||
set {
|
||||
if (Repo == null || Repo.Color == value) return;
|
||||
Repo.Color = value;
|
||||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Color"));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Color"));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsActive {
|
||||
get { return isActive; }
|
||||
set {
|
||||
if (isActive == value) return;
|
||||
isActive = value;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsActive"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue