Commit d5f2ac47 by Javier Piris

Creadas vistas de history y pending questions

parent dcbebebc
......@@ -9,8 +9,33 @@
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<ListView x:Name="ListView"
ItemsSource="{Binding HistoryList}"
<StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Frame Margin="0,0,0,8" Padding="14,14,14,14" BackgroundColor="{DynamicResource AccentColor}">
<StackLayout Orientation="Horizontal" VerticalOptions="FillAndExpand" HorizontalOptions="CenterAndExpand">
<Label Text="Listado de histórico de consultas" HorizontalOptions="FillAndExpand" VerticalOptions="Center" TextColor="White">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double"
iOS="20"
Android="18"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double"
iOS="40"
Android="30"/>
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
</StackLayout>
</Frame>
<StackLayout VerticalOptions="FillAndExpand" Margin="15,15" Padding="0,15,0,15">
<ListView x:Name="ListView"
ItemsSource="{Binding QuestionList}"
ItemTapped="ItemTapped"
IsPullToRefreshEnabled="True"
IsRefreshing="{Binding Busy, Mode=TwoWay}"
......@@ -20,22 +45,24 @@
HasUnevenRows="False"
Margin="10,10">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="0,10,0,10" VerticalOptions="CenterAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="0,10,0,10" VerticalOptions="CenterAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackLayout>
<Label Text="{Binding Text}" FontSize="Medium"/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackLayout>
<Label Text="{Binding Text}" FontSize="Medium"/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>
\ No newline at end of file
using inutralia.ViewModels;
using inutralia.Models;
using inutralia.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
......@@ -15,15 +16,29 @@ namespace inutralia.Views.Question
BindingContext = new QuestionListViewModel();
}
protected override async void OnAppearing()
protected async void ItemTapped(object sender, ItemTappedEventArgs e)
{
base.OnAppearing();
await ViewModel.ExecuteLoadQuestionListCommand();
var respon = e.Item as QuestionSpecialist;
if (respon.StatusImg == "Respondida")
{
await DisplayAlert("ERROR", "La pregunta ya está respondida", "Entendido");
}
else
{
await Navigation.PushAsync(
new PendingReadView()
{
BindingContext = new PendingReadViewModel((QuestionSpecialist)e.Item)
}
);
((ListView)sender).SelectedItem = null;
}
}
void ItemTapped(object sender, ItemTappedEventArgs e)
protected override async void OnAppearing()
{
((ListView)sender).SelectedItem = null;
base.OnAppearing();
await ViewModel.ExecuteLoadQuestionListCommand();
}
}
}
\ No newline at end of file
......@@ -2,7 +2,67 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.Question.PendingReadView"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
Title="Pendientes de leer"
Icon="pendiente">
Icon="pendiente"
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Frame Margin="0,0,0,8" Padding="14,14,14,14" BackgroundColor="{DynamicResource AccentColor}">
<StackLayout Orientation="Horizontal" VerticalOptions="FillAndExpand" HorizontalOptions="CenterAndExpand">
<Label Text="Consultas pendientes de contestar" HorizontalOptions="FillAndExpand" VerticalOptions="Center" TextColor="White">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double"
iOS="20"
Android="18"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double"
iOS="40"
Android="30"/>
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
</StackLayout>
</Frame>
<StackLayout VerticalOptions="FillAndExpand" Margin="15,15" Padding="0,15,0,15">
<ListView x:Name="ListView"
ItemsSource="{Binding }"
ItemTapped="ItemTapped"
IsPullToRefreshEnabled="True"
IsRefreshing="{Binding Busy, Mode=TwoWay}"
BackgroundColor="Transparent"
Footer=""
CachingStrategy="RecycleElement"
HasUnevenRows="False"
Margin="10,10">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="0,10,0,10" VerticalOptions="CenterAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackLayout>
<Label Text="{Binding Text}" FontSize="Medium"/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>
\ No newline at end of file
using Xamarin.Forms;
using inutralia.Models;
using inutralia.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views.Question
......@@ -6,9 +8,19 @@ namespace inutralia.Views.Question
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class PendingReadView : ContentPage
{
protected PendingReadViewModel ViewModel => BindingContext as PendingReadViewModel;
public QuestionSpecialist QuestionSpecialist { private set; get; }
public PendingReadView()
{
InitializeComponent();
BindingContext = new PendingReadViewModel();
}
protected void ItemTapped(object sender, ItemTappedEventArgs e)
{
((ListView)sender).SelectedItem = null;
}
}
}
\ No newline at end of file
......@@ -44,6 +44,7 @@
</Compile>
<Compile Include="ViewModels\Menus\CustomMenuViewModel.cs" />
<Compile Include="ViewModels\Menus\RecipeListViewModel.cs" />
<Compile Include="ViewModels\QuestionsSpecialist\PendingReadViewModel.cs" />
<Compile Include="ViewModels\QuestionsSpecialist\QuestionListViewModel.cs" />
<Compile Include="ViewModels\Recipes\RecipeListOptionsViewModel.cs" />
<Compile Include="ViewModels\Menus\MenuBaseViewModel.cs" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment