PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/CBR/CBR/Resources/XAML/Controls/DesignerItem.xaml

#
XAML | 72 lines | 69 code | 3 blank | 0 comment | 0 complexity | 7fb5e21b8dec771e9ab1d3acd2488b65 MD5 | raw file
 1<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 2                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3                    xmlns:s="clr-namespace:CBR.Components.Designer" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
 4
 5    <ResourceDictionary.MergedDictionaries>
 6    	<ResourceDictionary Source="ResizeChrome.xaml" />
 7    </ResourceDictionary.MergedDictionaries>
 8
 9	<ControlTemplate x:Key="MoveThumbTemplate"
10		TargetType="{x:Type s:MoveThumb}">
11		<Rectangle Fill="Transparent" />
12	</ControlTemplate>
13
14	<Style TargetType="{x:Type s:DesignerItem}">
15		<Setter Property="SnapsToDevicePixels"
16			Value="true" />
17		<Setter Property="Template">
18			<Setter.Value>
19				<ControlTemplate TargetType="{x:Type s:DesignerItem}">
20					<Grid DataContext="{Binding ., RelativeSource={RelativeSource TemplatedParent}}" d:DesignWidth="300" d:DesignHeight="296.5">
21						<s:MoveThumb x:Name="PART_MoveThumb"
22							Cursor="SizeAll"
23							Template="{StaticResource MoveThumbTemplate}" />
24						<ContentPresenter x:Name="PART_ContentPresenter" Margin="{TemplateBinding Padding}">
25							<ContentPresenter.Content>
26								<Grid>
27									<Grid.ColumnDefinitions>
28										<ColumnDefinition Width="Auto"/>
29										<ColumnDefinition Width="*"/>
30									</Grid.ColumnDefinitions>
31									<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stroke="Black" StrokeThickness="2" Grid.ColumnSpan="2" />
32									<Grid Margin="5" ShowGridLines="True">
33										<Grid.RowDefinitions>
34											<RowDefinition Height="Auto"/>
35										</Grid.RowDefinitions>
36										<Rectangle RadiusX="20" RadiusY="20" Fill="#FFD8D8D8" StrokeThickness="4" Stroke="DarkGray" />
37										<Grid Margin="10" DataContext="{Binding DataContext}">
38											<Grid.RowDefinitions>
39												<RowDefinition Height="Auto"/>
40												<RowDefinition Height="Auto"/>
41												<RowDefinition Height="Auto"/>
42											</Grid.RowDefinitions>
43											<Grid.ColumnDefinitions>
44												<ColumnDefinition Width="Auto"/>
45												<ColumnDefinition Width="*"/>
46											</Grid.ColumnDefinitions>
47												<Rectangle Grid.ColumnSpan="2" Fill="#FFA3A3A3" Stroke="Black" RadiusX="10" RadiusY="10"></Rectangle>
48												<Label Grid.ColumnSpan="2">Frame definition</Label>
49												<Label Grid.Row="1">Order</Label>
50												<TextBox Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" Text="{Binding OrderNum, Mode=TwoWay}" HorizontalAlignment="Stretch" VerticalAlignment="center" />
51												<Label Grid.Row="2">Delay (ms)</Label>
52                                                <TextBox Grid.Row="2" Grid.Column="1" TextWrapping="Wrap" Text="{Binding Duration, Mode=TwoWay}" HorizontalAlignment="Stretch" VerticalAlignment="center" />
53										</Grid>
54									</Grid>
55								</Grid>
56							</ContentPresenter.Content>
57						</ContentPresenter>
58						<s:ResizeDecorator x:Name="PART_DesignerItemDecorator" />
59					</Grid>
60					<ControlTemplate.Triggers>
61						<Trigger Property="IsSelected"
62							Value="True">
63							<Setter TargetName="PART_DesignerItemDecorator"
64								Property="ShowDecorator"
65								Value="True" />
66						</Trigger>
67					</ControlTemplate.Triggers>
68				</ControlTemplate>
69			</Setter.Value>
70		</Setter>
71	</Style>
72</ResourceDictionary>