public override Task SetParametersAsync(ParameterView parameters)
        {
            if (_viewport != null && _viewport != _lastViewport)
            {
                AdjustColumns(
                    parameters.GetValueOrDefault <IEnumerable <TItem> >("ItemsSource"),
                    parameters.GetValueOrDefault <DetailsListLayoutMode>("LayoutMode"),
                    parameters.GetValueOrDefault <SelectionMode>("SelectionMode"),
                    parameters.GetValueOrDefault <CheckboxVisibility>("CheckboxVisibility"),
                    parameters.GetValueOrDefault <IEnumerable <BFUDetailsRowColumn <TItem> > >("Columns"),
                    true
                    );
            }

            var selectionMode = parameters.GetValueOrDefault <SelectionMode>("SelectionMode");

            if (selectionMode == SelectionMode.None)
            {
                selectAllVisibility = SelectAllVisibility.None;
            }
            else if (selectionMode == SelectionMode.Single)
            {
                selectAllVisibility = SelectAllVisibility.Hidden;
            }
            else if (selectionMode == SelectionMode.Multiple)
            {
                //disable if collapsed groups
                //TBD!

                selectAllVisibility = SelectAllVisibility.Visible;
            }

            if (parameters.GetValueOrDefault <CheckboxVisibility>("CheckboxVisibility") == CheckboxVisibility.Hidden)
            {
                selectAllVisibility = SelectAllVisibility.None;
            }

            return(base.SetParametersAsync(parameters));
        }
Ejemplo n.º 2
0
        public override Task SetParametersAsync(ParameterView parameters)
        {
            shouldRender = false;

            var dictParameters = parameters.ToDictionary();

            if (lastParameters == null)
            {
                shouldRender = true;
            }
            else
            {
                var differences = dictParameters.Where(entry =>
                {
                    return(!lastParameters[entry.Key].Equals(entry.Value));
                }
                                                       ).ToDictionary(entry => entry.Key, entry => entry.Value);

                if (differences.Count > 0)
                {
                    shouldRender = true;
                }
            }
            lastParameters = dictParameters;

            if (_viewport != null && _viewport != _lastViewport)
            {
                AdjustColumns(
                    parameters.GetValueOrDefault <IEnumerable <TItem> >("ItemsSource"),
                    parameters.GetValueOrDefault <DetailsListLayoutMode>("LayoutMode"),
                    parameters.GetValueOrDefault <SelectionMode>("SelectionMode"),
                    parameters.GetValueOrDefault <CheckboxVisibility>("CheckboxVisibility"),
                    parameters.GetValueOrDefault <IEnumerable <BFUDetailsRowColumn <TItem> > >("Columns"),
                    true
                    );
            }

            var selectionMode = parameters.GetValueOrDefault <SelectionMode>("SelectionMode");

            if (selectionMode == SelectionMode.None)
            {
                selectAllVisibility = SelectAllVisibility.None;
            }
            else if (selectionMode == SelectionMode.Single)
            {
                selectAllVisibility = SelectAllVisibility.Hidden;
            }
            else if (selectionMode == SelectionMode.Multiple)
            {
                //disable if collapsed groups
                //TBD!

                selectAllVisibility = SelectAllVisibility.Visible;
            }

            if (parameters.GetValueOrDefault <CheckboxVisibility>("CheckboxVisibility") == CheckboxVisibility.Hidden)
            {
                selectAllVisibility = SelectAllVisibility.None;
            }

            return(base.SetParametersAsync(parameters));
        }