IOMonitorView.xaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <UserControl x:Class="VirgoRT.Backends.IOView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:VirgoRT.Backends"
  7. xmlns:control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
  8. mc:Ignorable="d"
  9. d:DesignHeight="700" d:DesignWidth="1000" Background="SkyBlue">
  10. <UserControl.Resources>
  11. <Style x:Key="tabNull" TargetType="TabControl"></Style>
  12. </UserControl.Resources>
  13. <TabControl >
  14. <TabControl.Resources>
  15. <Style TargetType="{x:Type TabItem}">
  16. <Setter Property="BorderThickness" Value="0"/>
  17. <Setter Property="Padding" Value="0" />
  18. <Setter Property="Margin" Value="5,0,5,0" />
  19. <Setter Property="HeaderTemplate">
  20. <Setter.Value>
  21. <DataTemplate>
  22. <Border x:Name="grid" CornerRadius="5,5,0,0" Background="Silver" Width="120" >
  23. <ContentPresenter Content="{TemplateBinding Content}" Margin="15,5,15,5" HorizontalAlignment="Center">
  24. <ContentPresenter.LayoutTransform>
  25. <RotateTransform Angle="0"/>
  26. </ContentPresenter.LayoutTransform>
  27. </ContentPresenter>
  28. </Border>
  29. <DataTemplate.Triggers>
  30. <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TabItem}},Path=IsSelected}" Value="True">
  31. <Setter TargetName="grid" Property="Background">
  32. <Setter.Value>
  33. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  34. <GradientStop Color="#d0e5f7" Offset="0"/>
  35. <GradientStop Color="#48b0e2" Offset="1"/>
  36. </LinearGradientBrush>
  37. </Setter.Value>
  38. </Setter>
  39. </DataTrigger>
  40. </DataTemplate.Triggers>
  41. </DataTemplate>
  42. </Setter.Value>
  43. </Setter>
  44. </Style>
  45. </TabControl.Resources>
  46. <TabItem Header="PLC1">
  47. <control:DiItemEditor DataContext="{Binding IoList[0]}" ></control:DiItemEditor>
  48. </TabItem>
  49. <TabItem Header="PLC2">
  50. <control:DiItemEditor DataContext="{Binding IoList[1]}" ></control:DiItemEditor>
  51. </TabItem>
  52. </TabControl>
  53. </UserControl>