Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Switch Refreshing Page Error (Hidden Form Data)

$
0
0

Hello!

On my user registration page, I have some hidden fields that I only want to display if the user wants to fill them out. I'm using a Switch to control if these fields are visible or not. As I understand it, dynamic UI changes are not yet implemented in Xamarin Forms, so I'm refreshing the page when the user toggles the Switch. Distilled down, this is whats causing the error:

public class TestPage : ContentPage
{

>

  protected override void OnAppearing ()
  {
      base.OnAppearing ();

>

      var dateTimeSwitch = new Switch ();
      dateTimeSwitch.Toggled += async (object sender, ToggledEventArgs e) => {
          OnAppearing ();
      };

>

      Content = new ScrollView() { Content = dateTimeSwitch };
  }

}

Does anyone know whats going on here, or have a suggestion on a better way to accomplish this?

Thanks!


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>