-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathMultiSelect.xaml
188 lines (182 loc) · 9.05 KB
/
MultiSelect.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?xml version="1.0" encoding="UTF-8"?>
<local:SampleView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:local="clr-namespace:SampleBrowser.Core;assembly=SampleBrowser.Core"
xmlns:core="clr-namespace:SampleBrowser.SfAutoComplete"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:listview="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"
xmlns:autocomplete="clr-namespace:Syncfusion.SfAutoComplete.XForms;assembly=Syncfusion.SfAutoComplete.XForms"
xmlns:icon="clr-namespace:SampleBrowser.SfAutoComplete"
x:Class="SampleBrowser.SfAutoComplete.MultiSelect">
<Grid.Resources>
<ResourceDictionary>
<icon:ImageSourceToStringConverter x:Key="imagesourcetoimage"/>
<core:StringToColorConverter x:Key="stringtocolor"/>
<icon:AutoCompleteImageConverter x:Key="AutoCompleteImageConverter" />
<Style TargetType="autocomplete:SfAutoComplete">
<Setter Property="DisplayMemberPath" Value="ContactName"/>
<Setter Property="MultiSelectMode" Value="Token"/>
<Setter Property="DropDownItemHeight" Value="70"/>
<Setter Property="TokensWrapMode" Value="Wrap"/>
<Setter Property="DropDownCornerRadius" Value="4"/>
<Setter Property="DataSource" Value="{Binding ContactData}"/>
<Setter Property="ImageMemberPath" Value="ContactImage"/>
<Setter Property="MaximumDropDownHeight" Value="200"/>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackLayout Padding="15,10"
BackgroundColor="Transparent"
VerticalOptions="Center"
HorizontalOptions="Start"
Orientation="Horizontal">
<Grid>
<Image Source="{Binding ContactType,Converter={StaticResource AutoCompleteImageConverter}}"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="50"
WidthRequest="50"/>
<Image Source="{Binding ContactImage,Converter={StaticResource AutoCompleteImageConverter}}"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="46"
WidthRequest="46"/>
</Grid>
<StackLayout Margin="10,5"
Orientation="Vertical">
<Label Text="{Binding ContactName}" FontSize="18" />
<Label Text="{Binding ContactNumber}" FontSize="12" />
</StackLayout>
</StackLayout>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="autocomplete:TokenSettings" x:Key="tokensettings" >
<Setter Property="DeleteButtonColor" Value="Red"/>
</Style>
</ResourceDictionary>
</Grid.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid BackgroundColor="#2A4D72"
HeightRequest="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Margin="10,0"
Text="Email - Compose"
FontAttributes="Bold"
VerticalOptions="Center"
TextColor="White"/>
<Label Grid.Column="1"
Margin="10,0"
Text="ATTACH"
FontAttributes="Bold"
VerticalOptions="Center"
TextColor="White"/>
<Label Grid.Column="2"
Text="SEND"
Margin="10,0"
FontAttributes="Bold"
VerticalOptions="Center"
TextColor="White"/>
</Grid>
<Grid Grid.Row="1"
Margin="10,0,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="To"
FontSize="20"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<Label Grid.Row="1"
FontSize="20"
VerticalOptions="Center"
HorizontalOptions="Center"
Text="Cc"/>
<Label Grid.Row="2"
FontSize="20"
VerticalOptions="Center"
HorizontalOptions="Center"
Text="Bcc"/>
<autocomplete:SfAutoComplete x:Name="autocomplete" Grid.Column="1"
IsFocused="{Binding IsToFocused , Mode=TwoWay}"
AutoCompleteMode="Suggest"
Text="{Binding CustomText}"
DropDownClosing="autocomplete_DropDownClosing"
IsSelectedItemsVisibleInDropDown="false"
Watermark="{Binding Watermark}"
SelectedItem="{Binding SelectedItem}"
HeightRequest="{Binding ToHeight}" >
</autocomplete:SfAutoComplete>
<autocomplete:SfAutoComplete Grid.Row="1"
x:Name="autocomplete2"
Grid.Column="1"
IsSelectedItemsVisibleInDropDown="false"
IsFocused="{Binding IsCcFocused, Mode=TwoWay}"
HeightRequest="{Binding CcHeight}"
DropDownClosing="autocomplete_DropDownClosing"
/>
<autocomplete:SfAutoComplete Grid.Row="2"
x:Name="autocomplete3"
Grid.Column="1"
IsSelectedItemsVisibleInDropDown="false"
IsFocused="{Binding IsBccFocused, Mode=TwoWay}"
HeightRequest="{Binding BccHeight}"
DropDownClosing="autocomplete_DropDownClosing"
/>
</Grid>
<ScrollView x:Name="scrollView" Grid.Row="2" Scrolled="ScrollView_Scrolled">
<Grid Margin="10,0,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Entry Margin="5,0,0,0"
Placeholder="Subject"
FontSize="15"/>
<Editor Margin="5,10"
FontSize="12"
Grid.Row="1"
Text="Sent from my smartphone."/>
</Grid>
</ScrollView>
</Grid>
<local:SampleView.PropertyView>
<OnPlatform x:TypeArguments="View">
<On Platform="Android,iOS">
<StackLayout>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Label x:Name="closeDropdownOnSelectionLabel"
Text="Close dropdown on selection"
Grid.Column="0"
Margin="0,15,0,0"
TextColor="#666666"
FontSize="16" />
<Switch Grid.Column="1"
Margin="0,15,0,0"
IsToggled="False"
Toggled="closeDropdownOnSelection_Toggled"/>
</Grid>
</StackLayout>
</On>
</OnPlatform>
</local:SampleView.PropertyView>
</local:SampleView>