完成UserSpace页面

croire 3 years ago
parent c2351ae21b
commit 8f6553d401

File diff suppressed because one or more lines are too long

@ -315,7 +315,11 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Page Include="BiliApi\Zone\ZoneImage.xaml">
<Page Include="BiliApi\BilibiliImages.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="BiliApi\Zone\ZoneImages.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>

@ -42,6 +42,8 @@ namespace DownKyi.Core.Storage
/// <returns></returns>
public BitmapImage GetCoverThumbnail(string cover, int width, int height)
{
if (cover == null) { return null; }
Bitmap bitmap = new Bitmap(cover);
Image thumbnail = bitmap.GetThumbnailImage(width, height, null, IntPtr.Zero);

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31019.35
# Visual Studio Version 17
VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DownKyi", "DownKyi\DownKyi.csproj", "{97075FCD-6E8F-4FF9-B73A-994197F3765A}"
ProjectSection(ProjectDependencies) = postProject

@ -9,7 +9,8 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/ThemeDefault.xaml" />
<ResourceDictionary Source="Languages/Default.xaml" />
<ResourceDictionary Source="pack://application:,,,/DownKyi.Core;component/BiliApi/Zone/ZoneImage.xaml" />
<ResourceDictionary Source="pack://application:,,,/DownKyi.Core;component/BiliApi/Zone/ZoneImages.xaml" />
<ResourceDictionary Source="pack://application:,,,/DownKyi.Core;component/BiliApi/BilibiliImages.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

@ -6,11 +6,13 @@ using DownKyi.ViewModels.Dialogs;
using DownKyi.ViewModels.DownloadManager;
using DownKyi.ViewModels.Settings;
using DownKyi.ViewModels.Toolbox;
using DownKyi.ViewModels.UserSpace;
using DownKyi.Views;
using DownKyi.Views.Dialogs;
using DownKyi.Views.DownloadManager;
using DownKyi.Views.Settings;
using DownKyi.Views.Toolbox;
using DownKyi.Views.UserSpace;
using Prism.Ioc;
using System;
using System.Collections.Generic;
@ -179,6 +181,10 @@ namespace DownKyi
containerRegistry.RegisterForNavigation<ViewDelogo>(ViewDelogoViewModel.Tag);
containerRegistry.RegisterForNavigation<ViewExtractMedia>(ViewExtractMediaViewModel.Tag);
// UserSpace
containerRegistry.RegisterForNavigation<ViewArchive>(ViewArchiveViewModel.Tag);
containerRegistry.RegisterForNavigation<ViewChannel>(ViewChannelViewModel.Tag);
// dialogs
containerRegistry.RegisterDialog<ViewDownloadSetter>(ViewDownloadSetterViewModel.Tag);
containerRegistry.RegisterDialog<ViewParsingSelector>(ViewParsingSelectorViewModel.Tag);

@ -132,6 +132,12 @@
<Compile Include="ViewModels\DownloadManager\ViewDownloadingViewModel.cs" />
<Compile Include="ViewModels\Toolbox\ViewBiliHelperViewModel.cs" />
<Compile Include="ViewModels\Toolbox\ViewDelogoViewModel.cs" />
<Compile Include="ViewModels\UserSpace\Channel.cs" />
<Compile Include="ViewModels\UserSpace\PublicationZone.cs" />
<Compile Include="ViewModels\UserSpace\ViewChannelViewModel.cs" />
<Compile Include="ViewModels\UserSpace\ViewArchiveViewModel.cs" />
<Compile Include="ViewModels\UserSpace\TabLeftBanner.cs" />
<Compile Include="ViewModels\UserSpace\TabRightBanner.cs" />
<Compile Include="ViewModels\ViewDownloadManagerViewModel.cs" />
<Compile Include="ViewModels\Toolbox\ViewExtractMediaViewModel.cs" />
<Compile Include="ViewModels\ViewIndexViewModel.cs" />
@ -184,6 +190,12 @@
<Compile Include="Views\Toolbox\ViewExtractMedia.xaml.cs">
<DependentUpon>ViewExtractMedia.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserSpace\ViewArchive.xaml.cs">
<DependentUpon>ViewArchive.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UserSpace\ViewChannel.xaml.cs">
<DependentUpon>ViewChannel.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ViewDownloadManager.xaml.cs">
<DependentUpon>ViewDownloadManager.xaml</DependentUpon>
</Compile>
@ -343,6 +355,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserSpace\ViewArchive.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UserSpace\ViewChannel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ViewDownloadManager.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -475,6 +495,8 @@
<Resource Include="Resources\level\lv7.png" />
<Resource Include="Resources\level\lv8.png" />
<Resource Include="Resources\level\lv9.png" />
<Resource Include="Resources\video-placeholder.png" />
<Resource Include="Resources\channel.png" />
<Content Include="打不开DownKyi请点我.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

@ -239,6 +239,33 @@
l-85 0 l0 341 l341 0 l0 -85 l-256 0 l0 -256 Z",
Fill = "#FF000000"
};
VideoUp = new VectorImage
{
Height = 24,
Width = 24,
Data = @"M711,212.3l47-47c41.7-47.6-25-112.2-72-71l-107,106c-3.3,3.3-6,7-8,11H454c-1.3-2.7-3.3-5-6-7l-112-111
c-21.3-17.3-51-17-71,3s-20.3,49.7-3,71l45,44H198c-56.7,0-105,48.3-105,105v417c0,56.7,48.3,105,105,105h57
c-17.9,49.6,19.9,105,73.5,105c55.4,0,90.4-55.3,74.5-105h218c-15.9,49.7,19.1,105,74.5,105c53.6,0,91.4-55.4,73.5-105h57
c56.7,0,105-48.3,105-105v-417c0-57.6-48.3-104-105-104H711L711,212.3z",
Fill = "#FF000000"
};
Channel = new VectorImage
{
Height = 24,
Width = 24,
Data = @"M921.6 211.41 q1.1 -6.61 7.15 -10.47 q6.05 -3.85 12.66 -0.54 q38.54 19.82 60.56 56.16
q22.02 36.33 22.02 80.38 l0 329.22 q-1.1 64.96 -44.6 108.46 q-43.5 43.5 -108.45 44.6
l-483.37 0 q-44.04 0 -80.38 -22.02 q-36.34 -22.02 -56.15 -61.66 q-3.31 -5.51 0.54 -11.57
q3.85 -6.05 10.47 -7.15 l557.14 0 q44.04 -1.1 72.67 -29.73 q28.63 -28.63 29.73 -72.67
l0 -402.99 ZM102.4 0 l666.15 0 q41.84 0 71.57 29.73 q29.73 29.73 30.83 72.67 l0 461.35
q-1.1 41.84 -30.83 71.57 q-29.73 29.73 -71.57 30.83 l-666.15 0 q-42.94 -1.1 -72.67 -30.83
q-29.73 -29.73 -29.73 -71.57 l0 -461.35 q0 -42.94 29.73 -72.67 q29.73 -29.73 72.67 -29.73
ZM559.35 353.45 q9.91 -7.71 9.91 -20.93 q0 -13.21 -9.91 -20.92 l-186.09 -129.92 q-13.21 -8.81 -26.42 -1.66
q-13.21 7.16 -14.32 22.57 l0 259.85 q1.11 15.42 14.32 22.57 q13.21 7.16 26.42 -1.65 l186.09 -129.92 Z",
Fill = "#FF000000"
};
}
public VectorImage Play { get; private set; }
@ -260,5 +287,8 @@
public VectorImage Subscription { get; private set; }
public VectorImage ToView { get; private set; }
public VectorImage History { get; private set; }
public VectorImage VideoUp { get; private set; }
public VectorImage Channel { get; private set; }
}
}

@ -51,6 +51,19 @@
<system:String x:Key="Normal">正常</system:String>
<system:String x:Key="Ban">封停</system:String>
<!-- UserSpace -->
<system:String x:Key="UserSpace">个人空间</system:String>
<system:String x:Key="Followed">已关注</system:String>
<system:String x:Key="NotFollowed">未关注</system:String>
<system:String x:Key="FollowingCount">关注数</system:String>
<system:String x:Key="FollowerCount">粉丝数</system:String>
<system:String x:Key="LikesCount">获赞数</system:String>
<system:String x:Key="ArchiveViewCount">播放数</system:String>
<system:String x:Key="ArticleViewCount">阅读数</system:String>
<system:String x:Key="AllPublicationZones">全部</system:String>
<system:String x:Key="Publication">投稿视频</system:String>
<system:String x:Key="Channel">频道</system:String>
<!-- VideoDetail -->
<system:String x:Key="CopyCover">复制封面图片</system:String>
<system:String x:Key="CopyCoverUrl">复制封面URL</system:String>

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -43,19 +43,21 @@
<SolidColorBrush x:Key="BrushBorder" Color="{DynamicResource ColorBorder}" />
<SolidColorBrush x:Key="BrushBorderTranslucent" Color="{DynamicResource ColorBorderTranslucent}" />
<SolidColorBrush x:Key="BrushProgressTrack" Color="{DynamicResource ColorProgressTrack}" />
<SolidColorBrush x:Key="BrushProgressIndicator" Color="{DynamicResource ColorProgressIndicator}" />
<SolidColorBrush x:Key="BrushBorderTranslucent100" Color="{DynamicResource ColorBorderTranslucent100}" />
<SolidColorBrush x:Key="BrushImageBorder" Color="{DynamicResource ColorImageBorder}" />
<SolidColorBrush x:Key="BrushImageBorder2" Color="{DynamicResource ColorImageBorder2}" />
<SolidColorBrush x:Key="BrushImageBackground" Color="{DynamicResource ColorImageBackground}" />
<SolidColorBrush x:Key="BrushProgressTrack" Color="{DynamicResource ColorProgressTrack}" />
<SolidColorBrush x:Key="BrushProgressIndicator" Color="{DynamicResource ColorProgressIndicator}" />
<SolidColorBrush x:Key="BrushText" Color="{DynamicResource ColorText}" />
<SolidColorBrush x:Key="BrushTextDark" Color="{DynamicResource ColorTextDark}" />
<SolidColorBrush x:Key="BrushTextGrey" Color="{DynamicResource ColorTextGrey}" />
<SolidColorBrush x:Key="BrushTextGrey2" Color="{DynamicResource ColorTextGrey2}" />
<SolidColorBrush x:Key="BrushMoney" Color="{DynamicResource ColorMoney}" />
<SolidColorBrush x:Key="BrushPublication" Color="{DynamicResource ColorPublication}" />
</ResourceDictionary>

@ -43,19 +43,21 @@
<Color x:Key="ColorBorder">#FF999999</Color>
<Color x:Key="ColorBorderTranslucent">#7F999999</Color>
<Color x:Key="ColorProgressTrack">#FFE4E4E4</Color>
<Color x:Key="ColorProgressIndicator">#FFF3CB85</Color>
<Color x:Key="ColorBorderTranslucent100">#99000000</Color>
<Color x:Key="ColorImageBorder">#7FD0D0D0</Color>
<Color x:Key="ColorImageBorder2">#7FFFFFFF</Color>
<Color x:Key="ColorImageBackground">#7FD0D0D0</Color>
<Color x:Key="ColorProgressTrack">#FFE4E4E4</Color>
<Color x:Key="ColorProgressIndicator">#FFF3CB85</Color>
<Color x:Key="ColorText">white</Color>
<Color x:Key="ColorTextDark">black</Color>
<Color x:Key="ColorTextGrey">#FF999999</Color>
<Color x:Key="ColorTextGrey2">#FF757575</Color>
<Color x:Key="ColorMoney">#FFFFAE00</Color>
<Color x:Key="ColorPublication">#FF02B5DA</Color>
</ResourceDictionary>

@ -0,0 +1,39 @@
using Prism.Mvvm;
using System.Windows.Media;
namespace DownKyi.ViewModels.UserSpace
{
public class Channel : BindableBase
{
public long Cid { get; set; }
private ImageSource cover;
public ImageSource Cover
{
get => cover;
set => SetProperty(ref cover, value);
}
private string name;
public string Name
{
get => name;
set => SetProperty(ref name, value);
}
private int count;
public int Count
{
get => count;
set => SetProperty(ref count, value);
}
private string ctime;
public string Ctime
{
get => ctime;
set => SetProperty(ref ctime, value);
}
}
}

@ -0,0 +1,31 @@
using Prism.Mvvm;
using System.Windows.Media;
namespace DownKyi.ViewModels.UserSpace
{
public class PublicationZone : BindableBase
{
public int Tid { get; set; }
private DrawingImage icon;
public DrawingImage Icon
{
get => icon;
set => SetProperty(ref icon, value);
}
private string name;
public string Name
{
get => name;
set => SetProperty(ref name, value);
}
private int count;
public int Count
{
get => count;
set => SetProperty(ref count, value);
}
}
}

@ -0,0 +1,41 @@
using DownKyi.Images;
using Prism.Mvvm;
namespace DownKyi.ViewModels.UserSpace
{
public class TabLeftBanner : BindableBase
{
public object Object { get; set; }
public int Id { get; set; }
private bool isSelected;
public bool IsSelected
{
get => isSelected;
set => SetProperty(ref isSelected, value);
}
private VectorImage icon;
public VectorImage Icon
{
get => icon;
set => SetProperty(ref icon, value);
}
private string iconColor;
public string IconColor
{
get => iconColor;
set => SetProperty(ref iconColor, value);
}
private string title;
public string Title
{
get => title;
set => SetProperty(ref title, value);
}
}
}

@ -0,0 +1,43 @@
using Prism.Mvvm;
namespace DownKyi.ViewModels.UserSpace
{
public class TabRightBanner : BindableBase
{
private bool isEnabled;
public bool IsEnabled
{
get => isEnabled;
set => SetProperty(ref isEnabled, value);
}
private string labelColor;
public string LabelColor
{
get => labelColor;
set => SetProperty(ref labelColor, value);
}
private string countColor;
public string CountColor
{
get => countColor;
set => SetProperty(ref countColor, value);
}
private string label;
public string Label
{
get => label;
set => SetProperty(ref label, value);
}
private string count;
public string Count
{
get => count;
set => SetProperty(ref count, value);
}
}
}

@ -0,0 +1,89 @@
using DownKyi.Core.BiliApi.Users.Models;
using DownKyi.Core.BiliApi.Zone;
using DownKyi.Utils;
using Prism.Events;
using Prism.Regions;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Media;
namespace DownKyi.ViewModels.UserSpace
{
public class ViewArchiveViewModel : BaseViewModel
{
public const string Tag = "ArchiveView";
#region 页面属性申明
private ObservableCollection<PublicationZone> publicationZones;
public ObservableCollection<PublicationZone> PublicationZones
{
get => publicationZones;
set => SetProperty(ref publicationZones, value);
}
#endregion
public ViewArchiveViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
{
#region 属性初始化
PublicationZones = new ObservableCollection<PublicationZone>();
#endregion
}
#region 命令申明
#endregion
public override void OnNavigatedFrom(NavigationContext navigationContext)
{
base.OnNavigatedFrom(navigationContext);
PublicationZones.Clear();
}
/// <summary>
/// 接收mid参数
/// </summary>
/// <param name="navigationContext"></param>
public override void OnNavigatedTo(NavigationContext navigationContext)
{
base.OnNavigatedTo(navigationContext);
PublicationZones.Clear();
// 根据传入参数不同执行不同任务
var parameter = navigationContext.Parameters.GetValue<List<SpacePublicationListTypeVideoZone>>("object");
if (parameter == null)
{
return;
}
int VideoCount = 0;
foreach (var zone in parameter)
{
VideoCount += zone.Count;
string iconKey = VideoZoneIcon.Instance().GetZoneImageKey(zone.Tid);
publicationZones.Add(new PublicationZone
{
Tid = zone.Tid,
Icon = (DrawingImage)Application.Current.Resources[iconKey],
Name = zone.Name,
Count = zone.Count
});
}
// 全部
publicationZones.Insert(0, new PublicationZone
{
Tid = 0,
Icon = (DrawingImage)Application.Current.Resources["videoUpDrawingImage"],
Name = DictionaryResource.GetString("AllPublicationZones"),
Count = VideoCount
});
}
}
}

@ -0,0 +1,101 @@
using DownKyi.Core.BiliApi.Users.Models;
using DownKyi.Core.Storage;
using Prism.Events;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
namespace DownKyi.ViewModels.UserSpace
{
public class ViewChannelViewModel : BaseViewModel
{
public const string Tag = "Channel";
#region 页面属性申明
private ObservableCollection<Channel> channels;
public ObservableCollection<Channel> Channels
{
get => channels;
set => SetProperty(ref channels, value);
}
#endregion
public ViewChannelViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
{
#region 属性初始化
Channels = new ObservableCollection<Channel>();
#endregion
}
#region 命令申明
#endregion
public override void OnNavigatedFrom(NavigationContext navigationContext)
{
base.OnNavigatedFrom(navigationContext);
Channels.Clear();
}
/// <summary>
/// 接收mid参数
/// </summary>
/// <param name="navigationContext"></param>
public async override void OnNavigatedTo(NavigationContext navigationContext)
{
base.OnNavigatedTo(navigationContext);
Channels.Clear();
// 根据传入参数不同执行不同任务
var parameter = navigationContext.Parameters.GetValue<List<SpaceChannelList>>("object");
if (parameter == null)
{
return;
}
foreach (var channel in parameter)
{
if (channel.Count <= 0) { continue; }
BitmapImage image = null;
if (channel.Cover == null || channel.Cover == "")
{
image = new BitmapImage(new Uri($"pack://application:,,,/Resources/video-placeholder.png"));
}
else
{
StorageCover storageCover = new StorageCover();
string cover = null;
await Task.Run(() =>
{
cover = storageCover.GetCover(channel.Cover);
});
image = storageCover.GetCoverThumbnail(cover, 190, 190);
}
// 当地时区
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
DateTime dateCTime = startTime.AddSeconds(channel.Mtime);
string mtime = dateCTime.ToString("yyyy-MM-dd");
Channels.Add(new Channel
{
Cid = channel.Cid,
Cover = image,
Name = channel.Name,
Count = channel.Count,
Ctime = mtime
});
}
}
}
}

@ -423,9 +423,8 @@ namespace DownKyi.ViewModels
await Task.Run(() =>
{
// 背景图片
SpaceSettings spaceSettings = UserSpace.GetSpaceSettings(mid);
SpaceSettings spaceSettings = Core.BiliApi.Users.UserSpace.GetSpaceSettings(mid);
if (spaceSettings != null)
{
StorageCover storageCover = new StorageCover();
@ -506,9 +505,9 @@ namespace DownKyi.ViewModels
// 没有数据
isNoData = true;
}
});
// 是否获取到数据
if (isNoData)
{
TopNavigationBg = "#00FFFFFF"; // 透明

@ -1,10 +1,21 @@
using Prism.Commands;
using DownKyi.Core.BiliApi.Users;
using DownKyi.Core.BiliApi.Users.Models;
using DownKyi.Core.Storage;
using DownKyi.Core.Utils;
using DownKyi.CustomControl;
using DownKyi.Events;
using DownKyi.Images;
using DownKyi.Utils;
using DownKyi.ViewModels.UserSpace;
using Prism.Commands;
using Prism.Events;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
namespace DownKyi.ViewModels
{
@ -12,11 +23,460 @@ namespace DownKyi.ViewModels
{
public const string Tag = "PageUserSpace";
private readonly IRegionManager regionManager;
// mid
private long mid;
private long mid = -1;
#region 页面属性申明
private VectorImage arrowBack;
public VectorImage ArrowBack
{
get => arrowBack;
set => SetProperty(ref arrowBack, value);
}
private GifImage loading;
public GifImage Loading
{
get => loading;
set => SetProperty(ref loading, value);
}
private Visibility noDataVisibility;
public Visibility NoDataVisibility
{
get => noDataVisibility;
set => SetProperty(ref noDataVisibility, value);
}
private Visibility loadingVisibility;
public Visibility LoadingVisibility
{
get => loadingVisibility;
set => SetProperty(ref loadingVisibility, value);
}
private Visibility viewVisibility;
public Visibility ViewVisibility
{
get => viewVisibility;
set => SetProperty(ref viewVisibility, value);
}
private Visibility contentVisibility;
public Visibility ContentVisibility
{
get => contentVisibility;
set => SetProperty(ref contentVisibility, value);
}
private string topNavigationBg;
public string TopNavigationBg
{
get => topNavigationBg;
set => SetProperty(ref topNavigationBg, value);
}
private BitmapImage background;
public BitmapImage Background
{
get => background;
set => SetProperty(ref background, value);
}
private BitmapImage header;
public BitmapImage Header
{
get => header;
set => SetProperty(ref header, value);
}
private string userName;
public string UserName
{
get => userName;
set => SetProperty(ref userName, value);
}
private BitmapImage sex;
public BitmapImage Sex
{
get => sex;
set => SetProperty(ref sex, value);
}
private BitmapImage level;
public BitmapImage Level
{
get => level;
set => SetProperty(ref level, value);
}
private Visibility vipTypeVisibility;
public Visibility VipTypeVisibility
{
get => vipTypeVisibility;
set => SetProperty(ref vipTypeVisibility, value);
}
public ViewUserSpaceViewModel(IEventAggregator eventAggregator) : base(eventAggregator)
private string vipType;
public string VipType
{
get => vipType;
set => SetProperty(ref vipType, value);
}
private string sign;
public string Sign
{
get => sign;
set => SetProperty(ref sign, value);
}
private string isFollowed;
public string IsFollowed
{
get => isFollowed;
set => SetProperty(ref isFollowed, value);
}
private ObservableCollection<TabLeftBanner> tabLeftBanners;
public ObservableCollection<TabLeftBanner> TabLeftBanners
{
get => tabLeftBanners;
set => SetProperty(ref tabLeftBanners, value);
}
private ObservableCollection<TabRightBanner> tabRightBanners;
public ObservableCollection<TabRightBanner> TabRightBanners
{
get => tabRightBanners;
set => SetProperty(ref tabRightBanners, value);
}
#endregion
public ViewUserSpaceViewModel(IRegionManager regionManager, IEventAggregator eventAggregator) : base(eventAggregator)
{
this.regionManager = regionManager;
#region 属性初始化
// 返回按钮
ArrowBack = NavigationIcon.Instance().ArrowBack;
ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
// 初始化loading gif
Loading = new GifImage(Properties.Resources.loading);
Loading.StartAnimate();
TopNavigationBg = "#00FFFFFF"; // 透明
TabLeftBanners = new ObservableCollection<TabLeftBanner>();
TabRightBanners = new ObservableCollection<TabRightBanner>();
#endregion
}
#region 命令申明
// 返回事件
private DelegateCommand backSpaceCommand;
public DelegateCommand BackSpaceCommand => backSpaceCommand ?? (backSpaceCommand = new DelegateCommand(ExecuteBackSpace));
/// <summary>
/// 返回事件
/// </summary>
private void ExecuteBackSpace()
{
NavigationParam parameter = new NavigationParam
{
ViewName = ParentView,
ParentViewName = null,
Parameter = null
};
eventAggregator.GetEvent<NavigationEvent>().Publish(parameter);
}
// 左侧tab点击事件
private DelegateCommand<object> tabLeftBannersCommand;
public DelegateCommand<object> TabLeftBannersCommand => tabLeftBannersCommand ?? (tabLeftBannersCommand = new DelegateCommand<object>(ExecuteTabLeftBannersCommand));
/// <summary>
/// 左侧tab点击事件
/// </summary>
/// <param name="parameter"></param>
private void ExecuteTabLeftBannersCommand(object parameter)
{
if (!(parameter is TabLeftBanner banner)) { return; }
NavigationParameters param = new NavigationParameters()
{
{ "object", banner.Object },
};
switch (banner.Id)
{
case 0:
regionManager.RequestNavigate("UserSpaceContentRegion", ViewArchiveViewModel.Tag, param);
break;
case 1:
regionManager.RequestNavigate("UserSpaceContentRegion", ViewChannelViewModel.Tag, param);
break;
}
}
#endregion
/// <summary>
/// 初始化页面
/// </summary>
private void InitView()
{
TopNavigationBg = "#00FFFFFF"; // 透明
ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
Background = null;
Header = null;
UserName = "";
Sex = null;
Level = null;
VipTypeVisibility = Visibility.Collapsed;
VipType = "";
Sign = "";
TabLeftBanners.Clear();
TabRightBanners.Clear();
// 将内容置空,使其不指向任何页面
regionManager.RequestNavigate("UserSpaceContentRegion", "");
ContentVisibility = Visibility.Collapsed;
ViewVisibility = Visibility.Collapsed;
LoadingVisibility = Visibility.Visible;
NoDataVisibility = Visibility.Collapsed;
}
/// <summary>
/// 更新用户信息
/// </summary>
private async void UpdateSpaceInfo()
{
bool isNoData = true;
Uri toutuUri = null;
string headerUri = null;
Uri sexUri = null;
Uri levelUri = null;
await Task.Run(() =>
{
// 背景图片
SpaceSettings spaceSettings = Core.BiliApi.Users.UserSpace.GetSpaceSettings(mid);
if (spaceSettings != null)
{
StorageCover storageCover = new StorageCover();
string toutu = storageCover.GetCover($"https://i0.hdslb.com/{spaceSettings.Toutu.Limg}");
toutuUri = new Uri(toutu);
}
else
{
toutuUri = new Uri("pack://application:,,,/Resources/backgound/9-绿荫秘境.png");
}
// 用户信息
UserInfoForSpace userInfo = UserInfo.GetUserInfoForSpace(mid);
if (userInfo != null)
{
isNoData = false;
// 头像
StorageHeader storageHeader = new StorageHeader();
headerUri = storageHeader.GetHeader(mid, userInfo.Name, userInfo.Face);
// 用户名
UserName = userInfo.Name;
// 性别
if (userInfo.Sex == "男")
{
sexUri = new Uri($"pack://application:,,,/Resources/sex/male.png");
}
else if (userInfo.Sex == "女")
{
sexUri = new Uri($"pack://application:,,,/Resources/sex/female.png");
}
// 显示vip信息
if (userInfo.Vip.Label.Text == null || userInfo.Vip.Label.Text == "")
{
VipTypeVisibility = Visibility.Collapsed;
}
else
{
VipTypeVisibility = Visibility.Visible;
VipType = userInfo.Vip.Label.Text;
}
// 等级
levelUri = new Uri($"pack://application:,,,/Resources/level/lv{userInfo.Level}.png");
// 签名
Sign = userInfo.Sign;
// 是否关注此UP
IsFollowed = userInfo.IsFollowed ?
DictionaryResource.GetString("Followed") : DictionaryResource.GetString("NotFollowed");
}
else
{
// 没有数据
isNoData = true;
}
});
// 是否获取到数据
if (isNoData)
{
TopNavigationBg = "#00FFFFFF"; // 透明
ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
Background = null;
ViewVisibility = Visibility.Collapsed;
LoadingVisibility = Visibility.Collapsed;
NoDataVisibility = Visibility.Visible;
return;
}
else
{
// 头像
StorageHeader storageHeader = new StorageHeader();
Header = storageHeader.GetHeaderThumbnail(headerUri, 64, 64);
// 性别
Sex = sexUri == null ? null : new BitmapImage(sexUri);
// 等级
Level = new BitmapImage(levelUri);
ArrowBack.Fill = DictionaryResource.GetColor("ColorText");
TopNavigationBg = DictionaryResource.GetColor("ColorMask100");
Background = new BitmapImage(toutuUri);
ViewVisibility = Visibility.Visible;
LoadingVisibility = Visibility.Collapsed;
NoDataVisibility = Visibility.Collapsed;
}
ContentVisibility = Visibility.Visible;
// 投稿视频
List<SpacePublicationListTypeVideoZone> publicationTypes = null;
await Task.Run(() =>
{
publicationTypes = Core.BiliApi.Users.UserSpace.GetPublicationType(mid);
});
if (publicationTypes != null && publicationTypes.Count > 0)
{
TabLeftBanners.Add(new TabLeftBanner
{
Object = publicationTypes,
Id = 0,
Icon = NormalIcon.Instance().VideoUp,
IconColor = "#FF02B5DA",
Title = DictionaryResource.GetString("Publication"),
IsSelected = true
});
}
// 频道
List<SpaceChannelList> channelList = null;
await Task.Run(() =>
{
channelList = Core.BiliApi.Users.UserSpace.GetChannelList(mid);
});
if (channelList != null && channelList.Count > 0)
{
TabLeftBanners.Add(new TabLeftBanner
{
Object = channelList,
Id = 1,
Icon = NormalIcon.Instance().Channel,
IconColor = "#FF23C9ED",
Title = DictionaryResource.GetString("Channel")
});
}
// 收藏夹
// 订阅
// 关系状态数
UserRelationStat relationStat = null;
await Task.Run(() =>
{
relationStat = UserStatus.GetUserRelationStat(mid);
});
if (relationStat != null)
{
TabRightBanners.Add(new TabRightBanner
{
IsEnabled = true,
LabelColor = DictionaryResource.GetColor("ColorPrimary"),
CountColor = DictionaryResource.GetColor("ColorPrimary"),
Label = DictionaryResource.GetString("FollowingCount"),
Count = Format.FormatNumber(relationStat.Following)
});
TabRightBanners.Add(new TabRightBanner
{
IsEnabled = true,
LabelColor = DictionaryResource.GetColor("ColorPrimary"),
CountColor = DictionaryResource.GetColor("ColorPrimary"),
Label = DictionaryResource.GetString("FollowerCount"),
Count = Format.FormatNumber(relationStat.Follower)
});
}
// UP主状态数需要任意用户登录否则不会返回任何数据
UpStat upStat = null;
await Task.Run(() =>
{
upStat = UserStatus.GetUpStat(mid);
});
if (upStat != null && upStat.Archive != null && upStat.Article != null)
{
TabRightBanners.Add(new TabRightBanner
{
IsEnabled = false,
LabelColor = DictionaryResource.GetColor("ColorTextGrey"),
CountColor = DictionaryResource.GetColor("ColorTextDark"),
Label = DictionaryResource.GetString("LikesCount"),
Count = Format.FormatNumber(upStat.Likes)
});
long archiveView = 0;
if (upStat.Archive != null)
{
archiveView = upStat.Archive.View;
}
TabRightBanners.Add(new TabRightBanner
{
IsEnabled = false,
LabelColor = DictionaryResource.GetColor("ColorTextGrey"),
CountColor = DictionaryResource.GetColor("ColorTextDark"),
Label = DictionaryResource.GetString("ArchiveViewCount"),
Count = Format.FormatNumber(archiveView)
});
long articleView = 0;
if (upStat.Article != null)
{
articleView = upStat.Article.View;
}
TabRightBanners.Add(new TabRightBanner
{
IsEnabled = false,
LabelColor = DictionaryResource.GetColor("ColorTextGrey"),
CountColor = DictionaryResource.GetColor("ColorTextDark"),
Label = DictionaryResource.GetString("ArticleViewCount"),
Count = Format.FormatNumber(articleView)
});
}
}
/// <summary>
@ -34,6 +494,9 @@ namespace DownKyi.ViewModels
return;
}
mid = parameter;
InitView();
UpdateSpaceInfo();
}
}

@ -0,0 +1,81 @@
<UserControl
x:Class="DownKyi.Views.UserSpace.ViewArchive"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding PublicationZones}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Style>
<Style TargetType="{x:Type ListBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border
x:Name="Bd"
Padding="0"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer Focusable="False">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<StackPanel
Grid.Row="0"
Margin="0,0,30,0"
HorizontalAlignment="Left"
Cursor="Hand"
Orientation="Vertical">
<Image
Name="nameZoneIcon"
Width="64"
Height="64"
HorizontalAlignment="Center"
Source="{Binding Icon}" />
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock
Name="nameZoneName"
Foreground="{DynamicResource BrushTextDark}"
Text="{Binding Name}" />
<TextBlock
Name="nameZoneCount"
Margin="5,0,0,0"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Count}" />
</StackPanel>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="nameZoneName" Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Grid>
</UserControl>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DownKyi.Views.UserSpace
{
/// <summary>
/// ViewArchive.xaml 的交互逻辑
/// </summary>
public partial class ViewArchive : UserControl
{
public ViewArchive()
{
InitializeComponent();
}
}
}

@ -0,0 +1,114 @@
<UserControl
x:Class="DownKyi.Views.UserSpace.ViewChannel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding Channels}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Style>
<Style TargetType="{x:Type ListBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border
x:Name="Bd"
Padding="0"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer Focusable="False">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<StackPanel
Grid.Row="0"
Margin="40,0,0,10"
HorizontalAlignment="Left"
Orientation="Vertical">
<Border
Width="190"
Height="119"
HorizontalAlignment="Center"
CornerRadius="5"
Cursor="Hand">
<Border.Background>
<!-- 长宽比1.6 -->
<ImageBrush ImageSource="{Binding Cover}" />
</Border.Background>
<Border
Width="70"
HorizontalAlignment="Right"
Background="{DynamicResource BrushBorderTranslucent100}"
CornerRadius="0 5 5 0">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock
FontSize="16"
Foreground="{DynamicResource BrushText}"
Text="{Binding Count}" />
<Image
Height="18"
Margin="0,10,0,0"
Source="/DownKyi;component/Resources/channel.png" />
</StackPanel>
</Border>
</Border>
<TextBlock
MaxWidth="190"
Margin="0,5,0,0"
HorizontalAlignment="Left"
Cursor="Hand"
Tag="{Binding Cid}"
Text="{Binding Name}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Name}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Foreground" Value="{DynamicResource BrushTextDark}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock
Name="nameZoneCount"
Margin="0,5,0,0"
HorizontalAlignment="Left"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Ctime}" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Grid>
</UserControl>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DownKyi.Views.UserSpace
{
/// <summary>
/// ViewChannel.xaml 的交互逻辑
/// </summary>
public partial class ViewChannel : UserControl
{
public ViewChannel()
{
InitializeComponent();
}
}
}

@ -2,9 +2,362 @@
x:Class="DownKyi.Views.ViewUserSpace"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<UserControl.Resources>
<Style x:Key="TabLeftBannerStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<StackPanel
x:Name="panel"
Margin="10,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand">
<StackPanel Margin="0,0,0,5" Orientation="Horizontal">
<TextBlock Padding="5,0">
<ContentControl
Width="20"
Height="20"
VerticalAlignment="Center">
<Path
Width="20"
Height="20"
Data="{Binding Icon.Data}"
Fill="{Binding IconColor}"
Stretch="Uniform" />
</ContentControl>
</TextBlock>
<TextBlock
Name="nameText"
Padding="5,0"
VerticalAlignment="Center"
FontSize="14"
Text="{Binding Title}" />
</StackPanel>
<TextBlock
Name="nameIndicator"
Height="1.5"
Background="{DynamicResource BrushPrimary}" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="Selector.IsSelected" Value="False">
<Setter TargetName="nameText" Property="Foreground" Value="{DynamicResource BrushTextDark}" />
<Setter TargetName="nameIndicator" Property="Visibility" Value="Hidden" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="nameText" Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
<Trigger Property="Selector.IsSelected" Value="True">
<Setter TargetName="nameText" Property="Foreground" Value="{DynamicResource BrushPrimary}" />
<Setter TargetName="nameIndicator" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabRightBannerStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<StackPanel
x:Name="panel"
Margin="15,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Cursor="Hand"
IsEnabled="{Binding IsEnabled}">
<TextBlock
Name="nameLabel"
Padding="0,0,0,5"
HorizontalAlignment="Center"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Label}" />
<TextBlock
Name="nameCount"
Padding="0,0,0,0"
HorizontalAlignment="Center"
Foreground="{DynamicResource BrushTextDark}"
Text="{Binding Count}" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="nameLabel" Property="Foreground" Value="{Binding LabelColor}" />
<Setter TargetName="nameCount" Property="Foreground" Value="{Binding CountColor}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabBannerStyle" TargetType="{x:Type ListBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border
x:Name="Bd"
Padding="0"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer Focusable="False">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<TextBlock>用户空间</TextBlock>
<Grid Visibility="{Binding ViewVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="300" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="{Binding Background}"
Stretch="UniformToFill" />
<Grid Grid.Row="0" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
Width="64"
Height="64"
Source="{Binding Header}">
<Image.Clip>
<!-- 设置图像如何显示 -->
<EllipseGeometry
Center="32,32"
RadiusX="32"
RadiusY="32" />
</Image.Clip>
</Image>
<!-- 添加一个圆框在头像上,做边框 -->
<Ellipse
Grid.Column="0"
Width="66"
Height="66"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="{DynamicResource BrushImageBorder2}"
StrokeThickness="2" />
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel
Grid.Row="0"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
FontWeight="Bold"
Foreground="{DynamicResource BrushText}"
Text="{Binding UserName}" />
<Image
Width="18"
Height="18"
Margin="5,0,0,0"
Source="{Binding Sex}" />
<Image
Width="28"
Height="16"
Margin="5,0,0,0"
Source="{Binding Level}" />
<Border
Height="17"
Margin="5,0,0,0"
Padding="5,0"
Background="{DynamicResource BrushSecond}"
CornerRadius="3"
Visibility="{Binding VipTypeVisibility}">
<TextBlock
VerticalAlignment="Center"
FontSize="10"
Foreground="{DynamicResource BrushText}"
Text="{Binding VipType}" />
</Border>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushText}"
Text="{Binding Sign}" />
<Border
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="{DynamicResource BrushMask}"
BorderBrush="{DynamicResource BrushImageBorder2}"
BorderThickness="2"
CornerRadius="5">
<TextBlock
Padding="8,3"
VerticalAlignment="Center"
FontSize="16"
Foreground="{DynamicResource BrushBackground}"
Text="{Binding IsFollowed}" />
</Border>
</Grid>
</Grid>
</Grid>
<!-- 内容 -->
<Grid Grid.Row="1" Visibility="{Binding ContentVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="70" />
<RowDefinition />
</Grid.RowDefinitions>
<!-- 内容区top banner -->
<Grid Grid.Row="0" Margin="20,0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ListBox
Name="nameTabLeftBanners"
Grid.Column="0"
ItemContainerStyle="{StaticResource TabLeftBannerStyle}"
ItemsSource="{Binding TabLeftBanners}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Style="{StaticResource TabBannerStyle}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding TabLeftBannersCommand}" CommandParameter="{Binding ElementName=nameTabLeftBanners, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
<ListBox
Grid.Column="1"
ItemContainerStyle="{StaticResource TabRightBannerStyle}"
ItemsSource="{Binding TabRightBanners}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Style="{StaticResource TabBannerStyle}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
<!-- 内容区content -->
<ContentControl
Grid.Row="1"
Margin="20,20,20,0"
prism:RegionManager.RegionName="UserSpaceContentRegion" />
</Grid>
</Grid>
<!-- 加载gif -->
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="{Binding LoadingVisibility}">
<ContentControl
Width="40"
Height="40"
Content="{Binding Loading}" />
<TextBlock
Margin="0,10,0,0"
FontSize="14"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource MySpaceWait}" />
</StackPanel>
<!-- 没有数据提示 -->
<Image
Width="256"
Height="256"
Source="/DownKyi;component/Resources/no-data.png"
Visibility="{Binding NoDataVisibility}" />
<!-- 顶部导航 -->
<Grid VerticalAlignment="Top" Background="{Binding TopNavigationBg}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="0"
Margin="10,5,0,5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding BackSpaceCommand}"
Style="{StaticResource ImageBtnStyle}">
<StackPanel Orientation="Horizontal">
<ContentControl Width="24" Height="24">
<Path
Width="{Binding ArrowBack.Width}"
Height="{Binding ArrowBack.Height}"
Data="{Binding ArrowBack.Data}"
Fill="{Binding ArrowBack.Fill}"
Stretch="None" />
</ContentControl>
<TextBlock
VerticalAlignment="Center"
FontSize="16"
Foreground="{Binding ArrowBack.Fill}"
Text="{DynamicResource UserSpace}" />
</StackPanel>
</Button>
</Grid>
</Grid>
</UserControl>

Binary file not shown.
Loading…
Cancel
Save