Beispiel #1
0
        private static string ComputeCacheKey(CommandBarData data)
        {
            string?primaryKey  = data.PrimaryItems.Aggregate("", (acc, item) => acc + item.CacheKey);
            string?farKey      = data.FarItems.Aggregate("", (acc, item) => acc + item.CacheKey);
            string?overflowKey = data.OverflowItems.Aggregate("", (acc, item) => acc + item.CacheKey);

            return(string.Join(" ", primaryKey, farKey, overflowKey));
        }
Beispiel #2
0
        protected override Task OnParametersSetAsync()
        {
            _currentData = new CommandBarData()
            {
                PrimaryItems         = new List <ICommandBarItem>(Items != null ? Items : new List <ICommandBarItem>()),
                OverflowItems        = new List <ICommandBarItem>(OverflowItems != null ? OverflowItems : new List <ICommandBarItem>()),
                FarItems             = new List <ICommandBarItem>(FarItems != null ? FarItems : new List <ICommandBarItem>()),
                MinimumOverflowItems = OverflowItems != null?OverflowItems.Count() : 0,
                                           CacheKey = ""
            };

            return(base.OnParametersSetAsync());
        }