|
<Window
x:Class="WpfDiscipleBlogViewer3D.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfDiscipleBlogViewer3D"
FontWeight="Bold" FontSize="18"
FocusManager.IsFocusScope="False"
Title="WPF Disciples :: Blogroll"
Width="800" Height="800"
WindowStartupLocation="CenterScreen"
>
<Window.Background>
<ImageBrush ImageSource="images/background.jpg" />
</Window.Background>
<Window.CommandBindings>
<CommandBinding
Command="Open"
CanExecute="Open_CanExecute"
Executed="Open_Executed"
/>
</Window.CommandBindings>
<DockPanel Margin="4">
<DockPanel.DataContext>
<XmlDataProvider Source="blogroll.xml" XPath="blogs/blog" />
</DockPanel.DataContext>
<!-- NAVIGATION BUTTONS -->
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center" Margin="0,0,0,4" Orientation="Horizontal">
<StackPanel.Resources>
<ResourceDictionary Source="GelButtonStyle.xaml" />
</StackPanel.Resources>
<RepeatButton Click="PageBackButtonClicked" Content="|<<" />
<Rectangle Width="10" />
<RepeatButton Click="MoveBackButtonClicked" Content="<<" />
<Rectangle Width="10" />
<RepeatButton Click="MoveForwardButtonClicked" Content=">>" />
<Rectangle Width="10" />
<RepeatButton Click="PageForwardButtonClicked" Content=">>|" />
</StackPanel>
<!-- BLOGGER IMAGE CAROUSEL -->
<ListBox x:Name="Carousel" Background="Transparent" BorderBrush="Transparent" ItemsSource="{Binding}" Focusable="False" IsSynchronizedWithCurrentItem="True">
<!--
Tell the ItemsControl to use our custom
3D layout panel to arrage its items.
-->
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<local:Panel3D Loaded="OnPanel3DLoaded" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Width" Value="200" />
<Setter Property="Height" Value="200" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<ContentPresenter ContentSource="Content" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<!-- Explain how to render a BitmapImage. -->
<ListBox.ItemTemplate>
<DataTemplate>
<Button
Command="Open"
CommandParameter="{Binding XPath=@url}"
Cursor="Hand"
Focusable="False"
>
<Button.Template>
<ControlTemplate TargetType="Button">
<Border
Background="Black"
BorderBrush="#88000000"
BorderThickness="0.5"
Padding="1"
>
<DockPanel>
<Button
Background="Transparent"
Command="Open"
CommandParameter="{Binding XPath=@bio}"
Content="{Binding XPath=@author}"
DockPanel.Dock="Top"
Focusable="False"
Foreground="White"
HorizontalAlignment="Stretch"
Margin="-14,-8,-12,8"
ToolTip="Read author's bio"
/>
<Image Source="{Binding XPath=@pic}" />
</DockPanel>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Window>
|
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.