1
0
Fork 0
Browse Source

fix time error bug (#4).

'factory2' was not updating its timestamp when it received a new reading. It was binding to the wrong property in MainPage.xml (view model). This changes the property to the correct one.
pull/6/head
Craig Oates 3 years ago
parent
commit
f3c31ff3f0
  1. 7
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml
  2. 6
      src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs

7
src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml

@ -56,7 +56,7 @@
Mode=OneWay, FallbackValue=404}" Mode=OneWay, FallbackValue=404}"
Foreground="White" FontSize="24"/> Foreground="White" FontSize="24"/>
<TextBlock x:Name="Factory1Reading" <TextBlock x:Name="Factory1Reading"
Text="{x:Bind _vm.Device1.LatestReading.reading , Text="{x:Bind _vm.Device1.LatestReading.reading,
Mode=OneWay, FallbackValue=404}" Foreground="White" Mode=OneWay, FallbackValue=404}" Foreground="White"
VerticalAlignment="Bottom" FontSize="144"/> VerticalAlignment="Bottom" FontSize="144"/>
<TextBlock Text="Factory 1" Foreground="White" FontSize="36" <TextBlock Text="Factory 1" Foreground="White" FontSize="36"
@ -69,9 +69,10 @@
FallbackValue=Orange}" Margin="12,0,12,12" Width="300" Height="300"> FallbackValue=Orange}" Margin="12,0,12,12" Width="300" Height="300">
<StackPanel Margin="12" VerticalAlignment="Stretch"> <StackPanel Margin="12" VerticalAlignment="Stretch">
<TextBlock x:Name="Factory2Time" Foreground="White" FontSize="24" <TextBlock x:Name="Factory2Time" Foreground="White" FontSize="24"
Text="{x:Bind _vm.Device2.LatestStatus.time, Text="{x:Bind _vm.Device2.LatestReading.time,
Mode=OneWay, FallbackValue=404}" /> Mode=OneWay, FallbackValue=404}" />
<TextBlock x:Name="Factory2Reading" Text="{x:Bind _vm.Device2.LatestReading.reading, <TextBlock x:Name="Factory2Reading"
Text="{x:Bind _vm.Device2.LatestReading.reading,
Mode=OneWay, FallbackValue=404}" Foreground="White" Mode=OneWay, FallbackValue=404}" Foreground="White"
VerticalAlignment="Bottom" FontSize="144"/> VerticalAlignment="Bottom" FontSize="144"/>
<TextBlock Text="Factory 2" Foreground="White" FontSize="36" <TextBlock Text="Factory 2" Foreground="White" FontSize="36"

6
src/EyesAndEars.UWP/EyesAndEars.UWP/ViewModels/MainPageVM.cs

@ -23,9 +23,9 @@ namespace EyesAndEars.UWP.ViewModels {
Device1 = f1; Device1 = f1;
Device2 = f2; Device2 = f2;
Device3 = f3; Device3 = f3;
Device1 = g1; Device4 = g1;
Device2 = g2; Device5 = g2;
Device3 = g3; Device6 = g3;
} }
string _baseURL; string _baseURL;