把动态的UI写一下,喝一杯咖啡
This commit is contained in:
parent
f0177e5180
commit
da65694926
|
@ -1,7 +1,9 @@
|
||||||
<Application
|
<Application
|
||||||
x:Class="RustTools.App"
|
x:Class="RustTools.App"
|
||||||
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:local="using:RustTools.Views"
|
||||||
|
xmlns:zy="using:RustTools.DataList">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
@ -9,7 +11,30 @@
|
||||||
<ResourceDictionary Source="/Styles/FontSizes.xaml" />
|
<ResourceDictionary Source="/Styles/FontSizes.xaml" />
|
||||||
<ResourceDictionary Source="/Styles/Thickness.xaml" />
|
<ResourceDictionary Source="/Styles/Thickness.xaml" />
|
||||||
<ResourceDictionary Source="/Styles/TextBlock.xaml" />
|
<ResourceDictionary Source="/Styles/TextBlock.xaml" />
|
||||||
|
<ResourceDictionary Source="/Styles/ItemView.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 用于动态界面的关注用户视图 -->
|
||||||
|
|
||||||
|
<DataTemplate x:Key="ConCernItem">
|
||||||
|
<ItemContainer Width="260" Margin="0,0,0,9">
|
||||||
|
<StackPanel Padding="5" Orientation="Horizontal">
|
||||||
|
<Image
|
||||||
|
Width="56"
|
||||||
|
Height="56"
|
||||||
|
Source="{Binding HeadIcon}"
|
||||||
|
Stretch="UniformToFill" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{ThemeResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{Binding UserName}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ItemContainer>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
|
|
|
@ -16,6 +16,8 @@ using Windows.ApplicationModel.Activation;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.Windows.AppLifecycle;
|
using Microsoft.Windows.AppLifecycle;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
|
using Windows.Management.Core;
|
||||||
|
|
||||||
namespace RustTools;
|
namespace RustTools;
|
||||||
|
|
||||||
|
@ -49,9 +51,8 @@ public partial class App : Microsoft.UI.Xaml.Application
|
||||||
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
// 注册激活事件处理程序
|
// 注册激活事件处理程序
|
||||||
|
|
||||||
Host = Microsoft.Extensions.Hosting.Host.
|
Host = Microsoft.Extensions.Hosting.Host.
|
||||||
CreateDefaultBuilder().
|
CreateDefaultBuilder().
|
||||||
UseContentRoot(AppContext.BaseDirectory).
|
UseContentRoot(AppContext.BaseDirectory).
|
||||||
|
@ -81,7 +82,7 @@ public partial class App : Microsoft.UI.Xaml.Application
|
||||||
services.AddTransient<HomePageViewModel>();
|
services.AddTransient<HomePageViewModel>();
|
||||||
services.AddTransient<HomePage>();
|
services.AddTransient<HomePage>();
|
||||||
services.AddTransient<ConcernViewModel>();
|
services.AddTransient<ConcernViewModel>();
|
||||||
services.AddTransient<Concern>();
|
services.AddTransient<ConcernPage>();
|
||||||
services.AddTransient<RankingViewModel>();
|
services.AddTransient<RankingViewModel>();
|
||||||
services.AddTransient<RankingPage>();
|
services.AddTransient<RankingPage>();
|
||||||
services.AddTransient<UserViewModel>();
|
services.AddTransient<UserViewModel>();
|
||||||
|
|
111
RustTools/DataList/CommunityList.cs
Normal file
111
RustTools/DataList/CommunityList.cs
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class CommunityList
|
||||||
|
{
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int Code
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string Message
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("data")]
|
||||||
|
public Data[] data
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
public class Data
|
||||||
|
{
|
||||||
|
[JsonProperty("account")]
|
||||||
|
public string Account
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("cover")]
|
||||||
|
public string Cover
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("introduce")]
|
||||||
|
public string Introduce
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("fans")]
|
||||||
|
public string Fans
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("follower")]
|
||||||
|
public string Follower
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("praise")]
|
||||||
|
public string Praise
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("userName")]
|
||||||
|
public string UserName
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("headIcon")]
|
||||||
|
public string HeadIcon
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("email")]
|
||||||
|
public string Email
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("permission")]
|
||||||
|
public string Permission
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("loginTime")]
|
||||||
|
public string LoginTime
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("gender")]
|
||||||
|
public string Gender
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("enable")]
|
||||||
|
public bool Enable
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("dynamicColor")]
|
||||||
|
public string DynamicColor
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,14 +12,14 @@
|
||||||
|
|
||||||
<Identity
|
<Identity
|
||||||
Name="fd2b2e41-3313-4569-9ada-72a0640e6c21"
|
Name="fd2b2e41-3313-4569-9ada-72a0640e6c21"
|
||||||
Publisher="CN=19669"
|
Publisher="CN=muqing"
|
||||||
Version="1.0.0.0" />
|
Version="1.0.0.0" />
|
||||||
|
|
||||||
<mp:PhoneIdentity PhoneProductId="fd2b2e41-3313-4569-9ada-72a0640e6c21" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
<mp:PhoneIdentity PhoneProductId="fd2b2e41-3313-4569-9ada-72a0640e6c21" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>RustTools</DisplayName>
|
<DisplayName>RustTools</DisplayName>
|
||||||
<PublisherDisplayName>19669</PublisherDisplayName>
|
<PublisherDisplayName>muqing</PublisherDisplayName>
|
||||||
<Logo>Assets\res\StoreLogo.png</Logo>
|
<Logo>Assets\res\StoreLogo.png</Logo>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
|
@ -74,6 +74,8 @@
|
||||||
|
|
||||||
<Capabilities>
|
<Capabilities>
|
||||||
<rescap:Capability Name="runFullTrust" />
|
<rescap:Capability Name="runFullTrust" />
|
||||||
|
<Capability Name="internetClient" />
|
||||||
|
<Capability Name="privateNetworkClientServer" />
|
||||||
</Capabilities>
|
</Capabilities>
|
||||||
|
|
||||||
<genTemplate:Metadata>
|
<genTemplate:Metadata>
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<RootNamespace>RustTools</RootNamespace>
|
<RootNamespace>RustTools</RootNamespace>
|
||||||
<Platforms>x86;x64;arm64</Platforms>
|
<Platforms>x86;x64;arm64</Platforms>
|
||||||
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
||||||
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWinUI>true</UseWinUI>
|
<UseWinUI>true</UseWinUI>
|
||||||
|
@ -17,12 +16,25 @@
|
||||||
<ApplicationIcon>Assets\WindowIcon.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\WindowIcon.ico</ApplicationIcon>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
<DefaultLanguage>zh-cn</DefaultLanguage>
|
<DefaultLanguage>zh-cn</DefaultLanguage>
|
||||||
|
|
||||||
|
|
||||||
|
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
|
||||||
|
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||||
|
<PackageCertificateThumbprint>3386EC79D3BB9691D0A8DA634167500B242E109D</PackageCertificateThumbprint>
|
||||||
|
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||||
|
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||||
|
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
|
||||||
|
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||||
|
<AppxBundle>Never</AppxBundle>
|
||||||
|
<AppInstallerUri>C:\\RustTools</AppInstallerUri>
|
||||||
|
<AppxPackageDir>D:\RustTools</AppxPackageDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Assets\image\image_106.svg" />
|
<None Remove="Assets\image\image_106.svg" />
|
||||||
<None Remove="Views\Concern.xaml" />
|
<None Remove="Styles\ItemView.xaml" />
|
||||||
|
<None Remove="Views\ConcernPage.xaml" />
|
||||||
<None Remove="Views\HomePage.xaml" />
|
<None Remove="Views\HomePage.xaml" />
|
||||||
<None Remove="Views\ModulePage.xaml" />
|
<None Remove="Views\ModulePage.xaml" />
|
||||||
<None Remove="Views\RankingPage.xaml" />
|
<None Remove="Views\RankingPage.xaml" />
|
||||||
|
@ -57,13 +69,16 @@
|
||||||
<Pack>True</Pack>
|
<Pack>True</Pack>
|
||||||
<PackagePath>\</PackagePath>
|
<PackagePath>\</PackagePath>
|
||||||
</None>
|
</None>
|
||||||
|
<Page Update="Styles\ItemView.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Update="WindowUI\ImportModule.xaml">
|
<Page Update="WindowUI\ImportModule.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Views\ModulePage.xaml">
|
<Page Update="Views\ModulePage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Views\Concern.xaml">
|
<Page Update="Views\ConcernPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Views\UserPage.xaml">
|
<Page Update="Views\UserPage.xaml">
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class PageService : IPageService
|
||||||
//Configure<MainViewModel, MainPage>();
|
//Configure<MainViewModel, MainPage>();
|
||||||
|
|
||||||
Configure<HomePageViewModel, HomePage>();
|
Configure<HomePageViewModel, HomePage>();
|
||||||
Configure<ConcernViewModel, Concern>();
|
Configure<ConcernViewModel, ConcernPage>();
|
||||||
Configure<RankingViewModel, RankingPage>();
|
Configure<RankingViewModel, RankingPage>();
|
||||||
Configure<UserViewModel, UserPage>();
|
Configure<UserViewModel, UserPage>();
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@
|
||||||
<value>Test</value>
|
<value>Test</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Concern.Content" xml:space="preserve">
|
<data name="Concern.Content" xml:space="preserve">
|
||||||
<value>关注</value>
|
<value>动态</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="HomePage.Content" xml:space="preserve">
|
<data name="HomePage.Content" xml:space="preserve">
|
||||||
<value>主页</value>
|
<value>主页</value>
|
||||||
|
|
59
RustTools/Styles/ItemView.xaml
Normal file
59
RustTools/Styles/ItemView.xaml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<DataTemplate x:Key="MovingInfo">
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,0,0,16"
|
||||||
|
Padding="16"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="{StaticResource ControlCornerRadius}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Ellipse
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="56"
|
||||||
|
Height="56">
|
||||||
|
<Ellipse.Fill>
|
||||||
|
<ImageBrush ImageSource="/Assets/image/a.jpeg" Stretch="UniformToFill" />
|
||||||
|
</Ellipse.Fill>
|
||||||
|
</Ellipse>
|
||||||
|
<StackPanel Grid.Column="1" Margin="9,0,0,0">
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="名称" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,3,0,0"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="信息 日期" />
|
||||||
|
</StackPanel>
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
<TextBlock
|
||||||
|
Margin="16"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="内容是大概就是这个东西了" />
|
||||||
|
<StackPanel
|
||||||
|
Margin="16,0,16,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
FlowDirection="RightToLeft"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<StackPanel.Resources>
|
||||||
|
<Style TargetType="FontIcon">
|
||||||
|
<Setter Property="Margin" Value="0,0,26,0" />
|
||||||
|
</Style>
|
||||||
|
</StackPanel.Resources>
|
||||||
|
<FontIcon Glyph="" />
|
||||||
|
<FontIcon Glyph="" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
|
@ -1,10 +1,96 @@
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using RustTools.DataList;
|
||||||
|
using RustTools.muqing;
|
||||||
|
using Windows.System;
|
||||||
|
|
||||||
namespace RustTools.ViewModels;
|
namespace RustTools.ViewModels;
|
||||||
|
|
||||||
public partial class ConcernViewModel : ObservableRecipient
|
public partial class ConcernViewModel : ObservableRecipient
|
||||||
{
|
{
|
||||||
|
public ObservableCollection<CommunityList.Data> communitylist = new();
|
||||||
|
public ObservableCollection<MovingInfo.Data> MovingInfoList = new();
|
||||||
|
private readonly string json = @"
|
||||||
|
{
|
||||||
|
""code"": 0,
|
||||||
|
""message"": ""获取成功,共3条记录"",
|
||||||
|
""data"": [
|
||||||
|
{
|
||||||
|
""account"": ""offical"",
|
||||||
|
""cover"": ""../user/offical/cover.png"",
|
||||||
|
""introduce"": null,
|
||||||
|
""fans"": ""64"",
|
||||||
|
""follower"": ""5"",
|
||||||
|
""praise"": ""0"",
|
||||||
|
""userName"": ""铁锈助手官方"",
|
||||||
|
""headIcon"": ""http://rust.coldmint.top/user/offical/icon.png"",
|
||||||
|
""email"": ""2923268971@qq.com"",
|
||||||
|
""permission"": ""2"",
|
||||||
|
""loginTime"": ""2023-10-21 22:28:18"",
|
||||||
|
""gender"": ""1"",
|
||||||
|
""enable"": ""true"",
|
||||||
|
""dynamicColor"": ""null""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""account"": ""coldmint"",
|
||||||
|
""cover"": ""http://rust.coldmint.top/user/coldmint/covers/181d019f-7cb7-9c07-389e-5a78b98eea54.png"",
|
||||||
|
""introduce"": ""我是薄荷老师。”"",
|
||||||
|
""fans"": ""141"",
|
||||||
|
""follower"": ""13"",
|
||||||
|
""praise"": ""0"",
|
||||||
|
""userName"": ""薄荷今天吃什么?"",
|
||||||
|
""headIcon"": ""https://rust.coldmint.top/user/coldmint/icons/4006dc55-9101-39cc-7076-34c4b32924d5.png"",
|
||||||
|
""email"": ""cold_mint@qq.com"",
|
||||||
|
""permission"": ""1"",
|
||||||
|
""loginTime"": ""2024-08-02 22:04:48"",
|
||||||
|
""gender"": ""-1"",
|
||||||
|
""enable"": ""true"",
|
||||||
|
""dynamicColor"": ""null""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
""account"": ""muqing"",
|
||||||
|
""cover"": ""../user/muqing/covers/d4083a79-1e7f-d3bc-5944-ae9bce0d6714.png"",
|
||||||
|
""introduce"": ""nihao"",
|
||||||
|
""fans"": ""1"",
|
||||||
|
""follower"": ""1"",
|
||||||
|
""praise"": ""0"",
|
||||||
|
""userName"": ""薄荷是我的老婆"",
|
||||||
|
""headIcon"": ""../user/muqing/icons/cf0582bb-584c-176f-098b-a9a95af22a44.png"",
|
||||||
|
""email"": ""2583089389@qq.com"",
|
||||||
|
""permission"": ""3"",
|
||||||
|
""loginTime"": ""2024-04-18 14:08:22"",
|
||||||
|
""gender"": ""1"",
|
||||||
|
""enable"": ""true"",
|
||||||
|
""dynamicColor"": ""null""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}";
|
||||||
public ConcernViewModel()
|
public ConcernViewModel()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var response = JsonConvert.DeserializeObject<CommunityList>(json);
|
||||||
|
var a = new CommunityList.Data
|
||||||
|
{
|
||||||
|
UserName = "全部",
|
||||||
|
HeadIcon = "/Assets/tool.png"
|
||||||
|
};
|
||||||
|
communitylist.Add(a);
|
||||||
|
foreach (var item in response.data)
|
||||||
|
{
|
||||||
|
//item.UserName
|
||||||
|
item.HeadIcon= item.HeadIcon.Replace("..", wl.api);
|
||||||
|
communitylist.Add(item);
|
||||||
|
communitylist.Add(item);
|
||||||
|
communitylist.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ public partial class HomePageViewModel : ObservableRecipient
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void random()
|
public async void random()
|
||||||
{
|
{
|
||||||
var modListResponse = JsonConvert.DeserializeObject<ModListResponse>(await ApiFox.mod.random());
|
var modListResponse = JsonConvert.DeserializeObject<ModListResponse>(await ApiFox.mod.random());
|
||||||
|
|
18
RustTools/ViewModels/MovingInfo.cs
Normal file
18
RustTools/ViewModels/MovingInfo.cs
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace RustTools.ViewModels;
|
||||||
|
public class MovingInfo
|
||||||
|
{
|
||||||
|
public class Data
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public Data(string name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Page
|
|
||||||
x:Class="RustTools.Views.Concern"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="using:RustTools.Views"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
||||||
|
|
||||||
<Grid>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
|
@ -1,32 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
|
||||||
using Microsoft.UI.Xaml.Data;
|
|
||||||
using Microsoft.UI.Xaml.Input;
|
|
||||||
using Microsoft.UI.Xaml.Media;
|
|
||||||
using Microsoft.UI.Xaml.Navigation;
|
|
||||||
using RustTools.ViewModels;
|
|
||||||
using Windows.Foundation;
|
|
||||||
using Windows.Foundation.Collections;
|
|
||||||
|
|
||||||
// To learn more about WinUI, the WinUI project structure,
|
|
||||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
|
||||||
|
|
||||||
namespace RustTools.Views;
|
|
||||||
/// <summary>
|
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
public sealed partial class Concern : Page
|
|
||||||
{
|
|
||||||
public ConcernViewModel ConcernViewModel { get; set; }
|
|
||||||
public Concern()
|
|
||||||
{
|
|
||||||
ConcernViewModel = App.GetService<ConcernViewModel>();
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
48
RustTools/Views/ConcernPage.xaml
Normal file
48
RustTools/Views/ConcernPage.xaml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Page
|
||||||
|
x:Class="RustTools.Views.ConcernPage"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:RustTools.Views"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
SizeChanged="Page_SizeChanged"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition MinWidth="56" MaxWidth="320" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,9,9,0"
|
||||||
|
Padding="9"
|
||||||
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
<ItemsView
|
||||||
|
Name="ListViewA"
|
||||||
|
Grid.Column="0"
|
||||||
|
ItemInvoked="ItemsView_ItemInvoked"
|
||||||
|
ItemTemplate="{StaticResource ConCernItem}"
|
||||||
|
ItemsSource="{x:Bind ViewModels.communitylist}"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Hidden" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="9"
|
||||||
|
Padding="9"
|
||||||
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
<ListView
|
||||||
|
Name="ListViewB"
|
||||||
|
IsItemClickEnabled="False"
|
||||||
|
ItemTemplate="{StaticResource MovingInfo}"
|
||||||
|
ItemsSource="{x:Bind ViewModels.MovingInfoList}"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||||
|
SelectionMode="None" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
59
RustTools/Views/ConcernPage.xaml.cs
Normal file
59
RustTools/Views/ConcernPage.xaml.cs
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using RustTools.muqing;
|
||||||
|
using RustTools.ViewModels;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace RustTools.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 动态界面
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class ConcernPage : Page
|
||||||
|
{
|
||||||
|
public ConcernViewModel ViewModels { get; set; }
|
||||||
|
public ConcernPage()
|
||||||
|
{
|
||||||
|
ViewModels = App.GetService<ConcernViewModel>();
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ItemsView_ItemInvoked(ItemsView sender, ItemsViewItemInvokedEventArgs args)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
var height = ActualHeight; // 确保使用页面的实际高度
|
||||||
|
|
||||||
|
// 检查是否为有效的数值
|
||||||
|
if (!double.IsNaN(height) && !double.IsInfinity(height) && height > 16)
|
||||||
|
{
|
||||||
|
ListViewA.Height = height - 16;
|
||||||
|
ListViewB.Height = height - 16;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ListViewA.Height = 500; // 或者其他适当的默认值
|
||||||
|
ListViewB.Height = 500; // 或者其他适当的默认值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,6 +18,9 @@ using RustTools.ViewModels;
|
||||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
namespace RustTools.Views;
|
namespace RustTools.Views;
|
||||||
|
/// <summary>
|
||||||
|
/// 排名界面
|
||||||
|
/// </summary>
|
||||||
public sealed partial class RankingPage : Page
|
public sealed partial class RankingPage : Page
|
||||||
{
|
{
|
||||||
public RankingViewModel ViewModel
|
public RankingViewModel ViewModel
|
||||||
|
|
|
@ -43,6 +43,7 @@ public sealed partial class SettingsPage : Page
|
||||||
case "Mica":
|
case "Mica":
|
||||||
BackgroundRadioButtons.SelectedIndex = 3;
|
BackgroundRadioButtons.SelectedIndex = 3;
|
||||||
break;
|
break;
|
||||||
|
default: BackgroundRadioButtons.SelectedIndex = 0; break;
|
||||||
}
|
}
|
||||||
BackgroundRadioButtons.SelectionChanged += BackgroundColor_SelectionChanged;
|
BackgroundRadioButtons.SelectionChanged += BackgroundColor_SelectionChanged;
|
||||||
ModFileUrlText.Text = iniHelper.GetValue(IniHelper.CODE.Rust, IniHelper.KEY.ModFileUrl);
|
ModFileUrlText.Text = iniHelper.GetValue(IniHelper.CODE.Rust, IniHelper.KEY.ModFileUrl);
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class IniHelper
|
||||||
public const string MapsFileUrl = "MapsFileUrl";
|
public const string MapsFileUrl = "MapsFileUrl";
|
||||||
}
|
}
|
||||||
|
|
||||||
private string filePath;
|
private string filePath = string.Empty;
|
||||||
|
|
||||||
public IniHelper()
|
public IniHelper()
|
||||||
{
|
{
|
||||||
|
@ -58,15 +58,19 @@ public class IniHelper
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filePath"></param>
|
/// <param name="filePath"></param>
|
||||||
/// <exception cref="FileNotFoundException"></exception>
|
/// <exception cref="FileNotFoundException"></exception>
|
||||||
public void Load(string filePath)
|
public void Load(string a)
|
||||||
{
|
{
|
||||||
this.filePath = filePath;
|
filePath = a;
|
||||||
if (!File.Exists(filePath))
|
if (!File.Exists(a))
|
||||||
{
|
{
|
||||||
File.Create(filePath);
|
File.Create(a);
|
||||||
return;
|
return;
|
||||||
//throw new FileNotFoundException("The specified file does not exist.", filePath);
|
//throw new FileNotFoundException("The specified file does not exist.", filePath);
|
||||||
}
|
}
|
||||||
|
if (filePath == null || filePath == string.Empty)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var lines = File.ReadAllLines(filePath);
|
var lines = File.ReadAllLines(filePath);
|
||||||
string? currentSection = null;
|
string? currentSection = null;
|
||||||
|
|
|
@ -41,7 +41,7 @@ class gj
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置window窗口适配器 主题颜色
|
/// 设置window窗口适配器 主题颜色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetBackTheme(WindowEx windowEx)
|
public static async void SetBackTheme(WindowEx windowEx)
|
||||||
{
|
{
|
||||||
var iniHelper = new IniHelper();
|
var iniHelper = new IniHelper();
|
||||||
iniHelper.Load(IniHelper.FILE.Config);
|
iniHelper.Load(IniHelper.FILE.Config);
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using Windows.Storage;
|
||||||
namespace RustTools.muqing;
|
namespace RustTools.muqing;
|
||||||
|
|
||||||
class wj
|
class wj
|
||||||
{
|
{
|
||||||
//存储主要文件的路径
|
//存储主要文件的路径
|
||||||
public const string CD = "D:\\抓包";
|
public static string CD = ApplicationData.Current.LocalFolder.Path;
|
||||||
//缓存路径
|
//缓存路径
|
||||||
public const string Cache = "";
|
public const string Cache = "";
|
||||||
|
|
||||||
//不知道为什么会保存到这里的路径
|
//不知道为什么会保存到这里的路径 废弃了 , 找到了新的文件夹路径
|
||||||
//C:\Users\账号\AppData\Local\VirtualStore\Windows\SysWOW64
|
//public const string CachePath= "C:/Users/账号/AppData/Local/VirtualStore/Windows/SysWOW64";
|
||||||
public const string CachePath= "C:/Users/19669/AppData/Local/VirtualStore/Windows/SysWOW64";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 存储文件名字的路径
|
/// 存储文件名字的路径
|
||||||
|
|
Loading…
Reference in New Issue
Block a user