|
2 | 2 | x:Class="MvvmSampleUwp.Views.ObservableValidatorPage"
|
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
5 |
| - xmlns:controls="using:MvvmSampleUwp.Controls" |
6 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
7 |
| - xmlns:interactions="using:Microsoft.Xaml.Interactions.Core" |
8 |
| - xmlns:interactivity="using:Microsoft.Xaml.Interactivity" |
9 | 6 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
10 |
| - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" |
| 7 | + xmlns:widgets="using:MvvmSampleUwp.Views.Widgets" |
11 | 8 | NavigationCacheMode="Enabled"
|
12 | 9 | mc:Ignorable="d">
|
13 | 10 |
|
14 | 11 | <ScrollViewer Padding="{StaticResource DocumentationPageContentPadding}" CanContentRenderOutsideBounds="True">
|
15 |
| - <StackPanel Spacing="16"> |
16 |
| - <controls:ValidationTextBox |
17 |
| - DataContext="{x:Bind ViewModel.Form}" |
18 |
| - HeaderText="Enter your first:" |
19 |
| - PlaceholderText="First name" |
20 |
| - PropertyName="FirstName" |
21 |
| - Text="{x:Bind ViewModel.Form.FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
22 |
| - <controls:ValidationTextBox |
23 |
| - DataContext="{x:Bind ViewModel.Form}" |
24 |
| - HeaderText="Enter your last name:" |
25 |
| - PlaceholderText="Last name" |
26 |
| - PropertyName="LastName" |
27 |
| - Text="{x:Bind ViewModel.Form.LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
28 |
| - <controls:ValidationTextBox |
29 |
| - DataContext="{x:Bind ViewModel.Form}" |
30 |
| - HeaderText="Enter your email address:" |
31 |
| - PlaceholderText="Email" |
32 |
| - PropertyName="Email" |
33 |
| - Text="{x:Bind ViewModel.Form.Email, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
34 |
| - <controls:ValidationTextBox |
35 |
| - DataContext="{x:Bind ViewModel.Form}" |
36 |
| - HeaderText="Enter your phone number:" |
37 |
| - PlaceholderText="Phone number" |
38 |
| - PropertyName="PhoneNumber" |
39 |
| - Text="{x:Bind ViewModel.Form.PhoneNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> |
40 |
| - |
41 |
| - <Button Command="{x:Bind ViewModel.Form.SubmitCommand}" Content="Submit" /> |
42 |
| - |
43 |
| - <!-- Popups --> |
44 |
| - <Grid> |
45 |
| - <muxc:InfoBar |
46 |
| - x:Name="SuccessInfoBar" |
47 |
| - Title="Success" |
48 |
| - Message="The form was filled in correctly." |
49 |
| - Severity="Success"> |
50 |
| - <interactivity:Interaction.Behaviors> |
51 |
| - <interactions:EventTriggerBehavior EventName="FormSubmissionCompleted" SourceObject="{x:Bind ViewModel.Form}"> |
52 |
| - <interactions:ChangePropertyAction |
53 |
| - PropertyName="IsOpen" |
54 |
| - TargetObject="{x:Bind SuccessInfoBar}" |
55 |
| - Value="True" /> |
56 |
| - <interactions:ChangePropertyAction |
57 |
| - PropertyName="IsOpen" |
58 |
| - TargetObject="{x:Bind FailureInfoBar}" |
59 |
| - Value="False" /> |
60 |
| - </interactions:EventTriggerBehavior> |
61 |
| - </interactivity:Interaction.Behaviors> |
62 |
| - </muxc:InfoBar> |
63 |
| - <muxc:InfoBar |
64 |
| - x:Name="FailureInfoBar" |
65 |
| - Title="Error" |
66 |
| - Message="The form was filled in with some errors." |
67 |
| - Severity="Error"> |
68 |
| - <muxc:InfoBar.ActionButton> |
69 |
| - <Button Command="{x:Bind ViewModel.Form.ShowErrorsCommand}" Content="Show errors" /> |
70 |
| - </muxc:InfoBar.ActionButton> |
71 |
| - <interactivity:Interaction.Behaviors> |
72 |
| - <interactions:EventTriggerBehavior EventName="FormSubmissionFailed" SourceObject="{x:Bind ViewModel.Form}"> |
73 |
| - <interactions:ChangePropertyAction |
74 |
| - PropertyName="IsOpen" |
75 |
| - TargetObject="{x:Bind SuccessInfoBar}" |
76 |
| - Value="False" /> |
77 |
| - <interactions:ChangePropertyAction |
78 |
| - PropertyName="IsOpen" |
79 |
| - TargetObject="{x:Bind FailureInfoBar}" |
80 |
| - Value="True" /> |
81 |
| - </interactions:EventTriggerBehavior> |
82 |
| - </interactivity:Interaction.Behaviors> |
83 |
| - </muxc:InfoBar> |
84 |
| - </Grid> |
85 |
| - </StackPanel> |
| 12 | + <widgets:ValidationFormWidget DataContext="{x:Bind ViewModel.Form}" /> |
86 | 13 | </ScrollViewer>
|
87 | 14 | </Page>
|
0 commit comments