public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(false); } var channel = (ChannelInstance)value; return(SelectedChannels.Contains(channel.Configuration.ChannelId)); }
void ToggleChannelInstance(ChannelInstance channel) { if (SelectedChannels.Contains(channel.Configuration.ChannelId)) { SelectedChannels.Remove(channel.Configuration.ChannelId); } else { SelectedChannels.Add(channel.Configuration.ChannelId); } // Forces a propertychanged event, which resets our toggle button channel.IsVisible = channel.IsVisible; OnPropertyChanged("HasTwitter"); }