mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07: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>
|
||||||
|
|
||||||
<DataTemplate DataType="{x:Type local:Launcher+RepoTab}">
|
<DataTemplate DataType="{x:Type local:Launcher+RepoTab}">
|
||||||
<Grid MinWidth="72" Margin="12,0">
|
<Grid MinWidth="80" Margin="8,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
|
|
@ -21,18 +21,32 @@ namespace SourceGit.UI {
|
||||||
/// Tab data.
|
/// Tab data.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Tab : INotifyPropertyChanged {
|
public class Tab : INotifyPropertyChanged {
|
||||||
|
private bool isActive = false;
|
||||||
|
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Tooltip { get; set; }
|
public string Tooltip { get; set; }
|
||||||
public bool IsActive { get; set; }
|
|
||||||
public Git.Repository Repo { get; set; }
|
public Git.Repository Repo { get; set; }
|
||||||
public object Page { get; set; }
|
public object Page { get; set; }
|
||||||
public bool IsRepo => Repo != null;
|
|
||||||
|
public bool IsRepo {
|
||||||
|
get { return Repo != null; }
|
||||||
|
}
|
||||||
|
|
||||||
public int Color {
|
public int Color {
|
||||||
get { return Repo == null ? 0 : Repo.Color; }
|
get { return Repo == null ? 0 : Repo.Color; }
|
||||||
set {
|
set {
|
||||||
if (Repo == null || Repo.Color == value) return;
|
if (Repo == null || Repo.Color == value) return;
|
||||||
Repo.Color = value;
|
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