private void OnBindingContextChanged(object sender, EventArgs eventArgs)
        {
            var vm = BindingContext as ContentContainerViewModel;

            if (vm == null)
            {
                return;
            }
            _vm = vm;
            BindingContextChanged -= OnBindingContextChanged;
        }
Esempio n. 2
0
        private readonly ContentContainerViewModel _contentContainer; // content container needed to open location selection after clearing settings

        public SettingsPageViewModel(IAnalyticsService analyticsService, INavigator navigator,
                                     ContentContainerViewModel contentContainer, DataLoaderProvider dataLoaderProvider
                                     , IViewFactory viewFactory, Func <string, GeneralWebViewPageViewModel> generalWebViewFactory) : base(
                analyticsService, dataLoaderProvider)
        {
            _navigator             = navigator;
            _contentContainer      = contentContainer;
            _generalWebViewFactory = generalWebViewFactory;
            HtmlRawViewCommand     = new Command(HtmlRawView);

            Title                      = AppResources.Settings;
            ClearCacheCommand          = new Command(ClearCache);
            ResetSettingsCommand       = new Command(ResetSettings);
            OpenDisclaimerCommand      = new Command(OpenDisclaimer);
            SwitchRefreshOptionCommand = new Command(SwitchRefreshOption);
            UpdateCacheSizeText();

            _tapCount = 0;
            OnRefresh();
        }