Replace ObservableCollection with BindableCollection

This commit is contained in:
miterosan
2018-11-21 19:15:55 +01:00
parent cd2737156f
commit a14b6ac9df
2 changed files with 34 additions and 33 deletions

View File

@ -31,6 +31,9 @@ namespace osu.Game.Online.Chat
@"#lobby"
};
private readonly BindableCollection<Channel> availableChannels = new BindableCollection<Channel>();
private readonly BindableCollection<Channel> joinedChannels = new BindableCollection<Channel>();
/// <summary>
/// The currently opened channel
/// </summary>
@ -39,12 +42,12 @@ namespace osu.Game.Online.Chat
/// <summary>
/// The Channels the player has joined
/// </summary>
public ObservableCollection<Channel> JoinedChannels { get; } = new ObservableCollection<Channel>(); //todo: should be publicly readonly
public IBindableCollection<Channel> JoinedChannels => joinedChannels;
/// <summary>
/// The channels available for the player to join
/// </summary>
public ObservableCollection<Channel> AvailableChannels { get; } = new ObservableCollection<Channel>(); //todo: should be publicly readonly
public IBindableCollection<Channel> AvailableChannels => availableChannels;
private IAPIProvider api;
private ScheduledDelegate fetchMessagesScheduleder;
@ -344,9 +347,10 @@ namespace osu.Game.Online.Chat
{
if (channel == null) return;
if (channel == CurrentChannel.Value) CurrentChannel.Value = null;
if (channel == CurrentChannel.Value)
CurrentChannel.Value = null;
JoinedChannels.Remove(channel);
joinedChannels.Remove(channel);
if (channel.Joined.Value)
{