1

我正在使用实时图表中的此代码示例

https://lvcharts.net/App/examples/v1/wpf/Constant%20Changes%20II

它在我的应用程序中并且正在工作,但是我希望能够从用户控件外部访问“ReadCommand”,实现我自己的按钮,然后发送我从串行端口读取的值。如何从我的主应用程序访问用户控件?

在查看了其他各种帖子后,我已经尝试过这个,但我正在努力解决这个问题。

 <Button x:Name="btn_StartTest"  Command="{Binding ReadCommand, RelativeSource={RelativeSource AncestorType={x:Type local:GraphData}}}" Grid.ColumnSpan="2" Content="START" Grid.Column="18" Grid.Row="17" VerticalAlignment="Top" Height="43" FontFamily="Arial" Margin="5,0" Click="btn_StartTest_Click"/>
4

0 回答 0