diff --git a/DownKyi/ViewModels/Friend/ViewFollowerViewModel.cs b/DownKyi/ViewModels/Friend/ViewFollowerViewModel.cs index 964cb0d..2c377fb 100644 --- a/DownKyi/ViewModels/Friend/ViewFollowerViewModel.cs +++ b/DownKyi/ViewModels/Friend/ViewFollowerViewModel.cs @@ -1,9 +1,8 @@ -using Prism.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using DownKyi.ViewModels.PageViewModels; +using Prism.Commands; +using Prism.Events; +using Prism.Regions; +using System.Collections.ObjectModel; namespace DownKyi.ViewModels.Friend { @@ -11,8 +10,78 @@ namespace DownKyi.ViewModels.Friend { public const string Tag = "PageFriendFollower"; + #region 页面属性申明 + + private ObservableCollection tabHeaders; + public ObservableCollection TabHeaders + { + get => tabHeaders; + set => SetProperty(ref tabHeaders, value); + } + + private int selectTabId; + public int SelectTabId + { + get => selectTabId; + set => SetProperty(ref selectTabId, value); + } + + #endregion + public ViewFollowerViewModel(IEventAggregator eventAggregator) : base(eventAggregator) { + #region 属性初始化 + TabHeaders = new ObservableCollection(); + + int i = TabHeaders.Count; + + #endregion + } + + #region 命令申明 + + // 左侧tab点击事件 + private DelegateCommand leftTabHeadersCommand; + public DelegateCommand LeftTabHeadersCommand => leftTabHeadersCommand ?? (leftTabHeadersCommand = new DelegateCommand(ExecuteLeftTabHeadersCommand)); + + /// + /// 左侧tab点击事件 + /// + /// + private void ExecuteLeftTabHeadersCommand(object parameter) + { + if (!(parameter is TabHeader tabHeader)) { return; } + + //NavigationParameters param = new NavigationParameters(); + + //switch (tabHeader.Id) + //{ + // case 0: + // regionManager.RequestNavigate("ToolboxContentRegion", ViewBiliHelperViewModel.Tag, param); + // break; + // case 1: + // regionManager.RequestNavigate("ToolboxContentRegion", ViewDelogoViewModel.Tag, param); + // break; + // case 2: + // regionManager.RequestNavigate("ToolboxContentRegion", ViewExtractMediaViewModel.Tag, param); + // break; + //} + } + + #endregion + + /// + /// 导航到页面时执行 + /// + /// + public override void OnNavigatedTo(NavigationContext navigationContext) + { + base.OnNavigatedTo(navigationContext); + + // 进入设置页面时显示的设置项 + SelectTabId = 0; + } + } } diff --git a/DownKyi/Views/Friend/ViewFollower.xaml b/DownKyi/Views/Friend/ViewFollower.xaml index 4419847..ded640c 100644 --- a/DownKyi/Views/Friend/ViewFollower.xaml +++ b/DownKyi/Views/Friend/ViewFollower.xaml @@ -2,13 +2,57 @@ x:Class="DownKyi.Views.Friend.ViewFollower" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converter="clr-namespace:DownKyi.Converter" xmlns:custom="clr-namespace:DownKyi.CustomControl" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:prism="http://prismlibrary.com/" prism:ViewModelLocator.AutoWireViewModel="True"> - + + + - + + + + + + + + + + + + + + + + + + + + diff --git a/DownKyi/Views/ViewFriend.xaml b/DownKyi/Views/ViewFriend.xaml index 40ad395..abfdf23 100644 --- a/DownKyi/Views/ViewFriend.xaml +++ b/DownKyi/Views/ViewFriend.xaml @@ -51,7 +51,6 @@ Name="nameTabHeaders" Grid.Column="1" BorderThickness="0" - IsEnabled="{Binding IsEnabled}" ItemsSource="{Binding TabHeaders}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled"