-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.xaml
46 lines (45 loc) · 2.59 KB
/
MainPage.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
46
<Page
x:Class="BluetoothAudioPlayback.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BluetoothAudioPlayback"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Name="MainGrid" Loaded="MainGrid_Loaded">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ListView x:Name="DeviceListView" ItemsSource="{x:Bind ViewModel.RemoteAudioDevices}" Grid.Row="0" SelectionMode="None" >
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Margin" Value="5,5,5,0" />
<Setter Property="Padding" Value="5,5,5,5" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Black" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:RemoteAudioDeviceModel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image Source="{x:Bind Thumbnail}" Grid.Column="0" HorizontalAlignment="Center" />
<TextBlock Text="{x:Bind DeviceInformation.Name}" FontWeight="Bold" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<ToggleSwitch Grid.Column="2" FlowDirection="LeftToRight" Toggled="EnableToggleSwitch_Toggled" OnContent="Enabled" OffContent="Disabled" />
<ToggleSwitch Grid.Column="3" FlowDirection="LeftToRight" Toggled="ConnectToggleSwitch_Toggled" OnContent="Connected" OffContent="Disconnected" IsEnabled="False" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Page>