This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathFormsFlyout.xaml
85 lines (75 loc) · 2.77 KB
/
FormsFlyout.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
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
83
84
85
<UserControl
x:Class="Xamarin.Forms.Platform.UWP.FormsFlyout"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Xamarin.Forms.Platform.UAP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<UserControl.Resources>
<ResourceDictionary>
<Style x:Key="ActionTitle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">
<Setter Property="FontSize" Value="18"/>
<Setter Property="MaxLines" Value="2"/>
</Style>
<Style x:Key="ActionButton" TargetType="Button">
<Setter Property="Height" Value="32" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Margin" Value="5,0,0,0" />
</Style>
<Style x:Key="LeftActionButton" TargetType="Button" BasedOn="{StaticResource ActionButton}">
<Setter Property="Margin" Value="0,0,5,0"/>
</Style>
<Style x:Key="ActionSheetList" TargetType="ListView">
<Setter Property="Margin" Value="0,10,0,10"/>
<Setter Property="IsItemClickEnabled" Value="true"/>
<Setter Property="SelectionMode" Value="None" />
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListViewItem">
<Setter Property="Margin" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding}" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontSize="16" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="TitleBlock" Style="{StaticResource ActionTitle}"/>
<ListView x:Name="OptionsList" Grid.Row="1"
Style="{StaticResource ActionSheetList}"
ItemClick="ListItemSelected" />
</Grid>
<Grid Grid.Row="1" VerticalAlignment="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="LeftBtn" Grid.Column="0"
Style="{StaticResource LeftActionButton}"
Click="ActionButtonClicked"/>
<Button x:Name="RightBtn" Grid.Column="1"
Style="{StaticResource ActionButton}"
Click="ActionButtonClicked"/>
</Grid>
</Grid>
</UserControl>