Example #1
0
        public async Task InitVideoVM()
        {
            // default video folder
            if (App.LocalSettings.ContainsKey("DefaultVideoFolder"))
            {
                StorageFolder customDefaultVideoFolder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(
                    App.LocalSettings["DefaultVideoFolder"].ToString());

                VideoVM = new VideoLibraryViewModel(customDefaultVideoFolder);
            }
            else
            {
                VideoVM = new VideoLibraryViewModel(KnownVLCLocation.VideosLibrary);
            }

            await VideoVM.GetMedia();

            MusicLibraryVm = Locator.MusicLibraryVM;
            await MusicLibraryVm.Initialize();

#if NETFX_CORE
            ExternalStorageVM = new ExternalStorageViewModel();
            await ExternalStorageVM.Initialize();
#endif
        }
Example #2
0
        public override async Task OnNavigatedTo(NavigationEventArgs e)
        {
            // Make sure we're only initializing once.
            if (e.NavigationMode == NavigationMode.New)
            {
                await InitVideoVM();

                await _lastViewedVM.Initialize();

                var dlnaFolder = await KnownVLCLocation.MediaServers.GetFoldersAsync();

                var tasks = new List <Task>();
                DLNAVMs.Clear();
                foreach (StorageFolder storageFolder in dlnaFolder)
                {
                    StorageFolder newFolder = storageFolder;
                    var           videoLib  = new VideoLibraryViewModel(newFolder);
                    tasks.Add(videoLib.GetMedia());
                    DLNAVMs.Add(videoLib);
                }
                await Task.WhenAll(tasks);
            }
        }
Example #3
0
        public async Task InitVideoVM()
        {
            // default video folder
            if (App.LocalSettings.ContainsKey("DefaultVideoFolder"))
            {
                StorageFolder customDefaultVideoFolder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(
                        App.LocalSettings["DefaultVideoFolder"].ToString());
                VideoVM = new VideoLibraryViewModel(customDefaultVideoFolder);
            }
            else
            {
                VideoVM = new VideoLibraryViewModel(KnownVLCLocation.VideosLibrary);
            }

            await VideoVM.GetMedia();

            MusicLibraryVm = Locator.MusicLibraryVM;
            await MusicLibraryVm.Initialize();

#if NETFX_CORE
            ExternalStorageVM = new ExternalStorageViewModel();
            await ExternalStorageVM.Initialize();
#endif
        }
Example #4
0
        public override async Task OnNavigatedTo(NavigationEventArgs e)
        {
            // Make sure we're only initializing once.
            if (e.NavigationMode == NavigationMode.New)
            {
                await InitVideoVM();
                await _lastViewedVM.Initialize();

                var dlnaFolder = await KnownVLCLocation.MediaServers.GetFoldersAsync();
                var tasks = new List<Task>();
                DLNAVMs.Clear();
                foreach (StorageFolder storageFolder in dlnaFolder)
                {
                    StorageFolder newFolder = storageFolder;
                    var videoLib = new VideoLibraryViewModel(newFolder);
                    tasks.Add(videoLib.GetMedia());
                    DLNAVMs.Add(videoLib);
                }
                await Task.WhenAll(tasks);
            }
        }