How to Use Crosslight to Hide TextField controls at runtime?

7 replies. Last post: May 18, 2014 11:34 PM by Domingo Fugaban
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
How do you use the BindableProperties.IsVisibleProperty with text fields? We are talking about common text fields on UIViewControllers, not the ones used on UIFormViewController. The BindableProperties.TextProperty seems to be working, so the binding isn't the culprit. 

Now, we are also binding the same viewmodel property using BindableProperties.IsVisibleProperty with BUTTONs and seems to be working fine. When we tried to create our own BindableProperty, the visibility is working fine but the TextProperty binding is no longer working. Here's the BindingProvider object.

this.AddBinding("ActivateButton", BindableProperties.CommandProperty, "ActivateCommand");
this.AddBinding("LoginButton", BindableProperties.CommandProperty, "LoginCommand");
var p_CompanyCode = new BindingDescription("CompanyCode", BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged);
var p_UserName = new BindingDescription("UserName", BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged);
var p_Password = new BindingDescription("Password", BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged);
this.AddBinding("CompanyCodeText", BindableProperties.TextProperty, p_CompanyCode);
this.AddBinding("UsernameText", BindableProperties.TextProperty, p_UserName);
this.AddBinding("PasswordText", BindableProperties.TextProperty, p_Password);
var p_ShouldActivate = new BindingDescription("ShouldActivate", BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged);
this.AddBinding("ActivateButton", BindableProperties.IsVisibleProperty, p_ShouldActivate);
this.AddBinding("CompanyCodeText", TextFieldProperties.IsVisibleProperty, p_ShouldActivate);
var p_IsActivated = new BindingDescription("IsActivated", BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged);
this.AddBinding("LoginButton", BindableProperties.IsVisibleProperty, p_IsActivated);
this.AddBinding("UsernameText", TextFieldProperties.IsVisibleProperty, p_IsActivated);
this.AddBinding("PasswordText", TextFieldProperties.IsVisibleProperty, p_IsActivated);

We understand that custom components are not supported, but UITextField isn't. This means that we are not even supposed to be using a custom BindingAdapter nor creating our own BindableProperty just to make this work. So, is there anything else we need to do here?

All times are GMT -5. The time now is 7:59 PM.
Previous Next