Exemplo n.º 1
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values[0] is ViewType type)
            {
                var lister      = values[1] as ILister;
                var viewHandler = new ViewHandler(lister);
                switch (type)
                {
                case ViewType.Detail:
                    return(viewHandler.GetDetailView());

                case ViewType.Icon:
                    return(viewHandler.GetIconView());

                case ViewType.Thumbnail:
                    return(viewHandler.GetThumbView());

                default:
                    throw new ArgumentOutOfRangeException(nameof(values), "Unknown View Type");
                }
            }
            return(Binding.DoNothing);
        }