public override void ViewDidLoad() { base.ViewDidLoad(); SubscribedSwitch.ValueChanged += delegate { if (SubscribedSwitch.On) { SharedPush.Subscribe(); } else { SharedPush.Unsubscribe(); } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); SharedPush.Initialize(); Switch pushSwitch = FindViewById <Switch>(Resource.Id.pushSwitch); pushSwitch.CheckedChange += delegate { if (pushSwitch.Checked) { SharedPush.Subscribe(); } else { SharedPush.Unsubscribe(); } }; }