File tree Expand file tree Collapse file tree
src/Mobile/eShopOnContainers/eShopOnContainers.Core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using eShopOnContainers . Services ;
1+ using eShopOnContainers . Core ;
2+ using eShopOnContainers . Core . Helpers ;
3+ using eShopOnContainers . Services ;
24using System . Threading . Tasks ;
35
46namespace eShopOnContainers . ViewModels . Base
@@ -28,6 +30,7 @@ public ViewModelBase()
2830 {
2931 DialogService = ViewModelLocator . Instance . Resolve < IDialogService > ( ) ;
3032 NavigationService = ViewModelLocator . Instance . Resolve < INavigationService > ( ) ;
33+ GlobalSetting . Instance . BaseEndpoint = Settings . UrlBase ;
3134 }
3235
3336 public virtual Task InitializeAsync ( object navigationData )
Original file line number Diff line number Diff line change 33using eShopOnContainers . Core . Models . Navigation ;
44using Xamarin . Forms ;
55using eShopOnContainers . Core . ViewModels . Base ;
6+ using System . Windows . Input ;
67
78namespace eShopOnContainers . Core . ViewModels
89{
910 public class MainViewModel : ViewModelBase
10- {
11+ {
12+ public ICommand SettingsCommand => new Command ( Settings ) ;
13+
1114 public override Task InitializeAsync ( object navigationData )
1215 {
1316 IsBusy = true ;
@@ -21,5 +24,10 @@ public override Task InitializeAsync(object navigationData)
2124
2225 return base . InitializeAsync ( navigationData ) ;
2326 }
27+
28+ private void Settings ( )
29+ {
30+ NavigationService . NavigateToAsync < SettingsViewModel > ( ) ;
31+ }
2432 }
2533}
Original file line number Diff line number Diff line change @@ -102,7 +102,6 @@ private void UpdateEndpoint(string endpoint)
102102 {
103103 // Update remote endpoint (save to local storage)
104104 Settings . UrlBase = endpoint ;
105- GlobalSetting . Instance . BaseEndpoint = Settings . UrlBase ;
106105 }
107106 }
108107}
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ public LoginView()
1818
1919 protected override async void OnAppearing ( )
2020 {
21- GlobalSetting . Instance . BaseEndpoint = Settings . UrlBase ;
22-
2321 var content = this . Content ;
2422 this . Content = null ;
2523 this . Content = content ;
Original file line number Diff line number Diff line change 1313 iOS =" eShop on Containers"
1414 WinPhone =" eShop on Containers" />
1515 </TabbedPage .Title>
16+ <ContentPage .ToolbarItems>
17+ <ToolbarItem
18+ Command =" {Binding SettingsCommand}"
19+ Text =" Settings" >
20+ <ToolbarItem .Icon>
21+ <OnPlatform
22+ x : TypeArguments =" FileImageSource"
23+ WinPhone =" Assets/app_settings.png"
24+ Android =" app_settings"
25+ iOS =" app_settings" />
26+ </ToolbarItem .Icon>
27+ </ToolbarItem >
28+ </ContentPage .ToolbarItems>
1629 <!-- CATALOG -->
1730 <views : CatalogView
1831 x : Name =" HomeView" >
You can’t perform that action at this time.
0 commit comments