-
Notifications
You must be signed in to change notification settings - Fork 342
/
SetFocusOnEntryCompletedBehaviorPage.xaml
46 lines (39 loc) · 2 KB
/
SetFocusOnEntryCompletedBehaviorPage.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
<?xml version="1.0" encoding="utf-8" ?>
<pages:BasePage
x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.SetFocusOnEntryCompletedBehaviorPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:pages="clr-namespace:CommunityToolkit.Maui.Sample.Pages"
xmlns:vm="clr-namespace:CommunityToolkit.Maui.Sample.ViewModels.Behaviors"
x:DataType="vm:SetFocusOnEntryCompletedBehaviorViewModel"
x:TypeArguments="vm:SetFocusOnEntryCompletedBehaviorViewModel">
<VerticalStackLayout Spacing="12" VerticalOptions="Start">
<VerticalStackLayout.Resources>
<ResourceDictionary>
<Style TargetType="Entry">
<Setter Property="BackgroundColor" Value="{StaticResource PrimaryColor}" />
<Setter Property="PlaceholderColor" Value="{StaticResource NormalLabelTextColor}" />
<Setter Property="TextColor" Value="{StaticResource DarkLabelTextColor}" />
</Style>
</ResourceDictionary>
</VerticalStackLayout.Resources>
<Label Margin="0,10" Text="The SetFocusOnEntryCompletedBehavior is an attached property for entries that allows the user to specify which VisualElement should gain focus after the user completes that entry." />
<Entry
x:Name="Entry1"
mct:SetFocusOnEntryCompletedBehavior.NextElement="{x:Reference Entry2}"
Placeholder="Entry 1 (Tap `Next` or `Enter` or `Return` when finished)"
ReturnType="Next" />
<Entry
x:Name="Entry2"
mct:SetFocusOnEntryCompletedBehavior.NextElement="{x:Reference Entry3}"
Placeholder="Entry 2 (Tap `Next` or `Enter` or `Return` on the keyboard when finished)"
ReturnType="Next" />
<Entry
x:Name="Entry3"
mct:SetFocusOnEntryCompletedBehavior.NextElement="{x:Reference Entry4}"
Placeholder="Entry 3 (Tap `Next` or `Enter` or `Return` on the keyboard when finished)"
ReturnType="Next" />
<Entry x:Name="Entry4" Placeholder="Entry 4 (no next entry this time)" />
</VerticalStackLayout>
</pages:BasePage>