1
0
Fork 0
Browse Source

change refresh button to play/stop button.

pull/6/head
Craig Oates 4 years ago
parent
commit
c411f1ac21
  1. 2
      src/EyesAndEars.UWP/EyesAndEars.UWP/EyesAndEars.UWP.csproj
  2. 17
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml
  3. 16
      src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml.cs
  4. 2
      src/EyesAndEars.UWP/EyesAndEars.UWP/Package.appxmanifest

2
src/EyesAndEars.UWP/EyesAndEars.UWP/EyesAndEars.UWP.csproj

@ -25,7 +25,7 @@
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision> <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts> <GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle> <AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms> <AppxBundlePlatforms>x64</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks> <HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">

17
src/EyesAndEars.UWP/EyesAndEars.UWP/MainPage.xaml

@ -9,7 +9,7 @@
Background="{ThemeResource SystemControlAcrylicWindowBrush}"> Background="{ThemeResource SystemControlAcrylicWindowBrush}">
<Grid Margin="12"> <Grid Margin="12">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="96"/> <RowDefinition Height="96"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
@ -164,7 +164,7 @@
ToolTipService.ToolTip="This is a link to a webpage with information about Nicola and the project."/> ToolTipService.ToolTip="This is a link to a webpage with information about Nicola and the project."/>
<TextBox x:Name="WebAddressBox" Grid.Column="1" FontSize="26" <TextBox x:Name="WebAddressBox" Grid.Column="1" FontSize="26"
Text="{x:Bind _vm.BaseURL , Mode=OneWay}" Text="{x:Bind _vm.BaseURL , Mode=TwoWay}"
Padding="20" TextAlignment="Left" Padding="20" TextAlignment="Left"
HorizontalAlignment="Stretch" TextWrapping="NoWrap" HorizontalAlignment="Stretch" TextWrapping="NoWrap"
Margin="0" VerticalAlignment="Center" Margin="0" VerticalAlignment="Center"
@ -174,12 +174,13 @@
PlaceholderText="Enter the base U.R.L. here..." /> PlaceholderText="Enter the base U.R.L. here..." />
<StackPanel Orientation="Horizontal" Grid.Column="2"> <StackPanel Orientation="Horizontal" Grid.Column="2">
<Button x:Name="RefreshButton" FontFamily="Segoe MDL2 Assets" <ToggleButton x:Name="PlayButton" FontFamily="Segoe MDL2 Assets"
Content="&#xE72C;" Height="79" Width="79" Content="&#xE71A;" Height="79" Width="79"
VerticalAlignment="Center" FontSize="28" VerticalAlignment="Center" FontSize="28"
Margin="0,0,12,0" ToolTipService.Placement="Mouse" Margin="0,0,12,0" ToolTipService.Placement="Mouse"
Click="RefreshButton_Click" IsChecked="False" Unchecked="PlayButton_Unchecked"
ToolTipService.ToolTip="Click to reset the dashboard. It will give the server a moment before it starts receiving requests from this app. again."/> Checked="PlayButton_Checked"
ToolTipService.ToolTip="Click to pause the service. It will give the server a moment before it starts receiving requests from this app. again."/>
<Button x:Name="SaveURLButton" FontFamily="Segoe MDL2 Assets" <Button x:Name="SaveURLButton" FontFamily="Segoe MDL2 Assets"
Content="&#xE74E;" Height="79" Width="79" Content="&#xE74E;" Height="79" Width="79"
VerticalAlignment="Center" FontSize="28" VerticalAlignment="Center" FontSize="28"

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

@ -55,13 +55,23 @@ namespace EyesAndEars.UWP {
_vm.Device5 = await DataServices.UpdateDevice(url, 5); _vm.Device5 = await DataServices.UpdateDevice(url, 5);
_vm.Device6 = await DataServices.UpdateDevice(url, 6); _vm.Device6 = await DataServices.UpdateDevice(url, 6);
} }
else {
IntialiseDataContext();
}
} }
void RefreshButton_Click(object sender, RoutedEventArgs e) =>
IntialiseDataContext();
async void SaveURLButton_Click(object sender, RoutedEventArgs e) { async void SaveURLButton_Click(object sender, RoutedEventArgs e) {
await DataServices.SaveBaseURLAsync(WebAddressBox.Text); await DataServices.SaveBaseURLAsync(WebAddressBox.Text);
} }
void PlayButton_Checked(object sender, RoutedEventArgs e) {
PlayButton.Content = "\uE768";
_dispatcherTimer.Stop();
}
void PlayButton_Unchecked(object sender, RoutedEventArgs e) {
PlayButton.Content = "\uE71A";
_dispatcherTimer.Start();
}
} }
} }

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

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