diff --git a/src/BiliLite.UWP/BiliLite.UWP.csproj b/src/BiliLite.UWP/BiliLite.UWP.csproj index e3248a0e..f82f6883 100644 --- a/src/BiliLite.UWP/BiliLite.UWP.csproj +++ b/src/BiliLite.UWP/BiliLite.UWP.csproj @@ -172,8 +172,8 @@ - - UserDynamicAllPage.xaml + + UserDynamicPage.xaml @@ -743,9 +743,6 @@ RecommendPage.xaml - - UserDynamicPage.xaml - LiveDetailPage.xaml @@ -991,7 +988,7 @@ MSBuild:Compile Designer - + MSBuild:Compile Designer @@ -1147,10 +1144,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile diff --git a/src/BiliLite.UWP/Models/Common/Home/DefaultHomeNavItems.cs b/src/BiliLite.UWP/Models/Common/Home/DefaultHomeNavItems.cs index f48fa0b9..bf47bf1f 100644 --- a/src/BiliLite.UWP/Models/Common/Home/DefaultHomeNavItems.cs +++ b/src/BiliLite.UWP/Models/Common/Home/DefaultHomeNavItems.cs @@ -1,11 +1,15 @@ -using BiliLite.Services; +using System; +using BiliLite.Services; using System.Collections.Generic; using System.Linq; +using Newtonsoft.Json; namespace BiliLite.Models.Common.Home { public static class DefaultHomeNavItems { + private static readonly ILogger _logger = GlobalLogger.FromCurrentType(); + public static List CheckHomeNavItems(List navList) { var defaultItems = GetDefaultHomeNavItems(); @@ -21,6 +25,36 @@ public static List CheckHomeNavItems(List navList) return result; } + public static List GetHomeNavItems() + { + var homeNavItemList = new List(); + var tempHomeNavItemList = SettingService.GetValue>(SettingConstants.UI.HOEM_ORDER, + null); + + if (tempHomeNavItemList == null) + { + homeNavItemList = DefaultHomeNavItems.GetDefaultHomeNavItems(); + return homeNavItemList; + } + else + { + foreach (var item in tempHomeNavItemList) + { + try + { + var navItem = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(item)); + homeNavItemList.Add(navItem); + } + catch (Exception ex) + { + _logger.Warn(ex.Message, ex); + } + } + } + homeNavItemList = DefaultHomeNavItems.CheckHomeNavItems(homeNavItemList); + return homeNavItemList; + } + public static List GetDefaultHomeNavItems() { return new List() @@ -44,7 +78,7 @@ public static List GetDefaultHomeNavItems() new HomeNavItem() { Icon = FontAwesome5.EFontAwesomeIcon.Solid_Heart, - Page = typeof(Pages.Home.UserDynamicAllPage), + Page = typeof(Pages.Home.UserDynamicPage), Title = "动态", NeedLogin = true, Show = false @@ -161,14 +195,6 @@ public static List GetDefaultHideHomeNavItems() NeedLogin = true, Show = false }, - new HomeNavItem() - { - Icon = FontAwesome5.EFontAwesomeIcon.Solid_Heart, - Page = typeof(Pages.Home.UserDynamicPage), - Title = "动态(旧版)", - NeedLogin = true, - Show = false - }, }; } } diff --git a/src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml b/src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml deleted file mode 100644 index 6227087b..00000000 --- a/src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Collapsed - - - - - Visible - - - - - - - Collapsed - - - - - Visible - - - - - - - - - - - - - - - - - - Visible - - - - - Collapsed - - - - - - - Visible - - - - - Collapsed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 全部 - - - - - 投稿视频 - - - - - 追番追剧 - - - - - 专栏 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml.cs b/src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml.cs deleted file mode 100644 index 7d6ce0bf..00000000 --- a/src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using BiliLite.Services; -using BiliLite.Models.Common; -using BiliLite.Models.Requests.Api; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; -using BiliLite.Extensions; -using BiliLite.ViewModels.UserDynamic; -using Microsoft.Extensions.DependencyInjection; -using BiliLite.Models.Common.Comment; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media.Animation; - -// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板 - -namespace BiliLite.Pages.Home -{ - /// - /// 可用于自身或导航至 Frame 内部的空白页。 - /// - public sealed partial class UserDynamicAllPage : Page,IRefreshablePage - { - readonly UserDynamicAllViewModel m_viewModel; - private bool m_isStaggered = false; - private UserDynamicShowType m_currentShowType; - - public UserDynamicAllPage() - { - m_viewModel = App.ServiceProvider.GetRequiredService(); - m_viewModel.OpenCommentEvent += UserDynamicViewModelOpenCommentEvent; - this.InitializeComponent(); - m_currentShowType = (UserDynamicShowType)DynPivot.SelectedIndex; - } - - protected override async void OnNavigatedTo(NavigationEventArgs e) - { - base.OnNavigatedTo(e); - - SetStaggered(); - if (e.NavigationMode == NavigationMode.New && m_viewModel.DynamicItems == null) - { - await m_viewModel.GetDynamicItems(); - if (SettingService.GetValue("动态切换提示", true) && SettingService.GetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 0) != 1) - { - SettingService.SetValue("动态切换提示", false); - Notify.ShowMessageToast("右下角可以切换成瀑布流显示哦~", 5); - } - } - } - - private void SetStaggered() - { - var staggered = SettingService.GetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 0) == 1; - if (staggered != m_isStaggered) - { - m_isStaggered = staggered; - if (staggered) - { - SetGridCore(); - } - else - { - SetListCore(); - } - } - } - - private void SetGridCore() - { - m_isStaggered = true; - BtnGrid.Visibility = Visibility.Collapsed; - BtnList.Visibility = Visibility.Visible; - //XAML - ListDyn.ItemsPanel = (ItemsPanelTemplate)this.Resources["GridPanel"]; - - //顶部 - GridTopBar.MaxWidth = double.MaxValue; - GridTopBar.Margin = new Thickness(0, 0, 0, 4); - BorderTopBar.CornerRadius = new CornerRadius(0); - BorderTopBar.Margin = new Thickness(0); - } - - private void SetListCore() - { - m_isStaggered = false; - //右下角按钮 - BtnGrid.Visibility = Visibility.Visible; - BtnList.Visibility = Visibility.Collapsed; - //XAML - ListDyn.ItemsPanel = (ItemsPanelTemplate)this.Resources["ListPanel"]; - - //顶部 - GridTopBar.MaxWidth = 800; - GridTopBar.Margin = new Thickness(8, 0, 8, 0); - BorderTopBar.CornerRadius = new CornerRadius(4); - BorderTopBar.Margin = new Thickness(12, 4, 12, 4); - } - - private async void BtnRefreshDynamic_OnClick(object sender, RoutedEventArgs e) - { - await Refresh(); - } - - private void BtnTop_OnClick(object sender, RoutedEventArgs e) - { - ListDyn.ScrollIntoView(ListDyn.Items.FirstOrDefault()); - } - - private void BtnList_OnClick(object sender, RoutedEventArgs e) - { - SettingService.SetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 0); - SetListCore(); - } - - private void BtnGrid_OnClick(object sender, RoutedEventArgs e) - { - SettingService.SetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 1); - SetGridCore(); - } - - private async void Pivot_OnSelectionChanged(object sender, SelectionChangedEventArgs e) - { - var showType = (UserDynamicShowType)DynPivot.SelectedIndex; - if (showType == m_currentShowType) return; - m_currentShowType = showType; - await m_viewModel.GetDynamicItems(showType: showType); - } - - private void CloseCommentCore() - { - var storyboard = (Storyboard)this.Resources["HideComment"]; - storyboard.Begin(); - } - - private void UserDynamicViewModelOpenCommentEvent(object sender, DynamicV2ItemViewModel e) - { - CommentApi.CommentType commentType = CommentApi.CommentType.Dynamic; - var id = e.Extend.BusinessId; - switch (e.CardType) - { - case Constants.DynamicTypes.DRAW: - commentType = CommentApi.CommentType.Photo; - break; - case Constants.DynamicTypes.AV: - commentType = CommentApi.CommentType.Video; - break; - case Constants.DynamicTypes.PGC: - id = e.Dynamic.DynPgc.Aid.ToString(); - commentType = CommentApi.CommentType.Video; - break; - //case UserDynamicDisplayType.ShortVideo: - // commentType = CommentApi.CommentType.MiniVideo; - // break; - case Constants.DynamicTypes.MUSIC: - commentType = CommentApi.CommentType.Song; - break; - case Constants.DynamicTypes.ARTICLE: - commentType = CommentApi.CommentType.Article; - break; - //case UserDynamicDisplayType.MediaList: - // if (e.OneRowInfo.Tag != "收藏夹") - // commentType = CommentApi.CommentType.Video; - // break; - default: - id = e.Extend.DynIdStr; - break; - } - - OpenCommentCore(id, (int)commentType, CommentApi.CommentSort.Hot); - } - - private void OpenCommentCore(string oid, int commentMode, CommentApi.CommentSort commentSort) - { - Comment.LoadComment(new LoadCommentInfo() - { - CommentMode = commentMode, - CommentSort = commentSort, - Oid = oid, - IsDialog = true - }); - var storyboard = (Storyboard)this.Resources["ShowComment"]; - storyboard.Begin(); - } - - private void CommentPanel_OnTapped(object sender, TappedRoutedEventArgs e) - { - CloseCommentCore(); - } - - public async Task Refresh() - { - await m_viewModel.GetDynamicItems(showType: m_currentShowType); - } - } -} diff --git a/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml b/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml index cc8f093d..ec9ec508 100644 --- a/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml +++ b/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml @@ -15,7 +15,7 @@ - + - + + + - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + - - - + + diff --git a/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml.cs b/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml.cs index d7bffab0..5e307ec1 100644 --- a/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml.cs +++ b/src/BiliLite.UWP/Pages/Home/UserDynamicPage.xaml.cs @@ -1,13 +1,17 @@ -using BiliLite.Services; +using System.Linq; +using System.Threading.Tasks; +using BiliLite.Services; using BiliLite.Models.Common; using BiliLite.Models.Requests.Api; -using BiliLite.Models.Requests.Api.User; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; using BiliLite.Extensions; -using BiliLite.Models.Common.UserDynamic; using BiliLite.ViewModels.UserDynamic; +using Microsoft.Extensions.DependencyInjection; +using BiliLite.Models.Common.Comment; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media.Animation; // https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板 @@ -16,91 +20,28 @@ namespace BiliLite.Pages.Home /// /// 可用于自身或导航至 Frame 内部的空白页。 /// - public sealed partial class UserDynamicPage : Page + public sealed partial class UserDynamicPage : Page,IRefreshablePage { - readonly UserDynamicViewModel m_userDynamicViewModel; - private bool IsStaggered { get; set; } = false; + readonly UserDynamicAllViewModel m_viewModel; + private bool m_isStaggered = false; + private UserDynamicShowType m_currentShowType; + public UserDynamicPage() { + m_viewModel = App.ServiceProvider.GetRequiredService(); + m_viewModel.OpenCommentEvent += UserDynamicViewModelOpenCommentEvent; this.InitializeComponent(); - m_userDynamicViewModel = new UserDynamicViewModel(); - m_userDynamicViewModel.OpenCommentEvent += UserDynamicViewModelOpenCommentEvent; - splitView.PaneClosed += SplitView_PaneClosed; - this.DataContext = m_userDynamicViewModel; - if (SettingService.GetValue(SettingConstants.UI.CACHE_HOME, true)) - { - this.NavigationCacheMode = NavigationCacheMode.Enabled; - } - else - { - this.NavigationCacheMode = NavigationCacheMode.Disabled; - } + m_currentShowType = (UserDynamicShowType)DynPivot.SelectedIndex; } - private void SplitView_PaneClosed(SplitView sender, object args) - { - comment.ClearComment(); - repost.UserDynamicRepostViewModel.Clear(); - } - string dynamic_id; - private void UserDynamicViewModelOpenCommentEvent(object sender, UserDynamicItemDisplayViewModel e) - { - // splitView.IsPaneOpen = true; - dynamic_id = e.DynamicID; - pivotRight.SelectedIndex = 1; - repostCount.Text = e.ShareCount.ToString(); - commentCount.Text = e.CommentCount.ToString(); - CommentApi.CommentType commentType = CommentApi.CommentType.Dynamic; - var id = e.ReplyID; - switch (e.Type) - { - - case UserDynamicDisplayType.Photo: - commentType = CommentApi.CommentType.Photo; - break; - case UserDynamicDisplayType.Video: - - commentType = CommentApi.CommentType.Video; - break; - case UserDynamicDisplayType.Season: - id = e.OneRowInfo.AID; - commentType = CommentApi.CommentType.Video; - break; - case UserDynamicDisplayType.ShortVideo: - commentType = CommentApi.CommentType.MiniVideo; - break; - case UserDynamicDisplayType.Music: - commentType = CommentApi.CommentType.Song; - break; - case UserDynamicDisplayType.Article: - commentType = CommentApi.CommentType.Article; - break; - case UserDynamicDisplayType.MediaList: - if (e.OneRowInfo.Tag != "收藏夹") - commentType = CommentApi.CommentType.Video; - break; - default: - id = e.DynamicID; - break; - } - - //comment.LoadComment(new Controls.LoadCommentInfo() - //{ - // commentMode = (int)commentType, - // commentSort = Api.CommentApi.commentSort.Hot, - // oid = id - //}); - Notify.ShowComment(id, (int)commentType, CommentApi.CommentSort.Hot); - } - - protected async override void OnNavigatedTo(NavigationEventArgs e) + protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); SetStaggered(); - if (e.NavigationMode == NavigationMode.New && m_userDynamicViewModel.Items == null) + if (e.NavigationMode == NavigationMode.New && m_viewModel.DynamicItems == null) { - await m_userDynamicViewModel.GetDynamicItems(); + await m_viewModel.GetDynamicItems(); if (SettingService.GetValue("动态切换提示", true) && SettingService.GetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 0) != 1) { SettingService.SetValue("动态切换提示", false); @@ -109,89 +50,148 @@ protected async override void OnNavigatedTo(NavigationEventArgs e) } } - void SetStaggered() + private void SetStaggered() { var staggered = SettingService.GetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 0) == 1; - if (staggered != IsStaggered) + if (staggered != m_isStaggered) { - IsStaggered = staggered; + m_isStaggered = staggered; if (staggered) { - btnGrid_Click(this, null); + SetGridCore(); } else { - btnList_Click(this, null); + SetListCore(); } } } - private void pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) + private void SetGridCore() { - if ((int)m_userDynamicViewModel.UserDynamicType == pivot.SelectedIndex) return; - m_userDynamicViewModel.UserDynamicType = (UserDynamicType)pivot.SelectedIndex; - m_userDynamicViewModel.Refresh(); + m_isStaggered = true; + BtnGrid.Visibility = Visibility.Collapsed; + BtnList.Visibility = Visibility.Visible; + //XAML + ListDyn.ItemsPanel = (ItemsPanelTemplate)this.Resources["GridPanel"]; + + //顶部 + GridTopBar.MaxWidth = double.MaxValue; + GridTopBar.Margin = new Thickness(0, 0, 0, 4); + BorderTopBar.CornerRadius = new CornerRadius(0); + BorderTopBar.Margin = new Thickness(0); } - private void btnGrid_Click(object sender, RoutedEventArgs e) + private void SetListCore() { - SettingService.SetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 1); - IsStaggered = true; - btnGrid.Visibility = Visibility.Collapsed; - btnList.Visibility = Visibility.Visible; + m_isStaggered = false; + //右下角按钮 + BtnGrid.Visibility = Visibility.Visible; + BtnList.Visibility = Visibility.Collapsed; + //XAML + ListDyn.ItemsPanel = (ItemsPanelTemplate)this.Resources["ListPanel"]; + //顶部 - gridTopBar.MaxWidth = double.MaxValue; - gridTopBar.Margin = new Thickness(0, 0, 0, 4); - borderTopBar.CornerRadius = new CornerRadius(0); - borderTopBar.Margin = new Thickness(0); + GridTopBar.MaxWidth = 800; + GridTopBar.Margin = new Thickness(8, 0, 8, 0); + BorderTopBar.CornerRadius = new CornerRadius(4); + BorderTopBar.Margin = new Thickness(12, 4, 12, 4); + } - //XAML - // var tmp = @" "; - // var xaml = $@" - // {tmp} - // "; - //list.ItemsPanel = (ItemsPanelTemplate)XamlReader.Load(xaml); - list.ItemsPanel = (ItemsPanelTemplate)this.Resources["GridPanel"]; + private async void BtnRefreshDynamic_OnClick(object sender, RoutedEventArgs e) + { + await Refresh(); } - private void btnList_Click(object sender, RoutedEventArgs e) + private void BtnTop_OnClick(object sender, RoutedEventArgs e) + { + ListDyn.ScrollIntoView(ListDyn.Items.FirstOrDefault()); + } + + private void BtnList_OnClick(object sender, RoutedEventArgs e) { - IsStaggered = false; - //右下角按钮 - btnGrid.Visibility = Visibility.Visible; - btnList.Visibility = Visibility.Collapsed; - //设置 SettingService.SetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 0); - //顶部 - gridTopBar.MaxWidth = 800; - gridTopBar.Margin = new Thickness(8, 0, 8, 0); - borderTopBar.CornerRadius = new CornerRadius(4); - borderTopBar.Margin = new Thickness(12, 4, 12, 4); - //XAML - // var tmp = @" "; - // var xaml = $@" - // {tmp} - // "; - //list.ItemsPanel = (ItemsPanelTemplate)XamlReader.Load(xaml); - list.ItemsPanel = (ItemsPanelTemplate)this.Resources["ListPanel"]; + SetListCore(); } - private void btnTop_Click(object sender, RoutedEventArgs e) + private void BtnGrid_OnClick(object sender, RoutedEventArgs e) { - list.ScrollIntoView(list.Items[0]); + SettingService.SetValue(SettingConstants.UI.DYNAMIC_DISPLAY_MODE, 1); + SetGridCore(); } - private void pivotRight_SelectionChanged(object sender, SelectionChangedEventArgs e) + private async void Pivot_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { - if (pivotRight.SelectedIndex == 0 && splitView.IsPaneOpen && (repost.UserDynamicRepostViewModel.Items == null || repost.UserDynamicRepostViewModel.Items.Count == 0)) + var showType = (UserDynamicShowType)DynPivot.SelectedIndex; + if (showType == m_currentShowType) return; + m_currentShowType = showType; + await m_viewModel.GetDynamicItems(showType: showType); + } + + private void CloseCommentCore() + { + var storyboard = (Storyboard)this.Resources["HideComment"]; + storyboard.Begin(); + } + + private void UserDynamicViewModelOpenCommentEvent(object sender, DynamicV2ItemViewModel e) + { + CommentApi.CommentType commentType = CommentApi.CommentType.Dynamic; + var id = e.Extend.BusinessId; + switch (e.CardType) { - repost.LoadData(dynamic_id); + case Constants.DynamicTypes.DRAW: + commentType = CommentApi.CommentType.Photo; + break; + case Constants.DynamicTypes.AV: + commentType = CommentApi.CommentType.Video; + break; + case Constants.DynamicTypes.PGC: + id = e.Dynamic.DynPgc.Aid.ToString(); + commentType = CommentApi.CommentType.Video; + break; + //case UserDynamicDisplayType.ShortVideo: + // commentType = CommentApi.CommentType.MiniVideo; + // break; + case Constants.DynamicTypes.MUSIC: + commentType = CommentApi.CommentType.Song; + break; + case Constants.DynamicTypes.ARTICLE: + commentType = CommentApi.CommentType.Article; + break; + //case UserDynamicDisplayType.MediaList: + // if (e.OneRowInfo.Tag != "收藏夹") + // commentType = CommentApi.CommentType.Video; + // break; + default: + id = e.Extend.DynIdStr; + break; } + + OpenCommentCore(id, (int)commentType, CommentApi.CommentSort.Hot); + } + + private void OpenCommentCore(string oid, int commentMode, CommentApi.CommentSort commentSort) + { + Comment.LoadComment(new LoadCommentInfo() + { + CommentMode = commentMode, + CommentSort = commentSort, + Oid = oid, + IsDialog = true + }); + var storyboard = (Storyboard)this.Resources["ShowComment"]; + storyboard.Begin(); + } + + private void CommentPanel_OnTapped(object sender, TappedRoutedEventArgs e) + { + CloseCommentCore(); + } + + public async Task Refresh() + { + await m_viewModel.GetDynamicItems(showType: m_currentShowType); } } } diff --git a/src/BiliLite.UWP/ViewModels/Home/HomeViewModel.cs b/src/BiliLite.UWP/ViewModels/Home/HomeViewModel.cs index b7a8694f..9ab3e3f2 100644 --- a/src/BiliLite.UWP/ViewModels/Home/HomeViewModel.cs +++ b/src/BiliLite.UWP/ViewModels/Home/HomeViewModel.cs @@ -2,7 +2,6 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; -using BiliLite.Models.Common; using BiliLite.Models.Common.Home; using BiliLite.Modules; using BiliLite.Services; @@ -15,6 +14,7 @@ public class HomeViewModel : BaseViewModel { #region Fields + private static readonly ILogger _logger = GlobalLogger.FromCurrentType(); private readonly IMapper m_mapper; private readonly Account m_account; @@ -26,8 +26,7 @@ public HomeViewModel() { m_account = new Account(); m_mapper = App.ServiceProvider.GetRequiredService(); - var homeNavItemList = SettingService.GetValue(SettingConstants.UI.HOEM_ORDER, DefaultHomeNavItems.GetDefaultHomeNavItems()); - homeNavItemList = DefaultHomeNavItems.CheckHomeNavItems(homeNavItemList); + var homeNavItemList = DefaultHomeNavItems.GetHomeNavItems(); HomeNavItems = m_mapper.Map>(homeNavItemList); SelectItem = HomeNavItems.FirstOrDefault(); if (!SettingService.Account.Logined) return;