Пример #1
0
        /// <summary>
        /// Async method used for loading when component is ready
        /// </summary>
        public async void LoadData()
        {
            if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject()) || isDataLoaded)
            {
                return;
            }

            isDataLoaded = true;

            YtChannels.AddRange(_yupRepository.GetAllYtChannels());
        }
Пример #2
0
        public VideosViewModel(IYtManager ytManager, IEventBus eventBus, IYupRepository yupRepository)
        {
            _eventBus      = eventBus;
            _yupRepository = yupRepository;
            _ytManager     = ytManager;

            _dataLoaded = false;

            Categories = new ObservableCollection <string>();

            test       = new RelayCommand(onTest);
            YtVideos   = new ObservableCollection <YTVideo>();
            YtChannels = new ObservableCollection <YTChannel>();
            YtChannels.AddRange(_yupRepository.GetAllYtChannels());
        }