Beispiel #1
0
        public Func <Binding, DataTemplate> GetFormatter(Column column)
        {
            if (formatters != null && formatters.TryGetValue(column.Name, out Func <Binding, DataTemplate> cf))
            {
                return(cf);
            }

            PropertyRoute route = column.Token.GetPropertyRoute();

            if (route != null)
            {
                var formatter = QuerySettings.PropertyFormatters.TryGetC(route);
                if (formatter != null)
                {
                    return(formatter);
                }
            }

            FormatterRule fr = FormatRules.Last(cfr => cfr.IsApplicable(column));

            return(fr.Formatter(column));
        }
        public CellFormatter GetFormatter(Column column)
        {
            CellFormatter cf;

            if (formatters != null && formatters.TryGetValue(column.Name, out cf))
            {
                return(cf);
            }

            PropertyRoute route = column.Token.GetPropertyRoute();

            if (route != null)
            {
                var formatter = QuerySettings.PropertyFormatters.TryGetC(route);
                if (formatter != null)
                {
                    return(formatter);
                }
            }

            var last = FormatRules.Last(cfr => cfr.IsApplyable(column));

            return(last.Formatter(column));
        }