1
0
Fork 0
Browse Source

create a log section on dashboard and toggle button.

This is in aid of providing the user with more feedback about the program (eyes and ears) than the light readings and web requests. The toggle button allows the user to turn-off the logs if they don't want or need them. This is not a full implementation of the logging system (this is just a start).
stable
Craig Oates 3 years ago
parent
commit
6ad2bcbf13
  1. 23
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml
  2. 8
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml.cs
  3. 2
      src/EyesAndEars.UWP/EyesAndEars.UWP/Package.appxmanifest

23
src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml

@ -12,6 +12,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="96"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
@ -203,6 +204,17 @@
</Grid>
<Grid Grid.Row="2" Margin="0">
<ScrollViewer x:Name="LogViewer" Visibility="Visible"
VerticalScrollBarVisibility="Visible"
HorizontalScrollMode="Disabled"
VerticalScrollMode="Enabled" >
<RichTextBlock x:Name="Logs" FontSize="16">
<Paragraph>Executing Eyes and Ears..s.</Paragraph>
</RichTextBlock>
</ScrollViewer>
</Grid>
<Grid Grid.Row="3" Margin="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -210,6 +222,16 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0">
<ToggleButton x:Name="LogToggle" FontFamily="Segoe MDL2 Assets"
Content="&#xE8BC;" HorizontalAlignment="Right"
VerticalAlignment="Top" FontSize="28"
Height="79" Width="79"
Unchecked="LogToggle_Unchecked"
Checked="LogToggle_Checked"
IsChecked="True"/>
<HyperlinkButton x:Name="InfoButton" Grid.Column="0"
NavigateUri="http://www.nicolaellis.com"
FontFamily="Segoe MDL2 Assets" Content="&#xE946;"
@ -217,6 +239,7 @@
HorizontalAlignment="Left" FontSize="28"
ToolTipService.Placement="Mouse"
ToolTipService.ToolTip="This is a link to a webpage with information about Nicola and the project."/>
</StackPanel>
<TextBox x:Name="WebAddressBox" Grid.Column="1" FontSize="26"
Text="{x:Bind _vm.BaseURL , Mode=TwoWay}"

8
src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml.cs

@ -76,5 +76,13 @@ namespace EyesAndEars.UWP {
PlayButton.Content = "\uE71A";
_dispatcherTimer.Start();
}
private void LogToggle_Unchecked(object sender, RoutedEventArgs e) {
LogViewer.Visibility = Visibility.Collapsed;
}
private void LogToggle_Checked(object sender, RoutedEventArgs e) {
LogViewer.Visibility = Visibility.Visible;
}
}
}

2
src/EyesAndEars.UWP/EyesAndEars.UWP/Package.appxmanifest

@ -9,7 +9,7 @@
<Identity
Name="55acd946-60d4-4776-b6c6-03fef750e3da"
Publisher="CN=Craig Oates"
Version="2021.1.14.0" />
Version="2021.2.6.0" />
<mp:PhoneIdentity PhoneProductId="55acd946-60d4-4776-b6c6-03fef750e3da" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>