How to Use Crosslight v2 to Show/Hide Form Sections

9 replies. Last post: July 15, 2015 9:15 AM by Arief Handany
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

I believe the question we're supposed to be asking is... what happened to the VisibilityBinding on build 2.0.5000.78? We just closed related thread entitled How to Use Crosslight v2 FormMetaData with EnabledBinding and VisibilityBinding Attributes, within this thread we asked how to use these features. And during that time the code snippet below was working, until the latest update (Update 4 to be specific). Lots of fixes are needed on this update, but also did some damage.

[Section("Commissions", Style = SectionLayoutStyle.RightDetail)]        [VisibilityBinding(Path = "DisplayCommissions", SourceType = BindingSourceType.ViewModel, ConverterType = typeof(BooleanConverter))]
        public static CommissionSection Commissions;

Please try to replicate the issue. Here's the code at Navigated event of the viewmodel. Thanks!

    try
    {
        // Display an activity indicator.
        this.ActivityPresenter.Show("Loading...", ActivityStyle.SmallIndicatorWithText, true);

        // Always check for reachbility before anything else;
        var p_Result = await this.m_MercuryAdapter.CheckReachabilityAsync();

        // Throw a communication exception and handle the exception.
        if (!p_Result.IsReachable) throw new ReachabilityException();

        // Get the setting whether to display commissions on mobile or not.
        var p_Parameter = await this.m_MercuryAdapter.GetParameterAsync("CommissionsOnMobile");

        // Parse and convert the string into a boolean data type.
        this.DisplayCommissions = Convert.ToBoolean(p_Parameter);
    }
    catch
    {
        // In case of errors, set a default value.
        this.DisplayCommissions = false;
    }
    finally
    {
        // Hide indicator and reset busy state.
        this.ActivityPresenter.Hide();
        this.IsBusy = false;
    }

The DisplayCommissions property is of boolean type.


All times are GMT -5. The time now is 8:05 PM.
Previous Next