If there are multiple instances of a user control, how can I use data binding to update a property of the same name, for each of the control?
for example, the following is a part of my main windows design:
myVoltCtrl is my control to display for example, voltage. and I have two of the controls for displaying samples from two sensors. I have a viewmodel exposing the voltage: ProgressPv.
My question is how does my ViewModel can distinguish which sensor it is updating? Or do I have to make two separate instances of viewmodels for each sensor control?
I did quite a lot of search, but still can not figure out how this can be done.
Thanks in advance.
<Grid Grid.Row="0">
<local:myVoltCtrl x:Name="Sensor1" MinHeight="5" MinWidth="5" Volt="{Binding ProgessPv}">
</local:myVoltCtrl>
</Grid>
<Grid Grid.Row="1">
<local:myVoltCtrl x:Name="Sensor2" MinHeight="5" MinWidth="5" Volt="{Binding ProgessPv}" >
</local:myVoltCtrl>
</Grid>