forked from microsoft/Windows-universal-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScenario3_ServerForeground.xaml
More file actions
82 lines (82 loc) · 4.41 KB
/
Scenario3_ServerForeground.xaml
File metadata and controls
82 lines (82 loc) · 4.41 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!--
//*********************************************************
//
// 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.Scenario3_ServerForeground"
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"
xmlns:local="using:SDKTemplate"
mc:Ignorable="d">
<Page.Resources>
<DataTemplate x:Key="AttributeTemplate" x:DataType="local:BluetoothLEAttributeDisplay">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" MinWidth="100"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" Margin="5">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Bind Name}" Style="{StaticResource ListItemTextStyle}" FontWeight="Bold" TextWrapping="WrapWholeWords"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Bind AttributeDisplayType}" Margin="10,0,0,0"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</DataTemplate>
</Page.Resources>
<ScrollViewer Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Padding="12,10,12,12">
<StackPanel>
<TextBlock Text="Description:" Style="{StaticResource SampleHeaderTextStyle}"/>
<TextBlock Style="{StaticResource ScenarioDescriptionTextStyle}" Text="Publish the calculator service"/>
<TextBlock TextWrapping="Wrap" Margin="0,10,0,0">
This scenario allows the system to publish a calculator service.
Remote clients (including this sample on another machine) can supply 2 operands and an operator and get a result.
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="0,20,0,0">
Valid range for Operand is integer values. Valid range for Operator is 1-4 corresponding to +,-,*,/ respectively.
</TextBlock>
<TextBlock x:Name="PeripheralWarning" TextWrapping="Wrap" Margin="0,10,0,0" Style="{StaticResource BaseTextBlockStyle}" Visibility="Collapsed">
There is no Bluetooth device, or the default Bluetooth device cannot act as a Bluetooth server.
</TextBlock>
<StackPanel x:Name="ServerPanel" Visibility="Collapsed">
<Button x:Name="PublishButton" Content="Start Service" Click="{x:Bind PublishButton_ClickAsync}" Margin="0,5,5,10"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBox x:Name="Operand1Text" Text="0"/>
<TextBlock Text="Operand 1" Margin="10,5,5,5"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="OperationText" Text="+"/>
<TextBlock x:Name="OperationLabel" Text="Operator" Margin="10,5,5,5"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="Operand2Text" Text="0"/>
<TextBlock Text="Operand 2" Margin="10,5,5,5"/>
</StackPanel>
<StackPanel>
<Line Margin="0,5,5,0" StrokeThickness="1" Fill="AntiqueWhite" Height="5" RenderTransformOrigin="0.5,0.5">
</Line>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox x:Name="ResultText" Text="0"/>
<TextBlock Text="Result" Margin="10,5,5,5"/>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Page>