diff --git a/RustTools/WindowUI/ModulePage.xaml b/RustTools/WindowUI/ModulePage.xaml index 4c26b27..0192103 100644 --- a/RustTools/WindowUI/ModulePage.xaml +++ b/RustTools/WindowUI/ModulePage.xaml @@ -79,12 +79,34 @@ DefaultLabelPosition="Right" IsOpen="False"> - + - + - + + diff --git a/RustTools/WindowUI/ModulePage.xaml.cs b/RustTools/WindowUI/ModulePage.xaml.cs index e2e2e54..aca1610 100644 --- a/RustTools/WindowUI/ModulePage.xaml.cs +++ b/RustTools/WindowUI/ModulePage.xaml.cs @@ -40,21 +40,13 @@ public sealed partial class ModulePage : WindowEx } private async void init(string v) { - //string json = "\r\n{\"code\":0,\"message\":\"ȡɹ\",\"data\":{\"id\":\"585886886883885357567508566896\",\"name\":\"ģ5.0\",\"describe\":\"\",\"icon\":\"\",\"tags\":\"[]\",\"screenshots\":\"\",\"developer\":\"SDL_13964\",\"link\":\"..\\/user\\/SDL_13964\\/mods\\/585886886883885357567508566896\\/585886886883885357567508566896.rwmod\",\"downloadNumber\":\"366\",\"versionNumber\":\"1\",\"versionName\":\"1.14514\",\"updateTime\":\"2022-07-20 14:20:09\",\"creationTime\":\"2022-07-20 14:20:09\",\"unitNumber\":\"909\",\"hidden\":\"0\",\"coinNumber\":\"1\",\"minVersion\":\"\"}}"; - var json = await ApiFox.mod.getInfo("", v); var a = JsonConvert.DeserializeObject(json); if (a != null) { Mod = a.data; - if (Mod.IconUrl.Equals("")) - { - Mod.IconUrl = "/Assets/image/image_106.svg"; - } - else - { - Mod.IconUrl = Mod.IconUrl.Replace("..", wl.api); - } + Mod.IconUrl = Mod.IconUrl.Equals("") ? "/Assets/image/image_106.svg" : Mod.IconUrl.Replace("..", wl.api); + Mod.Link = Mod.Link.Replace("..", wl.api); Title = Mod.Name; var l = " | "; title_b.Text = "λ" + Mod.UnitNumber + l + Mod.DownloadNumber + "" + l + "汾" + Mod.VersionName; @@ -89,9 +81,7 @@ public sealed partial class ModulePage : WindowEx private void WindowEx_SizeChanged(object sender, WindowSizeChangedEventArgs args) { - gj.sc(Width); DescriptionText.Width = Width-50; - } @@ -100,4 +90,37 @@ public sealed partial class ModulePage : WindowEx // ڹرʱбƳ ModulePageList.Remove(this); } + + private void AppBarButton_Click(object sender, RoutedEventArgs e) + { + var label = ((AppBarButton)sender).Name; + gj.sc(label); + switch (label) + { + case "ReportButton": + gj.sc("ٱģ鳭Ϯ"); + //if (Toast.IsOpen) Toast.IsOpen = false; + Toast.Title = "ٱģ"; + Toast.Subtitle = "ٱܽԾٱ"; + Toast.IsOpen = true; + + break; + case "LikeButton": + gj.sc("ģͶһ"); + //if (Toast.IsOpen) Toast.IsOpen = false; + Toast.Title = "ִ֧ģ"; + Toast.Subtitle = "ֺ֧Զ۳һӲңû֧ʧ"; + Toast.IsOpen = true; + + break; + case "DownLoadButton": + gj.sc("شģ:"+Mod.Link); + break; + } + } + + private void Toast_ActionButtonClick(TeachingTip sender, object args) + { + + } }