protected virtual void InitializeTracksToolbarItems()
        {
            var refreshItem = new ToolbarButton()
            {
                Title = Resources.GetStringByKey("Toolbar_Refresh"),
                Icon  = new BitmapIcon()
                {
                    UriSource = new Uri("ms-appx:///Resources/Images/Toolbar/refresh.png")
                },
                Command = RefreshCommand
            };

            var shuffleItem = new ToolbarButton()
            {
                Title   = Resources.GetStringByKey("Toolbar_ShuffleAll"),
                Icon    = new SymbolIcon(Symbol.Shuffle),
                Command = ShuffleAllCommand,
            };

            var sortItem = new ToolbarPicker()
            {
                Title = Resources.GetStringByKey("Toolbar_Sort"),
                Items =
                {
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByDateAdded")
                    },
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByTitle")
                    },
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByArtist")
                    }
                },

                OnSelectedItemChanged = index =>
                {
                    this.SelectedSortType = SortTypes[index];
                }
            };

            var selectionModeItem = new ToolbarButton()
            {
                Title   = Resources.GetStringByKey("Toolbar_Select"),
                Command = SwitchSelectionModeCommand,
                Icon    = new SymbolIcon(Symbol.Bullets)
            };

            sortItem.SelectedItem = sortItem.Items.First();

            ToolbarItems = new ObservableCollection <ToolbarItem>(new[] { shuffleItem, (ToolbarItem)sortItem, selectionModeItem, refreshItem });
        }
Esempio n. 2
0
        protected override void InitializeToolbar()
        {
            var shuffleItem = new ToolbarButton()
            {
                Title   = Resources.GetStringByKey("Toolbar_ShuffleAll"),
                Icon    = new SymbolIcon(Symbol.Shuffle),
                Command = ShuffleAllCommand,
            };

            var clearItem = new ToolbarButton()
            {
                Title   = Resources.GetStringByKey("Toolbar_ClearAll"),
                Icon    = new SymbolIcon(Symbol.Cancel),
                Command = ClearAllCommand,
            };

            var sortItem = new ToolbarPicker()
            {
                Title = Resources.GetStringByKey("Toolbar_Sort"),
                Items =
                {
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByDateAdded")
                    },
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByTitle")
                    },
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByArtist")
                    }
                },

                OnSelectedItemChanged = index =>
                {
                    this.SelectedSortType = SelectedSortType = SortTypes[index];
                }
            };

            var selectionModeItem = new ToolbarButton()
            {
                Title   = Resources.GetStringByKey("Toolbar_Select"),
                Command = SwitchSelectionModeCommand,
                Icon    = new SymbolIcon(Symbol.Bullets)
            };

            sortItem.SelectedItem = sortItem.Items.First();

            ToolbarItems = new ObservableCollection <ToolbarItem>(new[] { shuffleItem, clearItem, (ToolbarItem)sortItem, selectionModeItem });
        }
        protected virtual void InitializeToolbarItems()
        {
            var refreshItem = new ToolbarButton()
            {
                Title = Resources.GetStringByKey("Toolbar_Refresh"),
                Icon  = new BitmapIcon()
                {
                    UriSource = new Uri("ms-appx:///Resources/Images/Toolbar/refresh.png")
                },
                Command = RefreshCommand
            };

            var sortItem = new ToolbarPicker()
            {
                Title = Resources.GetStringByKey("Toolbar_Sort"),
                Items =
                {
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByRating")
                    },
                    new ToolbarButton()
                    {
                        Title = Resources.GetStringByKey("Toolbar_SortByName")
                    }
                },

                OnSelectedItemChanged = index =>
                {
                    this.SelectedSortType = SortTypes[index];
                }
            };

            sortItem.SelectedItem = sortItem.Items.First();

            ToolbarItems = new ObservableCollection <ToolbarItem>(new[] { (ToolbarItem)sortItem, refreshItem });
        }