public MainVM() { keyboardListenerService = App.Container.Resolve <KeyboardListenerService>(); networkListenerService = App.Container.Resolve <NetworkListenerService>(); networkListenerService.InternetConnectionChanged += networkListenerService_InternetConnectionChanged; _isInternet = NetworkListenerService.IsConnected; Panels.Add(new Panel(Strings.Home, 0, App.Current.Resources["HomeSymbol"].ToString(), true)); Panels.Add(new Panel(Strings.Videos, 1, App.Current.Resources["MovieSymbol"].ToString())); Panels.Add(new Panel(Strings.Music, 2, App.Current.Resources["MusicSymbol"].ToString())); Panels.Add(new Panel(Strings.FileExplorer, 3, App.Current.Resources["FileExplorerSymbol"].ToString())); Initialize(); CoreWindow.GetForCurrentThread().Activated += ApplicationState_Activated; Locator.NavigationService.ViewNavigated += (sender, page) => { var appView = ApplicationView.GetForCurrentView(); if (page != VLCPage.VideoPlayerPage) { // We shouldn't load music and video libraries if the app opens on video page, because it's bad if (Locator.VideoLibraryVM.LoadingState == LoadingState.NotLoaded) { var _ = Task.Run(async() => await Locator.VideoLibraryVM.Initialize()); } if (Locator.MusicLibraryVM.LoadingState == LoadingState.NotLoaded) { var _ = Task.Run(async() => await Locator.MusicLibraryVM.Initialize()); } appView.Title = ""; } else { var title = Locator.VideoVm?.CurrentVideo?.Name; if (!string.IsNullOrEmpty(title)) { appView.Title = title; } } if (App.SplitShell.TopBarContent == null) { App.SplitShell.TopBarContent = new TopBar(); } if (App.SplitShell.InformationText == null) { App.SplitShell.InformationText = new MenuBarControl(); } if (MenuBarDisplayed) { MenuBarDisplayed = false; } if (App.SplitShell.FooterContent == null) { App.SplitShell.FooterContent = new BottomMiniPlayer(); } CurrentPage = page; CanGoBack = Locator.NavigationService.CanGoBack(); }; }
public MainVM() { keyboardListenerService = App.Container.Resolve <KeyboardListenerService>(); Panels.Add(new Panel(Strings.Videos, VLCPage.MainPageVideo, App.Current.Resources["VideoSymbol"].ToString(), App.Current.Resources["VideoFilledSymbol"].ToString())); Panels.Add(new Panel(Strings.Music, VLCPage.MainPageMusic, App.Current.Resources["WaveSymbol"].ToString(), App.Current.Resources["WaveFilledSymbol"].ToString())); Panels.Add(new Panel(Strings.FileExplorer, VLCPage.MainPageFileExplorer, App.Current.Resources["FileExplorerSymbol"].ToString(), App.Current.Resources["FileExplorerFilledSymbol"].ToString())); Panels.Add(new Panel(Strings.Network, VLCPage.MainPageNetwork, App.Current.Resources["StreamSymbol"].ToString(), App.Current.Resources["StreamFilledSymbol"].ToString())); CoreWindow.GetForCurrentThread().Activated += ApplicationState_Activated; }
public MainVM() { keyboardListenerService = App.Container.Resolve <KeyboardListenerService>(); Panels.Add(new Panel(Strings.Videos, VLCPage.MainPageVideo, App.Current.Resources["VideoSymbol"].ToString(), App.Current.Resources["VideoFilledSymbol"].ToString())); Panels.Add(new Panel(Strings.Music, VLCPage.MainPageMusic, App.Current.Resources["WaveSymbol"].ToString(), App.Current.Resources["WaveFilledSymbol"].ToString())); Panels.Add(new Panel(Strings.FileExplorer, VLCPage.MainPageFileExplorer, App.Current.Resources["FileExplorerSymbol"].ToString(), App.Current.Resources["FileExplorerFilledSymbol"].ToString())); Panels.Add(new Panel(Strings.Network, VLCPage.MainPageNetwork, App.Current.Resources["StreamSymbol"].ToString(), App.Current.Resources["StreamFilledSymbol"].ToString())); CoreWindow.GetForCurrentThread().Activated += ApplicationState_Activated; // The command bar display depends on: // - The current page Locator.NavigationService.ViewNavigated += (_, __) => NotifyCommandBarDisplayModeChanged(); // And whether the media is a video or not Locator.PlaybackService.PlayingTypeChanged += (_) => NotifyCommandBarDisplayModeChanged(); }