Example #1
0
 public void SetNavigationService(Template10.Services.NavigationService.INavigationService navigationService)
 {
     MyHamburgerMenu.NavigationService = navigationService;
     //HamburgerMenu.RefreshStyles(m_settings.AppTheme, true);
     HamburgerMenu.IsFullScreen = m_settings.IsFullScreen;
     //HamburgerMenu.HamburgerButtonVisibility = m_settings.ShowHamburgerButton ? Visibility.Visible : Visibility.Collapsed;
 }
 private async void MediaPlayer_StateChanged(object sender, Template10.Common.ChangedEventArgs<MediaPlayerState> e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         if (e.NewValue == MediaPlayerState.Playing || e.NewValue == MediaPlayerState.Buffering)
         {
             VisualStateManager.GoToState(this, "Playing", true);
             IsDownloadBarDisabled = true;
             songtimer.Start();
         }
         else
         {
             VisualStateManager.GoToState(this, "Paused", true);
             if (e.NewValue != MediaPlayerState.Opening)
                 songtimer.Stop();
         }
     });
 }
Example #3
0
 private void Instance_CurrentIndexChanged(object sender, Template10.Common.ChangedEventArgs<int> e)
 {
     //TODO: 针对播放中的打乱顺序进行处理
     ListViewItem t;
     if (ListType == PlaylistType.LocalPlaylist)
     {
         if (e.OldValue >= 0)
         {
             t = Songlist.ContainerFromIndex(e.OldValue) as ListViewItem;
             VisualStateManager.GoToState((t.Tag as SongItem), "NotPlaying", true);
         }
         if (e.NewValue >= 0)
         {
             t = Songlist.ContainerFromIndex(e.NewValue) as ListViewItem;
             VisualStateManager.GoToState((t.Tag as SongItem), "Playing", true);
             //TODO: 增加新专辑的时候会存在Item不为空但是container为空的情况
         }
     }
     else
     {
         //TODO: 刷新所有歌曲的播放状态?
     }
 }
 public virtual void OnNavigatingFrom(Template10.Services.NavigationService.NavigatingEventArgs args) { /* nothing by default */ }
 private void LoginHelper_UserChanged(object sender, Template10.Common.ChangedEventArgs<uint> e)
 {
     Current = e.NewValue > 0 ? UserModel.GetNew(e.NewValue) : UserModel.Null;
 }
 private void LoginHelper_LogStateChanged(object sender, Template10.Common.ChangedEventArgs<bool> e)
 {
     VisualStateManager.GoToState(View, e.NewValue ? "LoggedIn" : "NotLoggedIn", true);
 }
Example #7
0
 public virtual Task OnNavigatingFromAsync(Template10.Services.NavigationService.NavigatingEventArgs args)
 {
     return Task.CompletedTask;
 }
 private async void PlaybackSource_CurrentPlayingChanged(object sender, Template10.Common.ChangedEventArgs<SongModel> e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
             CurrentSong = e.NewValue ?? SongModel.Null);
 }
 private void Instance_PlaybackSourceChanged(object sender, Template10.Common.ChangedEventArgs<IPlaylist> e)
 {
     e.OldValue.CurrentPlayingChanged -= PlaybackSource_CurrentPlayingChanged;
     e.NewValue.CurrentPlayingChanged += PlaybackSource_CurrentPlayingChanged;
     this.IsPlayingRadio = (sender as PlaybackService).IsPlayingRadio;
 }
 public MergedNavigationService(Template10.Services.NavigationService.INavigationService nav)
 {
     t10Nav = nav;
     keyConfiguration = new Dictionary<string, Type>();
 }
 private void MyHamburgerMenu_SelectedChanged(object sender, Template10.Common.ChangedEventArgs<HamburgerButtonInfo> e)
 {
     SetGlyphForeground(e.OldValue, MyHamburgerMenu.NavButtonForeground);
     SetGlyphForeground(e.NewValue, MyHamburgerMenu.NavButtonCheckedForeground);
 }
Example #12
0
 public Shell(Template10.Services.NavigationService.INavigationService navigationService) : this()
 {
     SetNavigationService(navigationService);
 }