|
<Window x:Class="Signum.Windows.SelectorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:m="clr-namespace:Signum.Windows"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="SelectorWindow"
WindowStartupLocation="CenterOwner"
SizeToContent="WidthAndHeight"
TextOptions.TextFormattingMode="Display"
UseLayoutRounding="True"
x:Name="win">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="tb" Grid.Row="0" Margin="10,10,10,0" FontWeight="bold" Text="{Binding Message, ElementName=win}"/>
<Border BorderThickness="1" BorderBrush="RoyalBlue" Margin="10" Grid.Row="1" CornerRadius="4" Padding="2">
<ItemsControl x:Name="itemsControl" ItemsSource="{Binding Elements, ElementName=win}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ToggleButton Checked="ToggleButton_Checked" Padding="3">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Image}"/>
<TextBlock Text="{Binding Text}" FontSize="12" Margin="10,0"/>
</StackPanel>
</ToggleButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type ContentPresenter}" >
<Setter Property="Margin" Value="4" />
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.Template>
<ControlTemplate>
<StackPanel Orientation="Vertical" IsItemsHost="True"/>
</ControlTemplate>
</ItemsControl.Template>
</ItemsControl>
</Border>
</Grid>
</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'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.
www.signumframework.com
I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...