Browse Source

细节信息页面修复

master
Administrator 2 months ago
parent
commit
3f4a5a7cd8
  1. 2
      Converters/StringToBoolConverter.cs
  2. 1
      Converters/StringToImageConverter.cs
  3. 1
      InfoDetail.xaml
  4. 2
      InfoPage.xaml.cs

2
Converters/StringToBoolConverter.cs

@ -18,7 +18,7 @@ namespace SunlightAggregationTerminal.Converters
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
// 单向绑定通常不需要实现,除非你需要双向绑定 // 单向绑定
throw new NotImplementedException(); throw new NotImplementedException();
} }
} }

1
Converters/StringToImageConverter.cs

@ -31,7 +31,6 @@ namespace SunlightAggregationTerminal.Converters
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
// 通常图片转回字符串在 UI 上很少用到,可以抛出异常或留空
throw new NotImplementedException(); throw new NotImplementedException();
} }
} }

1
InfoDetail.xaml

@ -7,6 +7,7 @@
<ContentPage.Resources> <ContentPage.Resources>
<ResourceDictionary> <ResourceDictionary>
<converters:StringToImageConverter x:Key="StringToImageConverter" /> <converters:StringToImageConverter x:Key="StringToImageConverter" />
<converters:StringToBoolConverter x:Key="StringToBoolConverter" />
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<Grid RowDefinitions="Auto, Auto, *" ColumnDefinitions="*, Auto" > <Grid RowDefinitions="Auto, Auto, *" ColumnDefinitions="*, Auto" >

2
InfoPage.xaml.cs

@ -84,7 +84,7 @@ public partial class InfoPage : ContentPage
{ {
WeakReferenceMessenger.Default.UnregisterAll(this); WeakReferenceMessenger.Default.UnregisterAll(this);
} }
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{ {
// 将 sender 强制转换为 BindingContext 定义在 BindableObject // 将 sender 强制转换为 BindingContext 定义在 BindableObject

Loading…
Cancel
Save