Permalink
Browse files

ItemDetailsView appearing

  • Loading branch information...
saraford committed Dec 23, 2017
1 parent 239187a commit 9cc3e537ea7260bdd1ccbc1596ccbd891a03a402
@@ -29,8 +29,8 @@ public App()
// look! no corresponding .xaml file for the tabbed control
var tabbed = new TabbedPage();
tabbed.Children.Add(page1);
tabbed.Children.Add(page2);
tabbed.Children.Add(page1Nav);
tabbed.Children.Add(page2Nav);
MainPage = tabbed;
@@ -1,4 +1,5 @@
using System;
using System.Windows.Input;
using ListViewInTabbedControl.Models;
using MvvmHelpers;
using Xamarin.Forms;
@@ -9,11 +10,18 @@ public class ItemDetailsViewModel : BaseViewModel
{
//private Fabric fabric;
private INavigation Navigation;
public ICommand DoneEditingCommand { get; private set; }
public ItemDetailsViewModel(INavigation Navigation, Fabric fabric)
{
Title = "Hello from Item " + fabric.Name;
this.Navigation = Navigation;
this.Navigation = Navigation;
DoneEditingCommand = new Command(DoneEditing);
}
private async void DoneEditing()
{
await Navigation.PopAsync();
}
}
}
@@ -8,6 +8,7 @@
<Label Text="{Binding Title}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand" />
<Button x:Name="DoneButton" Text="Done" FontSize="Large" Command="{Binding DoneEditingCommand}" HorizontalOptions="Center" VerticalOptions="End"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
@@ -25,7 +25,8 @@ async void Handle_ItemTapped(object sender, Xamarin.Forms.ItemTappedEventArgs e)
if (tappedFabric == null)
return;
await this.Navigation.PushModalAsync(new NavigationPage(new ItemDetailsPage(tappedFabric)));
await this.Navigation.PushAsync(new ItemDetailsPage(tappedFabric));
}
}
}

0 comments on commit 9cc3e53

Please sign in to comment.