Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
[Controls] Add demo repo for #5466
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarinho committed Mar 14, 2019
1 parent e4449e0 commit f26570a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Xamarin.Forms.Controls/XamStore/StoreShell.xaml.cs
Expand Up @@ -12,12 +12,13 @@ namespace Xamarin.Forms.Controls.XamStore
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class StoreShell : Shell
{
public StoreShell ()
{
InitializeComponent ();
public StoreShell ()
{
InitializeComponent ();

CurrentItem = _storeItem;
}
CurrentItem = _storeItem;
Routing.RegisterRoute("demo", typeof(DemoShellPage));
}

//bool allow = false;

Expand Down
5 changes: 4 additions & 1 deletion Xamarin.Forms.Controls/XamStore/Views/DemoShellPage.xaml
Expand Up @@ -2,7 +2,7 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Xamarin.Forms.Controls.XamStore;assembly=Xamarin.Forms.Controls"
x:Class="Xamarin.Forms.Controls.XamStore.DemoShellPage" Title="{Binding Title}">
x:Class="Xamarin.Forms.Controls.XamStore.DemoShellPage" Title="{Binding Title}" Padding="50">

<ContentPage.Resources>
<StyleSheet Source="../Styles/Global.css"/>
Expand All @@ -15,6 +15,9 @@
<ContentPage.ToolbarItems>
<ToolbarItem Name="SearchButton" Order="Primary" Icon="icon_search.png" Priority="0" Command="{Binding SearchCommand}" />
</ContentPage.ToolbarItems>
<Shell.BackButtonBehavior>
<BackButtonBehavior TextOverride="Cancel"></BackButtonBehavior>
</Shell.BackButtonBehavior>
<ContentPage.Content>
<RelativeLayout>
<StackLayout
Expand Down
14 changes: 14 additions & 0 deletions Xamarin.Forms.Controls/XamStore/Views/DemoShellPage.xaml.cs
Expand Up @@ -117,6 +117,20 @@ public bool IsBookmarkedTabSelected
}
}

private string _id;
public string Id
{
get
{
return _id;
}
set
{
_id = value;
OnPropertyChanged(nameof(Id));
}
}

public HomeViewModel()
{
IsBusy = false;
Expand Down
4 changes: 3 additions & 1 deletion Xamarin.Forms.Controls/XamStore/Views/StorePages.cs
Expand Up @@ -209,7 +209,9 @@ public BasePage(string title, Color tint)
Navigation.PushAsync(page);
}),
2, 14);

grid.Children.Add(MakeButton("Navigate to 'demo' route",
async () => await Shell.CurrentShell.GoToAsync("demo", true)),
0, 15);

Content = new ScrollView { Content = grid };

Expand Down

0 comments on commit f26570a

Please sign in to comment.