|
<Window x:Class="Styles_And_Templates.DemoLauncherWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Styles_And_Templates"
Title="Styles And Templates" Height="600" Width="600"
ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<!-- Listbox DemoListItem Type Template -->
<DataTemplate x:Key="demoItemTemplate" DataType="x:Type local:DemoListItem">
<StackPanel Orientation="Horizontal" Margin="10">
<Path Name="pathSelected" Fill="White" Stretch="Fill" Stroke="White" Width="15"
Height="20" Data="M0,0 L 0,15 L 7.5,7.5"
Visibility="Hidden"/>
<Border BorderBrush="White" BorderThickness="4" Margin="5">
<Image Source="Images/DataLogo.png" Width="45" Height="45"/>
</Border>
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<TextBlock FontFamily="Arial Black" FontSize="20"
FontWeight="Bold"
Width="auto" Height="auto"
Text="{Binding Path=DemoName}" />
<TextBlock FontFamily="Arial" FontSize="10"
FontWeight="Normal"
Width="auto" Height="auto"
Text="{Binding Path=WindowName}" />
</StackPanel>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type ListBoxItem}, AncestorLevel=1}, Path=IsSelected}" Value="True">
<Setter TargetName="pathSelected" Property="Visibility" Value="Visible" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</Window.Resources>
<DockPanel LastChildFill="True">
<!-- Top Panel-->
<Canvas DockPanel.Dock="Top" Background="Orange" Width="auto" Height="50">
<TextBlock FontFamily="Arial Black" FontSize="35"
FontWeight="Bold" Text="Styles And Templates"
Width="auto" Height="auto" Canvas.Left="10"
Canvas.Top="5"/>
</Canvas>
<!-- Bottom Panel-->
<ListBox x:Name="lstDemos" DockPanel.Dock="Bottom" Background="White"
ItemTemplate="{StaticResource demoItemTemplate}"
SelectionChanged="lstDemos_SelectionChanged"/>
</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.
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)
- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence
Both of these at Sussex University UK.
Award(s)
I am lucky enough to have won a few awards for Zany Crazy code articles over the years
- Microsoft C# MVP 2016
- Codeproject MVP 2016
- Microsoft C# MVP 2015
- Codeproject MVP 2015
- Microsoft C# MVP 2014
- Codeproject MVP 2014
- Microsoft C# MVP 2013
- Codeproject MVP 2013
- Microsoft C# MVP 2012
- Codeproject MVP 2012
- Microsoft C# MVP 2011
- Codeproject MVP 2011
- Microsoft C# MVP 2010
- Codeproject MVP 2010
- Microsoft C# MVP 2009
- Codeproject MVP 2009
- Microsoft C# MVP 2008
- Codeproject MVP 2008
- And numerous codeproject awards which you can see over at my blog