FingerpointImage.xaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <UserControl x:Class="NEIntelligentControl2.Views.User.FingerpointImage"
  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:NEIntelligentControl2.Views.User"
  7. xmlns:gif="http://wpfanimatedgif.codeplex.com"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <Grid>
  11. <Image gif:ImageBehavior.AnimatedSource="pack://application:,,,/智动启停;component/Images/User/finger.gif" gif:ImageBehavior.RepeatBehavior="Forever">
  12. <Image.Style>
  13. <Style TargetType="Image">
  14. <Style.Triggers>
  15. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsActive}" Value="True">
  16. <Setter Property="Visibility" Value="Visible"/>
  17. </DataTrigger>
  18. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsActive}" Value="False">
  19. <Setter Property="Visibility" Value="Collapsed"/>
  20. </DataTrigger>
  21. </Style.Triggers>
  22. </Style>
  23. </Image.Style>
  24. </Image>
  25. <Image x:Name="_IActive" Source="pack://application:,,,/智动启停;component/Images/User/finger.png">
  26. <Image.Style>
  27. <Style TargetType="Image">
  28. <Style.Triggers>
  29. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsActive}" Value="False">
  30. <Setter Property="Visibility" Value="Visible"/>
  31. </DataTrigger>
  32. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsActive}" Value="True">
  33. <Setter Property="Visibility" Value="Collapsed"/>
  34. </DataTrigger>
  35. </Style.Triggers>
  36. </Style>
  37. </Image.Style>
  38. </Image>
  39. </Grid>
  40. </UserControl>