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