Пример #1
0
		private void setup()
		{
			var ns = new NavigationService(this, Resource.Id.content_frame);
			navService = ns;

			ns.RegisterFragment<ISettingsViewModel, SettingsFragment>();
			ns.RegisterFragment<ILoginViewModel, LoginFragment>();
			ns.RegisterFragment<IHomeViewModel, HomeFragment>();

			ViewModelLocator.Container.RegisterInstance<INavigationService>(navService);
			var container = ViewModelLocator.Container;

			ISharedPreferences prefs =  PreferenceManager.GetDefaultSharedPreferences(this);
			var settings = new AppSettings(prefs);
			settings.ServerUrl = null;

			container.RegisterInstance<ISettings>(settings);

			vm = container.Resolve<IShellViewModel>();
			vm.PropertyChanged += vmPropertyChanged;
		}