protected override void OnElementChanged(ElementChangedEventArgs <Button> e) { // NOTE: It is imperative that we set the control prior to the base method so that it can do all of the necessary // setup with property bindings. Since we're using a AppCompatButton, we have to mimic the calls that are used // in the base method. if (this.Control == null) { var context = this.Context.GetAppCompatThemedContext(); var control = new AppCompatButton(context); this.SetNativeControl(control); control.SetOnClickListener(ButtonClickListener.Instance); control.Tag = this; this.SetNativeControl(control); control.AddOnAttachStateChangeListener(this); } base.OnElementChanged(e); }
protected override void OnElementChanged(ElementChangedEventArgs<Button> e) { // NOTE: It is imperative that we set the control prior to the base method so that it can do all of the necessary // setup with property bindings. Since we're using a AppCompatButton, we have to mimic the calls that are used // in the base method. if (this.Control == null) { var context = this.Context;//.GetAppCompatThemedContext(); var control = new AppCompatButton(context); this.SetNativeControl(control); control.SetOnClickListener(ButtonClickListener.Instance); control.Tag = this; this.SetNativeControl(control); control.AddOnAttachStateChangeListener(this); } base.OnElementChanged(e); }
private void InitUI() { FindViewById <Button>(Resource.Id.btn_closeit).SetOnClickListener(this); FindViewById <Button>(Resource.Id.btn_save).SetOnClickListener(this); ciwProfileImage = FindViewById <CircleImageView>(Resource.Id.profile_image); tvName = FindViewById <EditText>(Resource.Id.et_name); tvBirthDate = FindViewById <TextView>(Resource.Id.tv_birthdate); tvBirthDate.SetOnClickListener(this); etName = FindViewById <EditText>(Resource.Id.et_name); btnUploadImage = FindViewById <AppCompatButton>(Resource.Id.btn_upload); btnUploadImage.SetOnClickListener(this); btnLabelDiseases = FindViewById <TextView>(Resource.Id.tv_labelDiseases); btnChangeDiseases = FindViewById <AppCompatButton>(Resource.Id.btn_diseases); btnChangeDiseases.SetOnClickListener(this); const string permission = Manifest.Permission.ReadPhoneState; if (CheckSelfPermission(permission) != (int)Permission.Granted) { RequestPermissions(_permissionsArray, 0); } isSavedClick = false; }