private void PopulateControls() { lstPlayerType.ItemsSource = PlayableItemFactory.Instance.GetAllPlayableExternalConfigurators().Select(t => t.ExternalPlayerName); SetListDataSource(lstMediaTypes, EnumWrapperList <MediaType> .Create()); SetListDataSource(lstVideoFormats, EnumWrapperList <VideoFormat> .Create()); }
void lnkSelectAllMediaTypes_Click(object sender, RoutedEventArgs e) { EnumWrapperList <MediaType> source = lstMediaTypes.ItemsSource as EnumWrapperList <MediaType>; bool selectAll = (sender as Hyperlink) == lnkSelectAllMediaTypes; source.SelectAll(selectAll); SetListDataSource(lstMediaTypes, source); }
void lnkSelectAllVideoFormats_Click(object sender, RoutedEventArgs e) { EnumWrapperList <VideoFormat> source = lstVideoFormats.ItemsSource as EnumWrapperList <VideoFormat>; bool selectAll = (sender as Hyperlink) == lnkSelectAllVideoFormats; source.SelectAll(selectAll); SetListDataSource(lstVideoFormats, source); }
public static EnumWrapperList <TEnumType> Create() { EnumWrapperList <TEnumType> list = new EnumWrapperList <TEnumType>(); foreach (TEnumType val in Enum.GetValues(typeof(TEnumType))) { list.Add(new EnumWrapper <TEnumType>() { Value = val, IsChecked = false }); } return(list); }
public void FillControlsFromObject(CommonConfigData.ExternalPlayer externalPlayer, PlayableExternalConfigurator uiConfigurator, bool refreshMediaTypes, bool refreshVideoFormats) { lstPlayerType.SelectedItem = externalPlayer.ExternalPlayerName; txtArguments.Text = externalPlayer.Args; chkMinimizeMce.IsChecked = externalPlayer.MinimizeMCE; chkShowSplashScreen.IsChecked = externalPlayer.ShowSplashScreen; //chkHideTaskbar.IsChecked = externalPlayer.HideTaskbar; chkSupportsMultiFileCommand.IsChecked = externalPlayer.SupportsMultiFileCommandArguments; chkSupportsPLS.IsChecked = externalPlayer.SupportsPlaylists; if (refreshMediaTypes) { EnumWrapperList <MediaType> mediaTypes = lstMediaTypes.ItemsSource as EnumWrapperList <MediaType>; mediaTypes.SetValues(externalPlayer.MediaTypes); SetListDataSource(lstMediaTypes, mediaTypes); } if (refreshVideoFormats) { EnumWrapperList <VideoFormat> videoFormats = lstVideoFormats.ItemsSource as EnumWrapperList <VideoFormat>; videoFormats.SetValues(externalPlayer.VideoFormats); SetListDataSource(lstVideoFormats, videoFormats); } SetControlVisibility(uiConfigurator); SetTips(uiConfigurator); if (string.IsNullOrEmpty(externalPlayer.Command)) { AutoFillPaths(uiConfigurator); } else { txtCommand.Text = externalPlayer.Command; } }
private void SetListDataSource <T>(ListBox listbox, EnumWrapperList <T> source) { listbox.ItemsSource = null; listbox.ItemsSource = source; }
public NewCategoryViewModel() { CategoryTypes = new EnumWrapperList <CategoryType>(); }