Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Changed sample code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
kseveri-objectsystems committed Mar 4, 2020
1 parent 083b604 commit a20b8d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 0 additions & 9 deletions samples/src/PopupPluginSample/ViewModels/PopupViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public PopupViewModel(INavigationService navigationService)
System.Diagnostics.Debug.WriteLine( "Hello from the PopupViewViewModel" );
_navigationService = navigationService;
NavigateBackCommand = new DelegateCommand( OnNavigateBackCommandExecuted );
NavigateToCommand = new DelegateCommand<string>(OnNavigateToCommandExecuted);
}

private string _message;
Expand All @@ -26,8 +25,6 @@ public string Message

public DelegateCommand NavigateBackCommand { get; }

public DelegateCommand<string> NavigateToCommand { get; }

public void OnNavigatingTo(INavigationParameters parameters)
{
System.Diagnostics.Debug.WriteLine( $"{GetType().Name} Navigating To" );
Expand All @@ -54,11 +51,5 @@ await _navigationService.GoBackAsync(new NavigationParameters{
{ "message", "Hello from the Popup View" }
});
}

private async void OnNavigateToCommandExecuted(string navPath)
{
await _navigationService.GoBackToRootAsync();
await _navigationService.NavigateAsync(navPath);
}
}
}
5 changes: 2 additions & 3 deletions samples/src/PopupPluginSample/Views/PopupView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<popup:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:popup="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
xmlns:prism="http://prismlibrary.com"
prism:ViewModelLocator.AutowireViewModel="True"
Padding="100"
x:Class="PopupPluginSample.Views.PopupView">
Expand All @@ -14,7 +14,6 @@
<Label Text="{Binding Message}" />
<Button Text="Navigate Back" Command="{Binding NavigateBackCommand}" />
<Button Text="Navigate to Menu Page"
Command="{Binding NavigateToCommand}"
CommandParameter="MenuPage" />
Command="{prism:NavigateTo '/MenuPage'}" />
</StackLayout>
</popup:PopupPage>

0 comments on commit a20b8d2

Please sign in to comment.