public static UiCommand Generate(AudioAlbumViewModel model) { if (model == null || model.Album == null) { return(null); } if (model.PlayAlbum != null) { return(new UiCommand(o => model.PlayAlbum(model.Album))); } return(new UiCommand(o => Dispatcher.Dispatch("Multiple Track Selected For Play", model.Album.Tracks, 0))); }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { AudioAlbumViewModel model = new AudioAlbumViewModel(); foreach (var value in values) { if (value is Album) { model.Album = value as Album; } else if (value is PlayAlbum) { model.PlayAlbum = value as PlayAlbum; } } return(model); }