|
|
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
|
|
x:Class="Justice.Views.AddContactPage"
|
|
|
|
Title="Emergency Contacts">
|
|
|
|
|
|
|
|
<StackLayout Padding="20">
|
|
|
|
<!-- Input Fields -->
|
|
|
|
<Label Text="Name" FontSize="Medium" />
|
|
|
|
<Entry x:Name="NameEntry" Placeholder="Enter name" />
|
|
|
|
|
|
|
|
<Label Text="Mobile Number" FontSize="Medium" />
|
|
|
|
<Entry x:Name="MobileNumberEntry" Placeholder="Enter mobile number" Keyboard="Telephone" />
|
|
|
|
|
|
|
|
<Label Text="Group" FontSize="Medium" />
|
|
|
|
<Picker x:Name="GroupPicker">
|
|
|
|
<Picker.ItemsSource>
|
|
|
|
<x:Array Type="{x:Type x:String}">
|
|
|
|
<x:String>Parents</x:String>
|
|
|
|
<x:String>Friends</x:String>
|
|
|
|
<x:String>Authority</x:String>
|
|
|
|
</x:Array>
|
|
|
|
</Picker.ItemsSource>
|
|
|
|
</Picker>
|
|
|
|
|
|
|
|
<!-- Save Button -->
|
|
|
|
<Button Text="Save Contact" Clicked="OnSaveContactClicked" />
|
|
|
|
|
|
|
|
<!-- List of Saved Contacts -->
|
|
|
|
<Label Text="Saved Contacts" FontSize="Medium" Margin="0,20,0,10" />
|
|
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Label Text="Name" FontSize="Medium" Grid.Column="0"/>
|
|
|
|
<Label Text="Number" FontSize="Medium" Grid.Column="1"/>
|
|
|
|
<Label Text="Group" FontSize="Medium" Grid.Column="2"/>
|
|
|
|
<Label FontSize="Medium" Grid.Column="3"/>
|
|
|
|
</Grid>
|
|
|
|
<ListView x:Name="ContactsListView"
|
|
|
|
VerticalOptions="FillAndExpand"
|
|
|
|
HasUnevenRows="True">
|
|
|
|
<ListView.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<ViewCell>
|
|
|
|
<StackLayout Orientation="Vertical" Padding="10">
|
|
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Label Text="{Binding Name}" FontSize="Medium" Grid.Column="0"/>
|
|
|
|
<Label Text="{Binding MobileNumber}" FontSize="Small" Grid.Column="1"/>
|
|
|
|
<Label Text="{Binding Group}" FontSize="Small" Grid.Column="2"/>
|
|
|
|
<Button Text="Delete"
|
|
|
|
Grid.Column="3"
|
|
|
|
TextColor="LightGray"
|
|
|
|
Clicked="OnDeleteContactClicked"
|
|
|
|
CommandParameter="{Binding .}" />
|
|
|
|
</Grid>
|
|
|
|
</StackLayout>
|
|
|
|
</ViewCell>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
</ListView>
|
|
|
|
</StackLayout>
|
|
|
|
</ContentPage>
|