Skip to content

Commit 5c69ffa

Browse files
committed
add: 左侧页面切换按钮布局
1 parent 54a45d8 commit 5c69ffa

File tree

6 files changed

+80
-3
lines changed

6 files changed

+80
-3
lines changed

llcomNext/LLCOM/App.axaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@
1212

1313
<Application.Styles>
1414
<semi:SemiTheme Locale="zh-CN" />
15+
<semi:SemiPopupAnimations />
16+
<StyleInclude Source="/Styles/MainStyle.axaml" />
1517
</Application.Styles>
18+
19+
<Application.Resources>
20+
<FontFamily x:Key="Phosphor">/Assets/Fonts/Phosphor.ttf#Phosphor</FontFamily>
21+
<FontFamily x:Key="PhosphorFill">/Assets/Fonts/Phosphor.ttf#Phosphor-Fill</FontFamily>
22+
</Application.Resources>
1623
</Application>
477 KB
Binary file not shown.

llcomNext/LLCOM/LLCOM.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13+
<Folder Include="Assets\Images\" />
1314
<Folder Include="Models\" />
1415
<AvaloniaResource Include="Assets\**" />
1516
</ItemGroup>
@@ -25,6 +26,7 @@
2526
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.5" />
2627
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
2728
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.5" />
29+
<PackageReference Include="Avalonia.Svg.Skia" Version="11.2.0.2" />
2830
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
2931
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.3" />
3032
<PackageReference Include="NLua" Version="1.7.4" />
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2+
<Design.PreviewWith>
3+
<StackPanel>
4+
<Button Classes="IconButton" Content="&#xEB56;" />
5+
<Button Classes="IconButtonActivated" Content="&#xEB56;" />
6+
</StackPanel>
7+
</Design.PreviewWith>
8+
9+
<!-- Add Styles Here -->
10+
11+
<Style Selector="Button.IconButton">
12+
<Setter Property="FontFamily" Value="{DynamicResource Phosphor}" />
13+
<Setter Property="Padding" Value="0" />
14+
<Setter Property="Theme" Value="{DynamicResource BorderlessButton}" />
15+
<Setter Property="Height" Value="40" />
16+
<Setter Property="Width" Value="40" />
17+
<Setter Property="FontSize" Value="20" />
18+
</Style>
19+
<Style Selector="Button.IconButtonActivated">
20+
<Setter Property="FontFamily" Value="{DynamicResource PhosphorFill}" />
21+
<Setter Property="Padding" Value="0" />
22+
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
23+
<Setter Property="Height" Value="40" />
24+
<Setter Property="Width" Value="40" />
25+
<Setter Property="FontSize" Value="20" />
26+
</Style>
27+
</Styles>
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
34
using System.Linq;
45
using System.Text;
56
using System.Threading.Tasks;
7+
using CommunityToolkit.Mvvm.ComponentModel;
8+
using CommunityToolkit.Mvvm.Input;
69

710
namespace LLCOM.ViewModels;
811

9-
public partial class MainViewModel(Func<Type, ViewModelBase?> getService) : ViewModelBase
12+
public partial class MainViewModel : ViewModelBase
1013
{
14+
private Func<Type, ViewModelBase?> GetService;
15+
16+
17+
18+
public MainViewModel(Func<Type, ViewModelBase?> getService)
19+
{
20+
GetService = getService;
21+
}
1122

1223
}

llcomNext/LLCOM/Views/MainView.axaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<UserControl
2+
Background="{DynamicResource SemiColorBackground0}"
23
d:DesignHeight="800"
34
d:DesignWidth="1200"
45
mc:Ignorable="d"
@@ -9,7 +10,36 @@
910
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1011
xmlns:vm="using:LLCOM.ViewModels"
1112
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
12-
<Grid>
13-
<Button Content="test" />
13+
<Grid ColumnDefinitions="auto,*">
14+
<Border
15+
Background="{DynamicResource SemiColorBackground4}"
16+
BorderBrush="{DynamicResource SemiColorBorder}"
17+
BorderThickness="0,0,1,0">
18+
<Panel Margin="5">
19+
<StackPanel Spacing="5">
20+
<Button
21+
Classes="IconButtonActivated"
22+
Content="&#xEB56;"
23+
ToolTip.Tip="数据收发" />
24+
<Button
25+
Classes="IconButton"
26+
Content="&#xECA0;"
27+
ToolTip.Tip="调试工具" />
28+
<Button
29+
Classes="IconButton"
30+
Content="&#xEAFE;"
31+
ToolTip.Tip="自动脚本" />
32+
<Button
33+
Classes="IconButton"
34+
Content="&#xE288;"
35+
ToolTip.Tip="在线功能" />
36+
</StackPanel>
37+
<Button
38+
Classes="IconButton"
39+
Content="&#xE270;"
40+
ToolTip.Tip="软件设置"
41+
VerticalAlignment="Bottom" />
42+
</Panel>
43+
</Border>
1444
</Grid>
1545
</UserControl>

0 commit comments

Comments
 (0)