private async Task OnSourceSelectionChanged(IPokePicturesSource picturesSource) { var needInit = picturesSource as INeedInitialisation; if (needInit != null) { if (await needInit.IsInitialized()) { IsBusy = true; await needInit.Initialize(); } } _picturesSourceProvider.Source = picturesSource; OnPropertyChanged(nameof(SelectedSource)); IsBusy = false; }
public PokePicturesSourceProvider(INavigationService navigationService, IPokePicturesSource[] availableSources) { AvailableSources = availableSources; _Source = AvailableSources.Where(item => item is DefaultPokePicturesSource).First(); }
public PokePicturesSourceProvider(IPokePicturesSource source) { _Source = source; }
public PokemonDexNumberToPictureConverter() { _sourceProvider = Startup.ServiceProvider.GetService <IPokePicturesSourceProvider>(); _picturesSource = _sourceProvider.Source; _sourceProvider.SourceChanged += () => _picturesSource = _sourceProvider.Source; }
public PokemonDexNumberToPictureConverter() { _sourceProvider = ServiceLocator.Current.GetInstance <IPokePicturesSourceProvider>(); _picturesSource = _sourceProvider.Source; _sourceProvider.SourceChanged += () => _picturesSource = _sourceProvider.Source; }