Commit 3b5c2625 by Javier Piris

Creadas la vista de Historial de preguntas con el viewmodel

parent 46030fad
......@@ -2,7 +2,40 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.Question.HistoryView"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Name="historyView"
Title="Histórico"
Icon="History1">
Icon="History1"
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<ListView x:Name="ListView"
ItemsSource="{Binding HistoryList}"
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>
</ContentPage.Content>
</ContentPage>
\ No newline at end of file
using Xamarin.Forms;
using inutralia.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views.Question
......@@ -6,9 +7,23 @@ namespace inutralia.Views.Question
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HistoryView : ContentPage
{
protected QuestionListViewModel ViewModel => BindingContext as QuestionListViewModel;
public HistoryView()
{
InitializeComponent();
BindingContext = new QuestionListViewModel();
}
protected override async void OnAppearing()
{
base.OnAppearing();
await ViewModel.ExecuteLoadQuestionListCommand();
}
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\QuestionListViewModel.cs" />
<Compile Include="ViewModels\Recipes\RecipeListOptionsViewModel.cs" />
<Compile Include="ViewModels\Menus\MenuBaseViewModel.cs" />
<Compile Include="ViewModels\ModelBasedViewModel.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