Skip to content

Commit 22f40ac

Browse files
committed
Add AdvancedEntryPage
1 parent 9675942 commit 22f40ac

File tree

9 files changed

+157
-27
lines changed

9 files changed

+157
-27
lines changed

InputKit.sln

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2525
EndProject
2626
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sandbox", "sandbox", "{AD673FBF-AF29-4156-B7FB-D9AF738D875D}"
2727
EndProject
28-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SandboxMAUI", "sandbox\SandboxMAUI\SandboxMAUI.csproj", "{2673366B-4B8D-4110-882A-3DFCF983A2C2}"
28+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SandboxMAUI", "sandbox\SandboxMAUI\SandboxMAUI.csproj", "{2673366B-4B8D-4110-882A-3DFCF983A2C2}"
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04AF3245-D32D-4A16-9136-654E69D8E98A}"
3131
EndProject
3232
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InputKit", "src\InputKit\InputKit.csproj", "{191AC748-4547-49B3-8AE2-37EF12DABDD4}"
3333
EndProject
34-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InputKit", "InputKit\InputKit.csproj", "{47A0773B-E453-4BA2-922B-91F5A97810CB}"
34+
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "InputKit", "InputKit\InputKit.csproj", "{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}"
3535
EndProject
3636
Global
3737
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -109,38 +109,38 @@ Global
109109
{191AC748-4547-49B3-8AE2-37EF12DABDD4}.Release|iPhone.Build.0 = Release|Any CPU
110110
{191AC748-4547-49B3-8AE2-37EF12DABDD4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
111111
{191AC748-4547-49B3-8AE2-37EF12DABDD4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
112-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
113-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
114-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
115-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
116-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
117-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
118-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
119-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.AppStore|Any CPU.Build.0 = Debug|Any CPU
120-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
121-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.AppStore|iPhone.Build.0 = Debug|Any CPU
122-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
123-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
124-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
125-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
126-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
127-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Debug|iPhone.Build.0 = Debug|Any CPU
128-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
129-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
130-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
131-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Release|Any CPU.Build.0 = Release|Any CPU
132-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Release|iPhone.ActiveCfg = Release|Any CPU
133-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Release|iPhone.Build.0 = Release|Any CPU
134-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
135-
{47A0773B-E453-4BA2-922B-91F5A97810CB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
112+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
113+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
114+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
115+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
116+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
117+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
118+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
119+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.AppStore|Any CPU.Build.0 = Debug|Any CPU
120+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
121+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.AppStore|iPhone.Build.0 = Debug|Any CPU
122+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
123+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
124+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
125+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
126+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
127+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Debug|iPhone.Build.0 = Debug|Any CPU
128+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
129+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
130+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
131+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Release|Any CPU.Build.0 = Release|Any CPU
132+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Release|iPhone.ActiveCfg = Release|Any CPU
133+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Release|iPhone.Build.0 = Release|Any CPU
134+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
135+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
136136
EndGlobalSection
137137
GlobalSection(SolutionProperties) = preSolution
138138
HideSolutionNode = FALSE
139139
EndGlobalSection
140140
GlobalSection(NestedProjects) = preSolution
141141
{2673366B-4B8D-4110-882A-3DFCF983A2C2} = {AD673FBF-AF29-4156-B7FB-D9AF738D875D}
142142
{191AC748-4547-49B3-8AE2-37EF12DABDD4} = {04AF3245-D32D-4A16-9136-654E69D8E98A}
143-
{47A0773B-E453-4BA2-922B-91F5A97810CB} = {12D59882-9FD8-4526-971D-CCFCB5FE6E9D}
143+
{DEB29FCB-0AD4-4116-A7C5-DAD8A012F9CB} = {12D59882-9FD8-4526-971D-CCFCB5FE6E9D}
144144
EndGlobalSection
145145
GlobalSection(ExtensibilityGlobals) = postSolution
146146
SolutionGuid = {526E41CC-02ED-4091-94D9-0EF473430852}

sandbox/SandboxMAUI/MainPage.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
<Button Text="Radio Button" Clicked="GoToRadioButtonPage" />
1515

16+
<Button Text="Advanced Entry &amp; FormView" Clicked="GoToAdvancedEntryPage" />
17+
1618
</StackLayout>
1719
</ScrollView>
1820
</ContentPage>

sandbox/SandboxMAUI/MainPage.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ async void GoToRadioButtonPage(System.Object sender, System.EventArgs e)
2121
{
2222
await Navigation.PushAsync(new RadioButtonPage());
2323
}
24+
25+
async void GoToAdvancedEntryPage(System.Object sender, System.EventArgs e)
26+
{
27+
await Navigation.PushAsync(new AdvancedEntryPage());
28+
}
2429
}
2530
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:input="clr-namespace:InputKit.Shared.Controls;assembly=InputKit"
5+
xmlns:vm="clr-namespace:SandboxMAUI.ViewModels"
6+
x:Class="SandboxMAUI.Pages.AdvancedEntryPage"
7+
Title="AdvancedEntryPage"
8+
BackgroundColor="White">
9+
<ContentPage.BindingContext>
10+
<vm:AdvancedEntryPageViewModel />
11+
</ContentPage.BindingContext>
12+
<ScrollView>
13+
<StackLayout Padding="30">
14+
<Label Text="You can see FormView Below:" />
15+
<BoxView HeightRequest="1" Color="LightGray" />
16+
<input:FormView IsValidated="{Binding IsValidated}">
17+
18+
<input:AdvancedEntry
19+
Title="Place your email below:"
20+
Annotation="Email"
21+
AnnotationColor="{StaticResource PrimaryColor}"
22+
IconImage="email.png"
23+
IsRequired="True"
24+
MaxLength="50"
25+
MinLength="10"
26+
Placeholder="[email protected]"
27+
Text="{Binding Email}"
28+
TextColor="Black"
29+
ValidationMessage="Please type a valid email address"
30+
ValidationPosition="Before" />
31+
32+
<input:AdvancedEntry
33+
Title="Place your name below:"
34+
Annotation="NonDigitsOnly"
35+
AnnotationColor="{StaticResource PrimaryColor}"
36+
IconImage="account.png"
37+
IsRequired="True"
38+
MaxLength="30"
39+
MinLength="5"
40+
Placeholder="John Doe"
41+
Text="{Binding NameSurname}"
42+
TextColor="Black"
43+
ValidationMessage="Please type your name correctly"
44+
ValidationPosition="After" />
45+
46+
<input:AdvancedEntry
47+
Title="Place your phone number below:"
48+
Annotation="Phone"
49+
AnnotationColor="{StaticResource PrimaryColor}"
50+
IconImage="phone.png"
51+
IsRequired="True"
52+
MaxLength="10"
53+
MinLength="8"
54+
Placeholder="5439998877"
55+
Text="{Binding Phone}"
56+
TextColor="Black"
57+
ValidationMessage="Please type your phone number correctly" />
58+
<Label Text="Choose your subscription type:" />
59+
<input:RadioButtonGroupView IsRequired="True">
60+
<input:RadioButton Text="Free" />
61+
<input:RadioButton Text="Bronze" />
62+
<input:RadioButton Text="Gold" />
63+
<input:RadioButton Text="Platinium" />
64+
</input:RadioButtonGroupView>
65+
66+
<input:CheckBox
67+
IsRequired="True"
68+
Text="I Accept User Agreement"
69+
Type="Material" />
70+
<Button
71+
Margin="0,20"
72+
BackgroundColor="{StaticResource PrimaryColor}"
73+
Command="{Binding SubmitCommand}"
74+
CornerRadius="20"
75+
Text="Submit"
76+
TextColor="White" />
77+
</input:FormView>
78+
</StackLayout>
79+
</ScrollView>
80+
</ContentPage>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Microsoft.Maui.Controls;
2+
3+
namespace SandboxMAUI.Pages;
4+
5+
public partial class AdvancedEntryPage : ContentPage
6+
{
7+
public AdvancedEntryPage()
8+
{
9+
InitializeComponent();
10+
}
11+
}
440 Bytes
Loading
466 Bytes
Loading
495 Bytes
Loading
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using Microsoft.Maui.Controls;
3+
4+
namespace SandboxMAUI.ViewModels;
5+
6+
public class AdvancedEntryPageViewModel : BindableObject
7+
{
8+
private string _nameSurname;
9+
private string _email;
10+
private string _phone;
11+
12+
public AdvancedEntryPageViewModel()
13+
{
14+
SubmitCommand = new Command(Submit);
15+
}
16+
public Command SubmitCommand { get; set; }
17+
public bool IsValidated { get; set; }
18+
public string NameSurname { get => _nameSurname; set { _nameSurname = value; OnPropertyChanged(); } }
19+
public string Email { get => _email; set { _email = value; OnPropertyChanged(); } }
20+
public string Phone { get => _phone; set { _phone = value; OnPropertyChanged(); } }
21+
22+
async void Submit()
23+
{
24+
if (!IsValidated)
25+
{
26+
await Application.Current.MainPage.DisplayAlert("", "You must fill all areas correctly!", "OK");
27+
}
28+
29+
//DO SOME STUFFS HERE
30+
}
31+
}
32+

0 commit comments

Comments
 (0)