JryVideo.Selectors.WebImageSelector.WebImageSelectorWindow.WithMode C# (CSharp) Method

WithMode() private method

private WithMode ( ViewMode mode ) : void
mode ViewMode
return void
        private void WithMode(ViewMode mode)
        {
            this.ImagesListView1.Visibility = this.ImagesListView2.Visibility = Visibility.Collapsed;
            switch (mode)
            {
                case ViewMode.Mode1:
                    this.ImagesListView1.Visibility = Visibility.Visible;
                    break;

                case ViewMode.Mode2:
                    this.ImagesListView2.Visibility = Visibility.Visible;
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
            }
        }

Usage Example

 public static string StartSelectFanartByImdbId(Window parent, string index, params RemoteId[] ids)
 {
     var client = JryVideoCore.Current.GetTheTVDBClient();
     if (client == null)
     {
         parent.ShowJryVideoMessage("error", "TheTVDB init failed, try again.");
         return null;
     }
     var dlg = new WebImageSelectorWindow() { Owner = parent };
     dlg.WithMode(ViewMode.Mode2);
     dlg.ViewModel.BeginLoadFanartByImdbId(client, index, ids);
     return dlg.ShowDialog() == true ? dlg.ViewModel.SelectedUrl : null;
 }
All Usage Examples Of JryVideo.Selectors.WebImageSelector.WebImageSelectorWindow::WithMode