public void UpdateCommandBar(IEnumerable <Favorite> selectedFavorites)
 {
     CommandBar.Clear();
     CommandBar
     .AddCommand(new CommandModel
     {
         Content          = "Play",
         Icon             = AppIcons.Play.ToImage(),
         Command          = PlayFavoritesCommand,
         CommandParameter = selectedFavorites.ToArray()
     })
     .AddCommand(new CommandModel
     {
         Content          = "Queue",
         Icon             = AppIcons.Add.ToImage(),
         Command          = QueueFavoritesCommand,
         CommandParameter = selectedFavorites.ToArray()
     })
     .AddSeparator()
     .AddCommand(new CommandModel
     {
         Content          = "Remove",
         Icon             = AppIcons.Delete.ToImage(),
         Command          = DeleteFavoritesCommand,
         CommandParameter = selectedFavorites.ToArray()
     });
 }
        public void RefreshCommandBar(IEnumerable <FilesetViewModel> selectedFilesets)
        {
            CommandBar.Clear();

            var filesetViewModels = selectedFilesets as FilesetViewModel[] ?? selectedFilesets.ToArray();

            if (filesetViewModels.Any())
            {
                var filesetViewModel = filesetViewModels.First();

                CommandBar
                .AddCommand(new CommandModel
                {
                    Content          = "Clone",
                    Command          = new DelegateCommand <IEnumerable <FilesetViewModel> >(ExecuteCloneFilesets),
                    CommandParameter = selectedFilesets,
                    Icon             = new Image
                    {
                        Source =
                            new BitmapImage(new Uri("pack://application:,,,/Resources/light/appbar.list.two.png"))
                    }
                })
                .AddCommand(new CommandModel
                {
                    Content          = filesetViewModel.IsEnabled ? "Deactivate" : "Activate",
                    Command          = new DelegateCommand <FilesetViewModel>(model => model.IsEnabled = !model.IsEnabled),
                    CommandParameter = filesetViewModel,
                    Icon             = new Image
                    {
                        Source = filesetViewModel.IsEnabled
                                ? new BitmapImage(new Uri("pack://application:,,,/Resources/light/appbar.eye.close.png"))
                                : new BitmapImage(new Uri("pack://application:,,,/Resources/light/appbar.eye.check.png"))
                    }
                });

                if (filesetViewModel.Includes.Any() || filesetViewModel.Excludes.Any())
                {
                    CommandBar.AddCommand(new CommandModel
                    {
                        Content = "Execute file copy",
                        Command = new DelegateCommand <FilesetViewModel>(model =>
                        {
                            var fs = _filesetService.Filesets.FirstOrDefault(f => f.Id == model.Id);

                            if (fs != null)
                            {
                                _replicationService.Execute(fs);
                            }
                        }),
                        CommandParameter = filesetViewModel,
                        Icon             = new Image
                        {
                            Source =
                                new BitmapImage(new Uri("pack://application:,,,/Resources/light/appbar.diagram.png"))
                        }
                    });
                }
            }
        }
 public void UpdateCommandBar(IEnumerable <SimilarArtistModel> selectedItems)
 {
     CommandBar.Clear();
     CommandBar
     .AddCommand(new CommandModel
     {
         Content          = "Play",
         Icon             = AppIcons.Play.ToImage(),
         Command          = PlayArtistCommand,
         CommandParameter = selectedItems.LastOrDefault()
     })
     .AddCommand(new CommandModel
     {
         Content          = "Queue",
         Icon             = AppIcons.Add.ToImage(),
         Command          = new DelegateCommand <IEnumerable <SimilarArtistModel> >(a => a.ForEach(f => QueueArtistCommand.Execute(f))),
         CommandParameter = selectedItems
     });
 }