Browse Source

冲突处理

master
sc 6 days ago
parent
commit
a8431a24d9
  1. 8
      QueryPage.xaml.cs
  2. 4
      View/LogPage.xaml.cs

8
QueryPage.xaml.cs

@ -4,14 +4,18 @@ namespace SunlightAggregationTerminal;
public partial class QueryPage : ContentPage public partial class QueryPage : ContentPage
{ {
// 定义一个静态的回调动作
public static Action<string>? OnScanQuery;
public QueryPage() public QueryPage()
{ {
InitializeComponent(); InitializeComponent();
WeakReferenceMessenger.Default.Register<string>(this, (r, scannedValue) => WeakReferenceMessenger.Default.Register<string>(this, (r, scannedValue) =>
{ {
ResultEntry.Text = scannedValue; ResultEntry.Text = scannedValue;
}); });
};
} }
private async void OnScanButtonClicked(object sender, EventArgs e) private async void OnScanButtonClicked(object sender, EventArgs e)
{ {

4
View/LogPage.xaml.cs

@ -7,6 +7,7 @@ namespace SunlightAggregationTerminal.View;
public partial class LogPage : ContentPage public partial class LogPage : ContentPage
{ {
public static Action<string>? OnScanProfile;
public LogPage() public LogPage()
{ {
InitializeComponent(); InitializeComponent();
@ -14,7 +15,8 @@ public partial class LogPage : ContentPage
WeakReferenceMessenger.Default.Register<string>(this, (r, scannedValue) => WeakReferenceMessenger.Default.Register<string>(this, (r, scannedValue) =>
{ {
Enterprise.Text = scannedValue; Enterprise.Text = scannedValue;
}); });
};
} }
private void OnScanButtonClicked(object sender, EventArgs e) private void OnScanButtonClicked(object sender, EventArgs e)

Loading…
Cancel
Save