终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

145 rader
17 KiB

  1. <Window x:Class="BPASmartClient.CustomResource.UserControls.Notifiaction"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
  7. Title="Notifiaction" Width="300" MinHeight="700"
  8. AllowsTransparency="True"
  9. Background="Transparent" ShowActivated="False"
  10. ShowInTaskbar="False"
  11. UseLayoutRounding="True" WindowStyle="None" mc:Ignorable="d">
  12. <Window.Resources>
  13. <PathGeometry x:Key="Icon_Close" Figures="M754.782 212.596 512 455.368 269.218 212.596c-13.081-13.081-34.29-13.081-47.369 0-13.081 13.081-13.081 34.288 0 47.367l242.782 242.771L221.849 745.507c-13.081 13.081-13.081 34.288 0 47.367 13.081 13.081 34.29 13.081 47.369 0L512 550.103l242.782 242.771c13.081 13.081 34.289 13.081 47.37 0 13.081-13.081 13.081-34.288 0-47.367L559.37 502.735l242.782-242.771c13.081-13.081 13.081-34.288 0-47.367C789.07 199.517 767.862 199.517 754.782 212.596z" />
  14. <PathGeometry x:Key="InfoIcon" Figures="M512 0C229.206 0 0 229.289 0 512s229.206 512 512 512 512-229.378 512-512C1024 229.289 794.794 0 512 0z m80.3 700.333c-38.656 58.028-77.911 102.656-144.128 102.656-45.139-7.339-63.66-39.678-53.844-72.617l85.078-281.683c2.05-6.911-1.367-14.25-7.678-16.467-6.228-2.216-18.6 5.972-29.267 17.578l-51.372 61.867c-1.367-10.328-0.083-27.561-0.083-34.473 38.572-58.027 102.06-103.766 145.15-103.766 40.872 4.183 60.16 36.95 53.077 72.872l-85.677 283.044c-1.112 6.484 2.216 12.8 8.105 15.017 6.228 2.133 19.539-5.972 30.206-17.667l51.455-61.866c1.284 10.333-1.022 28.505-1.022 35.505z m-11.433-367.96c-32.6 0-58.878-23.64-58.878-58.623s26.367-58.622 58.878-58.622c32.427 0 58.966 23.639 58.966 58.622s-26.455 58.622-58.966 58.622z" />
  15. <!--<PathGeometry x:Key="WarnIcon" Figures="M514.63547095 64.50557607c-245.79772937 0-445.80505747 199.97978336-445.80505745 445.7795534 0 245.85077718 200.0073271 445.85810529 445.80505745 445.85810529 245.79875019 0 445.80505747-200.0073271 445.80505749-445.85810529C960.44052743 264.48535941 760.43422017 64.50557607 514.63547095 64.50557607zM572.44016637 798.25683382c-13.74446534 14.26678179-31.36753754 21.5057584-52.45401459 21.50575839-22.03113538 0-40.59886489-7.55216231-55.33899569-22.3453409-14.635056-14.79113893-22.03113538-32.5213256-22.03113537-52.66416523 0-19.46035985 6.87172326-35.87659514 20.50907311-48.78045812 17.93931743-17.04770793 36.61314256-25.70265117 55.39102367-25.70265118 20.40399732 0 38.08011732 7.3960794 52.55909039 21.92605961 14.58200819 14.47693239 21.92503973 32.31117502 21.92503974 53.08242667C593.00126648 766.25884451 586.0785361 784.14613494 572.44016637 798.25683382zM592.89721153 384.50077378l-26.12091168 136.06541617c-6.82071513 41.07119406-14.47693239 74.6932599-22.7656421 99.76545928l-0.94363748 3.04208384c0 0-8.28768988 0.42030118-11.59195128 0.42030118l-41.91077658-0.21015058-35.51138249-160.14195009c-12.43153382-62.47187666-20.40501816-106.16587322-24.39175932-133.59971641-2.09844638-17.73018767-3.09411183-30.84216056-3.09411182-39.34000105 0-2.51772771 0.7865347-7.92043552 2.5697547-16.10407044 1.5730694-17.57104421 8.39276469-31.21043477 20.24689454-40.23263136 11.43484853-8.60291527 27.48587116-13.74242565 47.89088833-15.21144013 10.85846444-1.67916503 18.25454379-2.57077553 21.55880619-2.57077552 23.28897839 0 43.22064757 6.03214073 59.16761426 17.99236524 16.4713238 12.27341122 24.75799285 29.68837249 24.75799287 51.87661064C602.75797079 305.71467607 599.50675619 337.81672134 592.89721153 384.50077378z" />-->
  16. <PathGeometry x:Key="ErrorIcon" Figures="M881.510752 573.386092c-15.745612-6.138814-21.400403-6.851035-48.313356-8.439206-26.912953-1.588171-31.004131 0.221034-59.474556 2.077312-128.870066 0.884137-257.154801 16.884552-382.724705 47.590901-80.273255 19.629059-159.52218 45.809325-235.43001 78.411861-48.994877 21.038152-57.654095 69.491701-15.294334 103.485933 50.149167 40.246633 118.762871-8.394181 164.725692-31.022551 78.463026-38.626739 315.544653-119.546723 404.01766-135.841851 99.574856-18.339694 186.075953-8.589632 187.662077-32.692586C894.074905 591.861886 897.256364 579.524906 881.510752 573.386092z M912.098397 578.64077c-23.939225 14.811334 6.349615 37.685297 27.733645 32.69975 25.548886-5.955642 18.216897-25.934672-0.203638-34.332946C929.971463 572.610426 919.367965 574.147432 912.098397 578.64077 M271.709285 387.416564c19.113313-8.293897 38.860053-15.419178 57.628512-24.099884 26.979468-12.481266 54.486962-30.454616 58.508555-62.534242 4.055362-32.310893-16.281825-58.32743-43.281759-73.349565-64.283072-35.768645-136.454812-2.146896-194.184631 30.063713-30.356378 16.941857-53.135174 43.911092-66.342987 75.990718-34.590819 83.989903-7.642051 197.990307 18.917862 254.121721 18.296715 38.675858 60.662615 56.901964 101.754498 55.561433 22.150486-0.723477 45.067428-6.814196 65.925479-13.956873 13.036921-4.461615 25.762757-9.830903 38.068014-16.030092 6.14393-3.099594 12.186554-6.405897 18.096147-9.934257 4.305049-2.569522 10.900258-9.100262 15.659655-10.091846 1.880837-0.38988 3.752464-1.033539 5.611811-1.943258 18.915815-9.314133 29.03836-26.543539 27.069519-46.076408-1.451048-14.461363-13.455453-29.566386-42.797735-28.596292-7.640004 0.252757-15.519462 1.623987-22.781866 3.963265-15.020088 4.845355-100.891851 58.340733-110.154819 37.502126-5.955642-13.403265 32.605605-27.402093 41.409109-31.347962 21.132296-9.466606 44.182268-13.373589 65.581648-22.104437 26.91193-10.980076 71.130014-32.04074 75.275427-65.014736 5.104251-40.612976-44.633546-45.369304-72.502267-40.136116-27.031657 5.078669-52.896744 12.673647-77.589123 25.018813-1.862417 0.933255-3.859911 1.889023-5.930059 1.648546-13.731746-1.593288 2.78237-15.542998 6.14086-17.753339C244.361427 400.046209 257.868045 393.427464 271.709285 387.416564 M566.432727 365.658004c-12.226462-11.811-32.686447-10.939143-48.75747-11.757788-20.536732-1.043772-41.192168 0.070608-61.497633 3.350304-75.191516 12.137435-54.967916 133.555785-40.393989 185.121208 6.725168 23.793916 40.133046 46.989197 57.488319 19.673062 9.198499-14.473643 1.916653-33.547047 1.585101-49.431829-0.313132-15.392572-0.656963-30.79026-0.86981-46.182832-0.319272-23.76424 8.90788-46.573735 31.006178-57.501622 22.234397-10.998495 53.559846-0.539282 64.325028-29.865191 0.887206-2.419096 1.520633-5.052063 0.957815-7.571443C569.845453 369.570103 568.390311 367.549074 566.432727 365.658004 M582.388117 392.262942c-11.023054 13.939477-10.873652 47.750537-11.437493 64.707744-0.586354 17.634636 1.388627 35.198663 4.034896 52.608172 0.832971 5.485945 2.725064 43.529399 16.673751 33.727149 3.596921-2.52859 8.435113-0.706081 12.378935-5.194302 12.890588-14.678304 17.025769-34.983769 18.679431-53.875025 0.952698-10.960633-2.405793-22.618137 0.553609-33.388435 4.76042-17.334807 17.551748-12.81998 31.66314-17.21508 25.586748-7.980765 41.24231-30.269397 12.945847-45.13906C649.435139 378.801349 597.08791 373.672538 582.388117 392.262942z M736.139873 496.272807c-3.832282 2.353604-8.368598 3.053546-13.228279 1.078565-24.283056-9.867742-4.149507-47.554062 21.378913-36.992519-0.147356 0.293689-0.25992 0.595564-0.38681 0.896416 0.309038 0.308015 0.688685 0.539282 0.949628 0.917906C751.596913 472.068546 746.357586 490.011196 736.139873 496.272807zM752.159732 413.68688c-15.767102-6.786567-31.175023-7.724938-45.830815 2.731204-10.084683 7.192819-17.23657 17.887392-22.060435 29.274744-10.021238 23.608697-19.142989 51.077306 2.40477 70.483284 13.657045 12.298094 37.884842 25.13547 56.625672 18.027585 13.382798-5.070482 22.468734-17.929348 28.14399-30.451546 11.054777-24.421202 15.767102-65.370847-8.566096-83.972507C759.845785 417.461857 756.147556 415.401941 752.159732 413.68688z M831.934636 482.111273c0.164752-0.167822 0.306992-0.357134 0.477884-0.522909 17.013489-16.610306 39.110763-10.090822 60.309574-12.124132 3.007497-0.289596 5.5279-3.162016 3.490497-6.037507-9.083889-12.839423-22.604834-18.491143-37.19104-23.449062-8.798387-2.995217-16.394389 3.368724-21.968337 10.380418-1.974981-12.604062-8.864902-22.789029-24.152073-16.647145-22.857591 9.17701-22.583344 48.02069-21.716604 67.3929 0.652869 14.504342 5.808286 45.686529 25.759687 29.064966 10.776438-8.977465 11.877515-33.568537 14.491039-45.938262C831.585689 483.510132 831.766814 482.812237 831.934636 482.111273" />
  17. <PathGeometry x:Key="SelectedIcon" Figures="M512 0C229.231 0 0 229.231 0 512 0 794.771 229.231 1024 512 1024 794.771 1024 1024 794.771 1024 512 1024 229.231 794.769 0 512 0ZM805.671 379.193 474.533 710.332C474.533 710.332 474.529 710.336 474.524 710.342 459.258 725.612 435.98 727.996 418.209 717.5 414.918 715.555 411.815 713.166 408.989 710.342 408.987 710.338 408.983 710.336 408.983 710.336L218.331 519.684C200.235 501.587 200.235 472.244 218.331 454.144 236.427 436.048 265.771 436.048 283.867 454.144L441.759 612.036 740.136 313.659C758.235 295.563 787.578 295.563 805.675 313.659 823.766 331.755 823.766 361.097 805.671 379.193Z" />
  18. <Storyboard x:Key="CollapseStoryboard">
  19. <DoubleAnimation Duration="0:0:0.3" From="70" Storyboard.TargetProperty="Height" To="0" />
  20. </Storyboard>
  21. <DataTemplate x:Key="NotifiactionTemplate">
  22. <Grid x:Name="NoticeGrid" Margin="5" Tag="{Binding Path=Id}"
  23. RenderTransformOrigin="1,0.5" SizeChanged="NoticeGrid_SizeChanged">
  24. <Grid.RenderTransform>
  25. <TransformGroup>
  26. <ScaleTransform />
  27. <RotateTransform />
  28. <SkewTransform />
  29. <TranslateTransform />
  30. </TransformGroup>
  31. </Grid.RenderTransform>
  32. <Border x:Name="border" Margin="5,0,0,0" BorderBrush="#419aff" CornerRadius="2" Padding="5" BorderThickness="1" VerticalAlignment="Center" HorizontalAlignment="Center">
  33. <Border.Background>
  34. <ImageBrush Stretch="Fill" ImageSource="/BPASmartClient.CustomResource;component/Image/背景2.png" />
  35. </Border.Background>
  36. <Grid>
  37. <Grid.RowDefinitions>
  38. <RowDefinition Height="auto" />
  39. <RowDefinition Height="*" />
  40. </Grid.RowDefinitions>
  41. <Grid.ColumnDefinitions>
  42. <ColumnDefinition Width="auto" />
  43. <ColumnDefinition Width="*" />
  44. </Grid.ColumnDefinitions>
  45. <Image x:Name="Icon" Grid.RowSpan="2" MaxWidth="26" Margin="10,0,10,0" VerticalAlignment="Center" Stretch="Uniform" ></Image>
  46. <Grid Grid.Row="0" Grid.Column="1">
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="auto" />
  49. <ColumnDefinition Width="*" />
  50. </Grid.ColumnDefinitions>
  51. <TextBlock x:Name="title" Grid.Column="0" VerticalAlignment="Center" FontSize="14"
  52. Text="{Binding Title}" FontWeight="Bold">
  53. <TextBlock.Foreground>
  54. <SolidColorBrush Color="{Binding Path=color}" Opacity="1"/>
  55. </TextBlock.Foreground>
  56. </TextBlock>
  57. <TextBlock x:Name="count" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14"
  58. Text="{Binding count, StringFormat='1/{0}'}" FontWeight="Bold">
  59. <TextBlock.Foreground>
  60. <SolidColorBrush Color="{Binding Path=color}" Opacity="1"/>
  61. </TextBlock.Foreground>
  62. </TextBlock>
  63. </Grid>
  64. <TextBlock x:Name="text" Grid.Row="1" Grid.Column="1" Margin="0,8,30,0"
  65. Text="{Binding Content}"
  66. TextWrapping="Wrap" Background="Transparent">
  67. <TextBlock.Foreground>
  68. <SolidColorBrush Color="#f4f4f5" Opacity="1"/>
  69. </TextBlock.Foreground>
  70. </TextBlock>
  71. <Image x:Name="PART_CloseButton" Grid.ColumnSpan="2" ToolTip="关闭窗口" Margin="0,0,5,0" Source="/BPASmartClient.CustomResource;component/Image/btn_close.png" HorizontalAlignment="Right" Width="12" Height="12" VerticalAlignment="Center" MouseLeftButtonDown="PART_CloseButton_MouseLeftButtonDown" Cursor="Hand"></Image>
  72. </Grid>
  73. </Border>
  74. </Grid>
  75. <DataTemplate.Triggers>
  76. <DataTrigger Binding="{Binding NotifiactionType}" Value="Info">
  77. <Setter TargetName="Icon" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/消息.png"/>
  78. </DataTrigger>
  79. <DataTrigger Binding="{Binding NotifiactionType}" Value="Warn">
  80. <Setter TargetName="Icon" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/告警.png"/>
  81. </DataTrigger>
  82. <DataTrigger Binding="{Binding NotifiactionType}" Value="Error">
  83. <Setter TargetName="Icon" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/报错.png"/>
  84. </DataTrigger>
  85. <DataTrigger Binding="{Binding NotifiactionType}" Value="Success">
  86. <Setter TargetName="Icon" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/告警/正常.png"/>
  87. </DataTrigger>
  88. <EventTrigger RoutedEvent="Grid.Loaded" SourceName="NoticeGrid">
  89. <BeginStoryboard x:Name="FadeInStoryBoard">
  90. <Storyboard>
  91. <DoubleAnimation Duration="0:0:0.2" From="0.01" Storyboard.TargetName="NoticeGrid"
  92. Storyboard.TargetProperty="Opacity"
  93. To="1" />
  94. <DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetName="NoticeGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
  95. <DoubleAnimation.EasingFunction>
  96. <CubicEase EasingMode="EaseOut"/>
  97. </DoubleAnimation.EasingFunction>
  98. </DoubleAnimation>
  99. <DoubleAnimation BeginTime="0:0:10" Duration="0:0:0.2" From="1"
  100. Storyboard.TargetName="NoticeGrid"
  101. Storyboard.TargetProperty="Opacity" To="0" />
  102. </Storyboard>
  103. </BeginStoryboard>
  104. </EventTrigger>
  105. <Trigger Property="IsMouseOver" Value="True">
  106. <Trigger.EnterActions>
  107. <SeekStoryboard BeginStoryboardName="FadeInStoryBoard" Offset="0:0:3" />
  108. <PauseStoryboard BeginStoryboardName="FadeInStoryBoard" />
  109. </Trigger.EnterActions>
  110. <Trigger.ExitActions>
  111. <SeekStoryboard BeginStoryboardName="FadeInStoryBoard" Offset="0:0:3" />
  112. <ResumeStoryboard BeginStoryboardName="FadeInStoryBoard" />
  113. </Trigger.ExitActions>
  114. </Trigger>
  115. <EventTrigger RoutedEvent="Button.Click" SourceName="PART_CloseButton">
  116. <BeginStoryboard>
  117. <Storyboard>
  118. <DoubleAnimation Duration="0:0:0" From="1" Storyboard.TargetName="NoticeGrid"
  119. Storyboard.TargetProperty="(Grid.Opacity)"
  120. To="0" />
  121. </Storyboard>
  122. </BeginStoryboard>
  123. </EventTrigger>
  124. <Trigger SourceName="NoticeGrid" Property="Opacity" Value="0">
  125. <Setter TargetName="NoticeGrid" Property="Visibility" Value="Hidden" />
  126. <Trigger.EnterActions>
  127. <BeginStoryboard Storyboard="{StaticResource CollapseStoryboard}" />
  128. </Trigger.EnterActions>
  129. </Trigger>
  130. </DataTemplate.Triggers>
  131. </DataTemplate>
  132. </Window.Resources>
  133. <ItemsControl x:Name="NotificationsControl"
  134. FocusVisualStyle="{x:Null}"
  135. ItemTemplate="{StaticResource NotifiactionTemplate}"
  136. ItemsSource="{Binding .}" />
  137. </Window>