|
<m:EntityListBase
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Signum.Windows"
x:Class="Signum.Windows.EntityRepeater"
x:Name="me" MinWidth="200" >
<m:EntityListBase.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RepeaterItemStyle" TargetType="{x:Type ContentControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Border BorderBrush="{DynamicResource LightBlue}" BorderThickness="1" Padding="1">
<Grid Loaded="Grid_Loaded" m:Common.TypeContext="{m:ContinueRoute /}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Button x:Name="btRemove" Click="btRemove_Click"
Style="{StaticResource RoundButton}"
Content="{StaticResource Remove}"
ToolTip="{m:Loc Remove}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Grid.Column="1"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</m:EntityListBase.Resources>
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Background="{DynamicResource LightBlueBackground}">
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<Image Stretch="None" Source="{Binding Icon, ElementName=me, Mode=Default}" SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="NearestNeighbor" />
<Label Content="{Binding LabelText, ElementName=me, Mode=Default}" VerticalAlignment="Center" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Margin="0,1.5" Orientation="Horizontal">
<Button x:Name="btCreate" Click="btCreate_Click" Style="{StaticResource RoundButton}" ToolTip="{m:Loc Create}"
Content="{StaticResource Create}"/>
<Button x:Name="btFind" Click="btFind_Click" Style="{StaticResource RoundButton}" ToolTip="{m:Loc Find}"
Content="{StaticResource Find}"/>
</StackPanel>
</Grid>
<m:RepeaterItemsControl Grid.Row="1" x:Name="itemsControl"
ItemsSource="{Binding Entities, ElementName=me, Mode=Default}"
ItemTemplate="{Binding EntityTemplate, ElementName=me, Mode=Default}"
ItemContainerStyle="{DynamicResource RepeaterItemStyle}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</m:EntityListBase>
|
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...