Exemple #1
0
        internal override ItemContainerGenerator CreateItemContainerGenerator()
        {
            var pivotHeaderItemFactory = new FrameworkElementFactory(typeof(PivotHeaderItem));

            if (this.ItemTemplate == null)
            {
                pivotHeaderItemFactory.SetBinding(
                    BackgroundProperty,
                    new Binding(nameof(PivotHeaderItem.IsSelected))
                {
                    RelativeSource = new RelativeSource(RelativeSourceMode.Self),
                    Converter      = ValueConverterFactory.Make <bool, Brush>(x => x ? SelectedItemBackgroundBrush : null),
                });
                pivotHeaderItemFactory.SetBinding(ContentControl.ContentProperty, new Binding(nameof(PivotItem.Header)));
                // TODO: listBoxItemFactory.SetValue(TextBlock.FontSizeProperty, 20);
            }

            return(new ItemContainerGenerator(pivotHeaderItemFactory, this.Items));
        }