我有一个开发的应用程序,该应用程序的顶部有一个复选框,用于打开/关闭点标签。问题是,它不起作用!据我所知,所有代码都是正确的,但是一定有些错误,我无法发现...
XAML:
<CheckBox x:Name="chkShowLabels" Grid.Row="0" Content="Display Station
Names" IsChecked="False" FontSize="16" Margin="8"/>
和代码隐藏:
Private Sub chkShowLabels_Checked(sender As Object, e As RoutedEventArgs) Handles chkShowLabels.Checked
Try
If Constants.TillNonTillLayer IsNot Nothing Then
Constants.TillNonTillLayer.LabelsEnabled = True
Constants.ObservationLayer.LabelsEnabled = True
End If
Catch ex As Exception
Constants.WriteToErrorLog(System.Reflection.MethodBase.GetCurrentMethod.DeclaringType.Name,System.Reflection.MethodInfo.GetCurrentMethod.Name, ex)
End Try
End Sub
Private Sub chkShowLabels_Unchecked(sender As Object, e As RoutedEventArgs) Handles chkShowLabels.Unchecked
Try
If Constants.TillNonTillLayer IsNot Nothing Then
Constants.TillNonTillLayer.LabelsEnabled = False
Constants.ObservationLayer.LabelsEnabled = False
End If
Catch ex As Exception
Constants.WriteToErrorLog(System.Reflection.MethodBase.GetCurrentMethod.DeclaringType.Name,System.Reflection.MethodInfo.GetCurrentMethod.Name, ex)
End Try
End Sub