Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <UserControl x:Class="ATypeSurfaceControls.SnapList"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:s="http://schemas.microsoft.com/surface/2008"
- xmlns:local="clr-namespace:ATypeSurfaceControls"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
- <UserControl.Resources>
- <local:EndToMarginConverter x:Key="ETMc"/>
- <local:VerticalHalfMarginConverter x:Key="Vc"/>
- </UserControl.Resources>
- <Grid x:Name="LayoutRoot">
- <s:SurfaceListBox x:Name="List" VerticalAlignment="Center" HorizontalAlignment="Stretch"
- ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:SnapList}}}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <s:SurfaceListBox.Style>
- <Style TargetType="{x:Type s:SurfaceListBox}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type s:SurfaceListBox}">
- <s:SurfaceScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" >
- <VirtualizingStackPanel Orientation="Vertical" IsItemsHost="True"
- Margin="{Binding ActualHeight, ElementName=LayoutRoot, Converter={StaticResource Vc}}"></VirtualizingStackPanel>
- </s:SurfaceScrollViewer>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </s:SurfaceListBox.Style>
- <s:SurfaceListBox.ItemContainerStyle>
- <Style TargetType="{x:Type s:SurfaceListBoxItem}">
- <Setter Property="RenderTransformOrigin">
- <Setter.Value>
- <Point X="0.5" Y="0.5"/>
- </Setter.Value>
- </Setter>
- <Setter Property="Height" Value="200"/>
- <Setter Property="Padding" Value="0"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Margin" Value="4"/>
- <Setter Property="ContentTemplate" Value="{Binding ItemContentTemplate, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:SnapList}}}">
- </Setter>
- <Setter Property="Template" Value="{Binding ItemTemplate, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:SnapList}}}">
- </Setter>
- <EventSetter Event="Selected" Handler="ListItem_Selected"/>
- </Style>
- </s:SurfaceListBox.ItemContainerStyle>
- </s:SurfaceListBox>
- <local:ScrollViewerOffsetMediator x:Name="Mediator" />
- </Grid>
- </UserControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement