forked from microsoft/Windows-universal-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScenario2_SampleBackgroundTaskWithCondition.xaml
45 lines (44 loc) · 2.53 KB
/
Scenario2_SampleBackgroundTaskWithCondition.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
x:Class="SDKTemplate.SampleBackgroundTaskWithCondition"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="12,20,12,12">
<ScrollViewer VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel>
<TextBlock Text="Description:" Style="{StaticResource SampleHeaderTextStyle}"/>
<TextBlock Style="{StaticResource ScenarioDescriptionTextStyle}" TextWrapping="Wrap">
Registers a background task for the Time Zone Change system event and
the Internet Available system condition. The background task runs
whenever the Time Zone changes if there is an available internet
connection. The task will be canceled if the internet connection is
disconnected while the background task is running.
</TextBlock>
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal" Margin="0,10,0,10">
<Button x:Name="RegisterButton" Content="Register" Click="RegisterBackgroundTask" Margin="0,0,10,0"/>
<Button x:Name="UnregisterButton" Content="Unregister" Click="UnregisterBackgroundTask"/>
</StackPanel>
<StackPanel>
<TextBlock x:Name="Status" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text="Unregistered"/>
<TextBlock x:Name="Progress" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Text=""/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</Page>