コード例 #1
0
        /// <summary>
        /// When the selection in the listbox is changed, it loads the appropriate game profile as the selected one.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StockGameList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (stockGameList.SelectedIndex < 0)
            {
                return;
            }

            e.Handled = true;
            _selected = GameProfileLoader.GameProfiles[stockGameList.SelectedIndex];
            Library.UpdateIcon(_selected.IconName.Split('/')[1], ref gameIcon);
        }
コード例 #2
0
        /// <summary>
        /// When the selection in the listbox is changed, it loads the appropriate game profile as the selected one.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StockGameList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (stockGameList.SelectedIndex < 0)
            {
                return;
            }

            e.Handled = true;
            _selected = GameProfileLoader.GameProfiles[stockGameList.SelectedIndex];
            Library.UpdateIcon(_selected.IconName.Split('/')[1], ref gameIcon);

            var added = ((ListBoxItem)stockGameList.SelectedItem).Foreground == Brushes.Green;

            AddButton.IsEnabled    = !added;
            DeleteButton.IsEnabled = added;
        }
コード例 #3
0
        /// <summary>
        /// When the selection in the listbox is changed, it loads the appropriate game profile as the selected one.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StockGameList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (stockGameList.SelectedIndex < 0)
            {
                return;
            }

            e.Handled = true;
            _selected = GameProfileLoader.GameProfiles[stockGameList.SelectedIndex];
            Library.UpdateIcon(_selected.IconName.Split('/')[1], ref gameIcon);
            if (((ListBoxItem)stockGameList.SelectedItem).Foreground == Brushes.Green) // if we have the game.
            {
                AddButton.IsEnabled    = false;                                        // turn off Add button
                DeleteButton.IsEnabled = true;                                         // and turn on Delete button.
            }
            else
            {
                AddButton.IsEnabled    = true;                                       // do the opposite
                DeleteButton.IsEnabled = false;
            }
        }