Node.xaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:c="clr-namespace:SHJX.Service.WorkFlowEdit">
  5. <ResourceDictionary.MergedDictionaries>
  6. <ResourceDictionary Source="/SHJX.Service.WorkFlowEdit;component/Themes/Shared.xaml" />
  7. </ResourceDictionary.MergedDictionaries>
  8. <Style TargetType="{x:Type c:Node}">
  9. <Setter Property="MinWidth" Value="10" />
  10. <Setter Property="MinHeight" Value="10" />
  11. <Setter Property="SnapsToDevicePixels" Value="True" />
  12. <Setter Property="Template">
  13. <Setter.Value>
  14. <ControlTemplate TargetType="{x:Type c:Node}">
  15. <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
  16. <ContentPresenter
  17. HorizontalAlignment="Stretch"
  18. VerticalAlignment="Stretch"
  19. Content="{TemplateBinding Content}" />
  20. <ItemsControl ItemsSource="{Binding Ports}">
  21. <ItemsControl.ItemsPanel>
  22. <ItemsPanelTemplate>
  23. <Grid />
  24. </ItemsPanelTemplate>
  25. </ItemsControl.ItemsPanel>
  26. </ItemsControl>
  27. </Grid>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32. </ResourceDictionary>