WPF 滚动墙
<!-- **************************************************************** * 作 者 :姜 彦 * 项目名称 :EMRCPOE.Presentation.UC.View * 控件名称 :FadeWall * 命名空间 :EMRCPOE.Presentation.UC.View * CLR 版本 :4.0.30319.42000 * 创建时间 :2019/8/28 19:17:42 * 当前版本 :1.0.0.0 * WeChatQQ :771078740 * My Email :jiangyan2008.521@gmail.com * jiangyan2008.521@qq.com * 描述说明 :渐入渐出墙控件 * * 修改历史 : * **************************************************************** * Copyright @ JiangYan 2019 All rights reserved **************************************************************** --> <UserControl x:Class="EMRCPOE.Presentation.UC.View.FadeWall" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:EMRCPOE.Presentation.UC.View" x:Name="fadeWall" mc:Ignorable="d" Background="Transparent" Height="45" Width="360"> <Grid> <Canvas VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="{Binding ElementName=fadeWall,Path=Height}" ClipToBounds="True"> <StackPanel Name="stp" Width="{Binding ElementName=fadeWall,Path=Width}"> <StackPanel.RenderTransform> <TranslateTransform Y="0" /> </StackPanel.RenderTransform> <ListBox x:Name="lstb" VerticalAlignment="Top" HorizontalAlignment="Stretch" Width="{Binding ElementName=fadeWall,Path=Width}" Margin="0" Foreground="{Binding ElementName=fadeWall,Path=Foreground}" FontSize="{Binding ElementName=fadeWall,Path=FontSize}" Background="Transparent" BorderThickness="0"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Foreground" Value="{Binding ElementName=fadeWall,Path=Foreground}" /> <Setter Property="HorizontalContentAlignment" Value="Center" /> </Style> </ListBox.ItemContainerStyle> </ListBox> </StackPanel> <Canvas.Triggers> <EventTrigger RoutedEvent="Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation x:Name="dAnimation" From="0" To="-100" Duration="0:0:5" RepeatBehavior="Forever" Storyboard.TargetName="stp" Storyboard.TargetProperty="RenderTransform.Y" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Canvas.Triggers> </Canvas> </Grid> </UserControl> <!-- ******************************************************************* * 备 注 : * * * ******************************************************************* * Copyright @ JiangYan 2019. All rights reserved. ******************************************************************* -->
![](https://files-cdn.cnblogs.com/files/jiangyan219/Alipay.bmp)
您的资助是我最大的动力!
金额随意,欢迎来赏!
![](https://files-cdn.cnblogs.com/files/jiangyan219/WeChat.bmp)
我写的东西能让你能懂,那是义务
毕竟占用了你生命中的宝贵的时间和注意力
要是你还能喜欢我的作品,那就是缘分了
如果,您希望更容易地发现我的新博客,不妨点击一下绿色通道的因为,我的写作热情也离不开您的肯定支持,感谢您的阅读,我是【青青子衿】!