iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have a simple Button on a View, and in the core have it bound to a ActionPresenter that shows up asking what you want to do with that button. Once the user makes a selection, how in the world can I hide the button?
I have tried to setup a service using IMobileComponentService to access the native but the issue is the button is not static, so I'm unable to set Button.hide = true;. This is something I will need to access and can't figure out how to do this.
If I do something like
var test = new ViewController;
test.hideButton();
it won't work because the view is already established so I do't need a new ViewController within the service. I have tried to setup EventHandler and binded it to the native delegate.
The other option I thought would help if the Core got executed before the native or if I could figure out how to wait for the core to finish its command in the native, then continue on with the native delegate...
Please help!
Dear Ryan,
Hiding a button can be easily done in ViewModel through data binding. You don't need a service to do that. Since service is singleton, the best practice for service is typically used for non UI related tasks. To learn more about MVVM and data binding in Crosslight, please refer to the article here.
Crosslight comes with several pre-built bindable properties to help developers accomplish common tasks easily. Specifically for your case, you can bind the IsVisible property against the property in your ViewModel and the button. This allows you to set the property to true/false in ViewModel, which consequently reflects the visibilityof the bound view. You can find out the complete bindable properties in our class API reference here.
To learn more how MVVM and data binding works, I highly suggest you to check our comprehensive MVVM samples from our Git server here There are some examples showing IsVisible property, as well as many others such as opacity, text,value, and more.
Hope this helps.
This only helps one case, but what if I need to modify the image nativaley after it is set?
Like do the following:
UserImage.Layer.MasksToBounds = true; UserImage.Layer.CornerRadius = UserImage.Frame.Height/2;
Hello Ryan,
The view-specific properties such as appearance aren't common to be implemented as bindable properties. That's because each platform has their own type and API which differ with other platforms. In Crosslight, we designed the bindable properties to cover most user interaction logic that can be well separated from the view.
The good news is that Crosslight also allows you to create your own bindable properties, so you can create binding for certain properties not supported in Crosslight. This can be easily done through binding adapter, a mechanism that Crosslight itself uses internally for the built-in MVVM-aware components.
You can see an example of binding adapter in our Crosslight - Syncfusion chart binding sample which is a bit quite advanced. We are planning to publish a simpler sample with walkthrough later this week. At the meantime, you can try to learn from the chart binding sample to grasp the concept.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname