Skip to content

Commit

Permalink
#52 HospitalRequestChoseType
Browse files Browse the repository at this point in the history
  • Loading branch information
AcabreraT committed Dec 7, 2017
1 parent 27763cd commit b8069b3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ public bool HospitalAddressesIsEmpty

#region Commands

private Command _chooseHospitalCommand;
public ICommand ChooseHospitalCommand
{
get
{
return _chooseHospitalCommand ??
(_chooseHospitalCommand = new Command(OnChooseHospitalCommand, o => !IsBusy));
}
}

/// <summary>
///
/// </summary>
/// <param name="obj">obj contains the HomeAddressList item tapped</param>
private async void OnChooseHospitalCommand(object obj)
{
var selectedAddress = obj as AddressModel;
await NavigationService.NavigateToAsync<HospitalRequestChooseTypeViewModel>(selectedAddress);
}

private Command _newHospitalAddressCommand;
public ICommand NewHospitalAddressCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
x:Class="AeccApp.Core.Views.HospitalAddressesListView"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:beh="clr-namespace:AeccApp.Core.Behaviors"
xmlns:ctrl="clr-namespace:AeccApp.Core.Controls"
xmlns:ctrlXlabs="clr-namespace:XLabs.Forms.Controls"
xmlns:v="clr-namespace:AeccApp.Core.Views"
Expand Down Expand Up @@ -113,6 +114,12 @@
IsVisible="{Binding HospitalAddressesIsEmpty, Converter={StaticResource InverseBoolConverter}}"
ItemTemplate="{StaticResource hospitalAddressesListTemplate}"
ItemsSource="{Binding HospitalAddressesList}">
<ListView.Behaviors>
<beh:EventToCommandBehavior
Command="{Binding ChooseHospitalCommand}"
EventArgsConverter="{StaticResource ItemTappedEventArgsConverter}"
EventName="ItemTapped" />
</ListView.Behaviors>
<ListView.Header>
<ContentView>
<Label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Label
Grid.Row="0"
Grid.Column="0"
Margin="20,10,0,0"
Margin="20,20,0,0"
FontAttributes="Bold"
FontSize="{StaticResource MediumSize}"
Text="{Binding Name}"
Expand All @@ -37,15 +37,16 @@
<ctrl:CustomImage
Grid.Row="0"
Grid.Column="1"
Margin="0,10,20,0"
HeightRequest="25"
Margin="0,20,20,0"
HeightRequest="17"
HorizontalOptions="End"
SourcePlatform="right_arrow"
WidthRequest="25" />
WidthRequest="9" />

<BoxView
Grid.Row="1"
Grid.ColumnSpan="2"
Margin="0,20,0,0"
HeightRequest="1"
Color="LightGray" />

Expand All @@ -58,7 +59,7 @@
<!-- Header -->
<StackLayout
Padding="35"
BackgroundColor="{StaticResource GreyText}"
BackgroundColor="{StaticResource LightSilver}"
HorizontalOptions="FillAndExpand">

<Grid HorizontalOptions="Center">
Expand Down Expand Up @@ -140,21 +141,22 @@
</Grid.RowDefinitions>
<Label
Grid.Column="0"
Margin="20,10,0,0"
Margin="20,20,0,0"
FontAttributes="Bold"
FontSize="{StaticResource MediumSize}"
Text="{Binding [NewHomeRequestChoseTypeTalkToAnAECCProfesional]}"
TextColor="{StaticResource GreyTextDark}" />
<ctrl:CustomImage
Grid.Column="1"
Margin="0,10,20,0"
HeightRequest="25"
Margin="0,20,20,0"
HeightRequest="17"
HorizontalOptions="End"
SourcePlatform="right_arrow"
WidthRequest="25" />
WidthRequest="9" />
<BoxView
Grid.Row="1"
Grid.ColumnSpan="2"
Margin="0,20,0,0"
HeightRequest="1"
Color="LightGray" />
</Grid>
Expand Down

0 comments on commit b8069b3

Please sign in to comment.