<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:lib="clr-namespace:Microsoft.Samples.KMoore.WPFSamples.Zap" > <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}" x:Key="pageButtonStyle"> <Setter Property="Width" Value="30" /> <Setter Property="Height" Value="30" /> </Style> <Style TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource {x:Type RepeatButton}}" x:Key="pageRepeatButtonStyle"> <Setter Property="Width" Value="30" /> <Setter Property="Height" Value="30" /> <Setter Property="Interval" Value="500" /> </Style> <Style TargetType="{x:Type ItemsControl}" x:Key="ZapScrollItemNavItemsControlStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ItemsControl}"> <StackPanel Orientation="Horizontal" IsItemsHost="True"/> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="ItemTemplate"> <Setter.Value> <DataTemplate> <Button Command="{Binding }" Style="{StaticResource pageButtonStyle}" Content="{Binding Path=Number}"/> </DataTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type lib:ZapScroller}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type lib:ZapScroller}"> <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" HorizontalAlignment="Center" > <Button Content="<<" Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=FirstCommand}" Style="{StaticResource pageButtonStyle}" /> <RepeatButton Content="<" Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PreviousCommand}" Style="{StaticResource pageRepeatButtonStyle}" /> <ItemsControl ItemsSource="{TemplateBinding Commands}" Style="{StaticResource ZapScrollItemNavItemsControlStyle}" /> <RepeatButton Content=">" Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=NextCommand}" Style="{StaticResource pageRepeatButtonStyle}" /> <Button Content=">>" Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=LastCommand}" Style="{StaticResource pageButtonStyle}"/> </StackPanel> <lib:ZapDecorator Name="PART_ZapDecorator"/> </DockPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type lib:ZapItemsControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type lib:ZapItemsControl}"> <lib:ZapScroller> <lib:ZapPanel IsItemsHost="true" /> </lib:ZapScroller> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)