纠正用户关注和粉丝的对应英文

croire 2 years ago
parent 3eead3252e
commit 4b36040f39

@ -23,7 +23,9 @@ namespace DownKyi.Core.BiliApi.Users.Models
public string Face { get; set; } public string Face { get; set; }
[JsonProperty("sign")] [JsonProperty("sign")]
public string Sign { get; set; } public string Sign { get; set; }
// face_nft
// official_verify // official_verify
// vip // vip
// nft_icon
} }
} }

@ -1,8 +1,4 @@
using DownKyi.ViewModels.PageViewModels; using Prism.Events;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using System.Collections.ObjectModel;
namespace DownKyi.ViewModels.Friends namespace DownKyi.ViewModels.Friends
{ {
@ -12,76 +8,18 @@ namespace DownKyi.ViewModels.Friends
#region 页面属性申明 #region 页面属性申明
private ObservableCollection<TabHeader> tabHeaders;
public ObservableCollection<TabHeader> TabHeaders
{
get => tabHeaders;
set => SetProperty(ref tabHeaders, value);
}
private int selectTabId;
public int SelectTabId
{
get => selectTabId;
set => SetProperty(ref selectTabId, value);
}
#endregion #endregion
public ViewFollowerViewModel(IEventAggregator eventAggregator) : base(eventAggregator) public ViewFollowerViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
{ {
#region 属性初始化 #region 属性初始化
TabHeaders = new ObservableCollection<TabHeader>();
int i = TabHeaders.Count;
#endregion #endregion
} }
#region 命令申明 #region 命令申明
// 左侧tab点击事件
private DelegateCommand<object> leftTabHeadersCommand;
public DelegateCommand<object> LeftTabHeadersCommand => leftTabHeadersCommand ?? (leftTabHeadersCommand = new DelegateCommand<object>(ExecuteLeftTabHeadersCommand));
/// <summary>
/// 左侧tab点击事件
/// </summary>
/// <param name="parameter"></param>
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 #endregion
/// <summary>
/// 导航到页面时执行
/// </summary>
/// <param name="navigationContext"></param>
public override void OnNavigatedTo(NavigationContext navigationContext)
{
base.OnNavigatedTo(navigationContext);
// 进入设置页面时显示的设置项
SelectTabId = 0;
}
} }
} }

@ -1,9 +1,12 @@
using Prism.Events; using DownKyi.Core.BiliApi.Users;
using System; using DownKyi.Core.BiliApi.Users.Models;
using DownKyi.Utils;
using DownKyi.ViewModels.PageViewModels;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Collections.ObjectModel;
using System.Text;
using System.Threading.Tasks;
namespace DownKyi.ViewModels.Friends namespace DownKyi.ViewModels.Friends
{ {
@ -11,8 +14,88 @@ namespace DownKyi.ViewModels.Friends
{ {
public const string Tag = "PageFriendsFollowing"; public const string Tag = "PageFriendsFollowing";
#region 页面属性申明
private ObservableCollection<TabHeader> tabHeaders;
public ObservableCollection<TabHeader> TabHeaders
{
get => tabHeaders;
set => SetProperty(ref tabHeaders, value);
}
private int selectTabId;
public int SelectTabId
{
get => selectTabId;
set => SetProperty(ref selectTabId, value);
}
#endregion
public ViewFollowingViewModel(IEventAggregator eventAggregator) : base(eventAggregator) public ViewFollowingViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
{ {
#region 属性初始化
List<FollowingGroup> followingGroup = UserRelation.GetFollowingGroup();
TabHeaders = new ObservableCollection<TabHeader>()
{
//new TabHeader{Id = 0, Title = DictionaryResource.GetString("FriendFollowing") },
new TabHeader{Id = -1, Title = "全部关注" },
new TabHeader{Id = -2, Title = "悄悄关注" },
};
foreach (FollowingGroup tag in followingGroup)
{
TabHeaders.Add(new TabHeader { Id = tag.TagId, Title = tag.Name, SubTitle = tag.Count.ToString() });
}
#endregion
}
#region 命令申明
// 左侧tab点击事件
private DelegateCommand<object> leftTabHeadersCommand;
public DelegateCommand<object> LeftTabHeadersCommand => leftTabHeadersCommand ?? (leftTabHeadersCommand = new DelegateCommand<object>(ExecuteLeftTabHeadersCommand));
/// <summary>
/// 左侧tab点击事件
/// </summary>
/// <param name="parameter"></param>
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
/// <summary>
/// 导航到页面时执行
/// </summary>
/// <param name="navigationContext"></param>
public override void OnNavigatedTo(NavigationContext navigationContext)
{
base.OnNavigatedTo(navigationContext);
// 进入设置页面时显示的设置项
SelectTabId = 0;
} }
} }
} }

@ -117,10 +117,10 @@ namespace DownKyi.ViewModels
switch (id) switch (id)
{ {
case 0: case 0:
regionManager.RequestNavigate("FriendContentRegion", ViewFollowerViewModel.Tag, param); regionManager.RequestNavigate("FriendContentRegion", ViewFollowingViewModel.Tag, param);
break; break;
case 1: case 1:
regionManager.RequestNavigate("FriendContentRegion", ViewFollowingViewModel.Tag, param); regionManager.RequestNavigate("FriendContentRegion", ViewFollowerViewModel.Tag, param);
break; break;
} }
} }

@ -12,47 +12,6 @@
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <TextBlock Text="粉丝" />
<ColumnDefinition>
<ColumnDefinition.Style>
<Style TargetType="ColumnDefinition">
<Style.Triggers>
<DataTrigger Binding="{Binding TabHeaders}" Value="{x:Null}">
<Setter Property="Width" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabHeaders.Count}" Value="0">
<Setter Property="Width" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabHeaders.Count}" Value="1">
<Setter Property="Width" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabHeaders.Count, Converter={StaticResource CountConverter}}" Value="true">
<Setter Property="Width" Value="200" />
</DataTrigger>
</Style.Triggers>
</Style>
</ColumnDefinition.Style>
</ColumnDefinition>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- 左侧tab header -->
<ListBox
Name="nameLeftTabHeaders"
Grid.Column="0"
BorderThickness="0"
ItemContainerStyle="{StaticResource LeftTabHeaderItemStyle}"
ItemsSource="{Binding TabHeaders}"
SelectedIndex="{Binding SelectTabId}"
Style="{StaticResource LeftTabHeaderStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding LeftTabHeadersCommand}" CommandParameter="{Binding ElementName=nameLeftTabHeaders, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
<!-- 右侧内容区 -->
<ListBox Grid.Column="1" />
</Grid> </Grid>
</UserControl> </UserControl>

@ -2,13 +2,57 @@
x:Class="DownKyi.Views.Friends.ViewFollowing" x:Class="DownKyi.Views.Friends.ViewFollowing"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converter="clr-namespace:DownKyi.Converter"
xmlns:custom="clr-namespace:DownKyi.CustomControl" xmlns:custom="clr-namespace:DownKyi.CustomControl"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/" xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True"> prism:ViewModelLocator.AutoWireViewModel="True">
<UserControl.Resources /> <UserControl.Resources>
<converter:CountConverter x:Key="CountConverter" Count="1" />
</UserControl.Resources>
<Grid> <Grid>
<TextBlock Text="粉丝" /> <Grid.ColumnDefinitions>
<ColumnDefinition>
<ColumnDefinition.Style>
<Style TargetType="ColumnDefinition">
<Style.Triggers>
<DataTrigger Binding="{Binding TabHeaders}" Value="{x:Null}">
<Setter Property="Width" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabHeaders.Count}" Value="0">
<Setter Property="Width" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabHeaders.Count}" Value="1">
<Setter Property="Width" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabHeaders.Count, Converter={StaticResource CountConverter}}" Value="true">
<Setter Property="Width" Value="200" />
</DataTrigger>
</Style.Triggers>
</Style>
</ColumnDefinition.Style>
</ColumnDefinition>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- 左侧tab header -->
<ListBox
Name="nameLeftTabHeaders"
Grid.Column="0"
BorderThickness="0"
ItemContainerStyle="{StaticResource LeftTabHeaderItemStyle}"
ItemsSource="{Binding TabHeaders}"
SelectedIndex="{Binding SelectTabId}"
Style="{StaticResource LeftTabHeaderStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding LeftTabHeadersCommand}" CommandParameter="{Binding ElementName=nameLeftTabHeaders, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
<!-- 右侧内容区 -->
<ListBox Grid.Column="1" />
</Grid> </Grid>
</UserControl> </UserControl>

Loading…
Cancel
Save