public static BreadcrumbState ReducePage(BreadcrumbState state, SetPageAction action)
 {
     return(state with
     {
         Collection = action.Collection,
         ResourceName = action.ResourceName,
         ResourceId = action.ResourceId
     });
 }
예제 #2
0
        public static AppBarState ReduceTitle(AppBarState state, SetPageAction action)
        {
            StringBuilder builder    = new StringBuilder();
            string        collection = action.Collection
                                       .Split("-")
                                       .Select(e => e.Capitalize())
                                       .Join(" ");

            builder.Append(collection);

            if (string.IsNullOrWhiteSpace(action.ResourceName) == false)
            {
                builder.Append(" - ");
                builder.Append(action.ResourceName);
            }

            return(state with
            {
                Title = builder.ToString()
            });
        }