Browse Source

添加机台细节消息页面

master
Administrator 3 months ago
parent
commit
035aa9b24a
  1. 12
      InfoDetail.xaml
  2. 9
      InfoDetail.xaml.cs
  3. 5
      InfoPage.xaml.cs
  4. 3
      SunlightAggregationTerminal.csproj

12
InfoDetail.xaml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SunlightAggregationTerminal.InfoDetail"
Title="InfoDetail">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

9
InfoDetail.xaml.cs

@ -0,0 +1,9 @@
namespace SunlightAggregationTerminal;
public partial class InfoDetail : ContentPage
{
public InfoDetail()
{
InitializeComponent();
}
}

5
InfoPage.xaml.cs

@ -88,7 +88,7 @@ public partial class InfoPage : ContentPage
WeakReferenceMessenger.Default.UnregisterAll(this); WeakReferenceMessenger.Default.UnregisterAll(this);
} }
private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{ {
// 将 sender 强制转换为 BindingContext 定义在 BindableObject // 将 sender 强制转换为 BindingContext 定义在 BindableObject
if (sender is Microsoft.Maui.Controls.BindableObject bindable) if (sender is Microsoft.Maui.Controls.BindableObject bindable)
@ -97,8 +97,9 @@ public partial class InfoPage : ContentPage
if (context is InfoItem item) if (context is InfoItem item)
{ {
DisplayAlert("提示", $"你点击了工单: {item.MachineName}", "确定"); // DisplayAlert("提示", $"你点击了工单: {item.MachineName}", "确定");
await Navigation.PushAsync(new InfoDetail());
} }
} }
} }

3
SunlightAggregationTerminal.csproj

@ -101,6 +101,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="InfoDetail.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="InfoPage.xaml"> <MauiXaml Update="InfoPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

Loading…
Cancel
Save