Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PCL.Neo/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
using PCL.Neo.Services;
using PCL.Neo.ViewModels;
using PCL.Neo.ViewModels.Home;
using PCL.Neo.ViewModels.Online;
using PCL.Neo.Views;
using PCL.Neo.Views.Online;
using System;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -33,6 +35,7 @@ private static IServiceProvider ConfigureServices()
return new ServiceCollection()
.AddTransient<MainWindowViewModel>()
.AddTransient<HomeViewModel>().AddTransient<HomeSubViewModel>()
.AddTransient<OnlineViewModel>().AddTransient<OnlineSubViewModel>()

.AddSingleton<INavigationService, NavigationService>()
.AddSingleton<StorageService>()
Expand Down
2 changes: 1 addition & 1 deletion PCL.Neo/Styles/Icons.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Add Styles Here -->
<Style>
<Style.Resources>
<StreamGeometry x:Key="ShapeTitleLogo">M26,29 v-25 h5 a7,7 180 0 1 0,14 h-5 M61,6.5 a10,11.5 180 1 0 0,18 M68,2.5 v24.5 h12 M98,2 v27 M107,2 v27</StreamGeometry>
<StreamGeometry x:Key="ShapeTitleLogo">M26,29 v-25 h5 a7,7 180 0 1 0,14 h-5 M61,6.5 a10,11.5 180 1 0 0,18 M68,2.5 v24.5 h12 M98,2</StreamGeometry>
<StreamGeometry x:Key="BtnTitleClose">F1 M2,0 L0,2 8,10 0,18 2,20 10,12 18,20 20,18 12,10 20,2 18,0 10,8 2,0Z</StreamGeometry>
<StreamGeometry x:Key="BtnTitleMin">F1 M0,0 h15 v2 h-15 v-2 Z</StreamGeometry>
<StreamGeometry x:Key="BtnTitleSelect0">M985.403 552.96C985.403 812.702 773.041 1024 512 1024S38.597 812.702 38.597 552.96c0-158.208 79.163-304.955 211.771-392.625 31.074-20.52 72.94-11.973 93.46 19.101s12.012 72.94-19.062 93.46c-94.681 62.622-151.237 167.306-151.237 280.064 0 185.344 151.788 336.108 338.471 336.108S850.471 738.304 850.471 552.96c0-114.649-57.974-220.278-155.096-282.585-31.35-20.125-40.448-61.833-20.362-93.184s61.794-40.448 93.184-20.4c135.995 87.236 217.206 235.362 217.206 396.169zM512 560.128c37.258 0 67.466-30.208 67.466-67.466V67.466C579.466 30.208 549.258 0 512 0s-67.466 30.208-67.466 67.466v425.196c0 37.258 30.208 67.466 67.466 67.466z</StreamGeometry>
Expand Down
11 changes: 7 additions & 4 deletions PCL.Neo/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using PCL.Neo.Messages;
using PCL.Neo.Services;
using PCL.Neo.ViewModels.Home;
using PCL.Neo.ViewModels.Online;
using PCL.Neo.Views.Online;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
Expand Down Expand Up @@ -150,12 +152,12 @@ public async Task Navigate(int tag)
switch (tag)
{
case 1:
NavigationService.GoToAsync<HomeViewModel>();
await NavigationService.GoToAsync<HomeViewModel>();
break;
case 2:
break;
case 3:
// NavigationService.Goto<LinkViewModel>();
await NavigationService.GoToAsync<OnlineViewModel>();
break;
case 4:
break;
Expand All @@ -180,8 +182,9 @@ private void UpdateNavBtnState()
{
CheckedBtn = CurrentViewModel switch
{
// LinkViewModel => 3,
//SetupViewModel => 4,
HomeViewModel => 1,

OnlineViewModel => 3,
// MoreViewModel => 4,
// _ => throw new ArgumentOutOfRangeException() // 有可能切换到子界面,如下载进度界面
_ => 1
Expand Down
9 changes: 9 additions & 0 deletions PCL.Neo/ViewModels/Online/OnlineSubViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using PCL.Neo.Services;

namespace PCL.Neo.ViewModels.Online;

[SubViewModel(typeof(OnlineViewModel))]
public class OnlineSubViewModel : ViewModelBase
{
private readonly INavigationService _navigationService;
}
9 changes: 9 additions & 0 deletions PCL.Neo/ViewModels/Online/OnlineViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using PCL.Neo.Services;

namespace PCL.Neo.ViewModels.Online;

[MainViewModel(typeof(OnlineSubViewModel))]
public class OnlineViewModel : ViewModelBase
{
private readonly INavigationService _navigationService;
}
6 changes: 3 additions & 3 deletions PCL.Neo/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
Stroke="White"
StrokeThickness="1.9"
UseLayoutRounding="False"
Width="52" />
Width="48" />
<TextBlock
FontSize="17"
Foreground="White"
Expand All @@ -150,7 +150,7 @@
Height="20"
HorizontalAlignment="Left"
IsHitTestVisible="False"
Margin="12,0,0,0"
Margin="0,0,0,0"
Name="NeoTitleLogo"
UseLayoutRounding="False"
Width="32">
Expand Down Expand Up @@ -239,7 +239,7 @@
Margin="5,0"
Name="BtnTitleSelect0"
Padding="2,0"
Tag="0"
Tag="1"
Text="{DynamicResource LangTitleHome}" />
<pc:MyRadioButton
Command="{Binding Navigate}"
Expand Down
14 changes: 14 additions & 0 deletions PCL.Neo/Views/Online/OnlineSubView.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:PCL.Neo.Controls"
xmlns:vm="clr-namespace:PCL.Neo.ViewModels.Online"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PCL.Neo.Views.Online.OnlineSubView"
x:DataType="vm:OnlineSubViewModel">
<Grid>
<controls:MyLoading TextError="联机还未完成哦 ~" State="Error"/>
</Grid>
</UserControl>

14 changes: 14 additions & 0 deletions PCL.Neo/Views/Online/OnlineSubView.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace PCL.Neo.Views.Online;

public partial class OnlineSubView : UserControl
{
public OnlineSubView()
{
InitializeComponent();
}
}

11 changes: 11 additions & 0 deletions PCL.Neo/Views/Online/OnlineView.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:PCL.Neo.ViewModels.Online"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PCL.Neo.Views.Online.OnlineView"
x:DataType="vm:OnlineViewModel">

</UserControl>

14 changes: 14 additions & 0 deletions PCL.Neo/Views/Online/OnlineView.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace PCL.Neo.Views.Online;

public partial class OnlineView : UserControl
{
public OnlineView()
{
InitializeComponent();
}
}

Loading