D
D
DraculaDIS2012-09-14 18:23:28
Microsoft
DraculaDIS, 2012-09-14 18:23:28

GroupStyleSelector (WinRT) does not want to work, how to overcome it?

Faced the same problem: bit.ly/PijKc9 , who knows how to solve it?

public class MyGroupStyleSelector : GroupStyleSelector
    {
        public GroupStyle OrdersStyle { get; set; }
        public GroupStyle DefaultStyle { get; set; }

        protected override GroupStyle SelectGroupStyleCore(object group, uint level)
        {
// Если вызывается с пустой группой - возвращаем стиль по умолчанию
            var gp = group as ICollectionViewGroup;
            if (gp == null)
                return DefaultStyle;

            switch (((MyGridGroup)gp.Group).Type)
            {
                default:
                    return DefaultStyle;
                case GroupType.Orders:
                    return OrdersStyle;
            }
        }
    }


The problem is that only the style that is returned for the first time is used (for group == null) for the rest of the groups, the style selection method is called and works correctly, but the result is ignored (((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DraculaDIS, 2012-09-17
@DraculaDIS

Official Microsoft response on this: social.msdn.microsoft.com/Forums/ca-ES/winappswithcsharp/thread/809464a1-a152-472b-8b38-9538bc5975ee

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question