async protected override void OnAppearing()
        {
            Console.WriteLine("Connected Client APPEARING");

            // Restore values.  Ensures config != null.
            if (!PersistenceSerializer.TryFetchConfig(out config))
            {
                config = new PiHoleConfig();
            }

            // Hide Radio Buttons if there is no backup server set
            if (config.BackupUri == "")
            {
                radioButtons.IsVisible = false;
            }
            else
            {
                radioButtons.IsVisible = true;
            }

            // Auto Refresh if we have a primary URL
            if ((isBackupSelected && config.BackupApiKey != "") || config.PrimaryApiKey != "")
            {
                await DoRefresh(showError : false);
            }
        }
        async protected override void OnAppearing()
        {
            base.OnAppearing();
            Console.WriteLine("DASHBOARD APPEARING!");

            // Restore values. Ensures config != null
            if (!PersistenceSerializer.TryFetchConfig(out config))
            {
                config = new PiHoleConfig();
            }

            DisplayRightCachedValue();

            // Refresh
            OnPropertyChanged(nameof(config));

            // Hide Radio Buttons if there is no backup server set
            if (config.BackupUri == "")
            {
                radioButtons.IsVisible = false;
            }
            else
            {
                radioButtons.IsVisible = true;
            }

            if ((isBackupSelected && config.BackupUri != "") || config.PrimaryUri != "")
            {
                await DoRefresh(showError : false);
            }
        }
Ejemplo n.º 3
0
        protected override void OnAppearing()
        {
            Console.WriteLine("Settings APPEARING");

            // Restore values. Ensures non null.
            if (!PersistenceSerializer.TryFetchConfig(out config))
            {
                config = new PiHoleConfig();
            }

            // Hide Radio Buttons if there is no backup server set
            if (config.BackupUri == "")
            {
                radioButtons.IsVisible = false;
            }
            else
            {
                radioButtons.IsVisible = true;
            }
        }
Ejemplo n.º 4
0
        public NewItemPage()
        {
            InitializeComponent();
            BindingContext = this;

            // Restore values
            if (!PersistenceSerializer.TryFetchConfig(out config))
            {
                config = new PiHoleConfig();
            }

            UriLabel.Text    = config.PrimaryUri;
            ApiKeyLabel.Text = config.PrimaryApiKey;

            // Refresh Button
            var refresh = new TapGestureRecognizer();

            refresh.Tapped += async(s, e) => await Github_Clicked();

            github.GestureRecognizers.Add(refresh);
        }