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.
*******************************************************************
-->

 

posted @ 2019-08-30 19:20  <--青青子衿-->  阅读(194)  评论(0编辑  收藏  举报
// /**/ // 在页脚Html代码 引入 // function btn_donateClick() { var DivPopup = document.getElementById('Div_popup'); var DivMasklayer = document.getElementById('div_masklayer'); DivMasklayer.style.display = 'block'; DivPopup.style.display = 'block'; var h = Div_popup.clientHeight; with (Div_popup.style) { marginTop = -h / 2 + 'px'; } } function MasklayerClick() { var masklayer = document.getElementById('div_masklayer'); var divImg = document.getElementById("Div_popup"); masklayer.style.display = "none"; divImg.style.display = "none"; } setTimeout( function () { document.getElementById('div_masklayer').onclick = MasklayerClick; document.getElementById('btn_donate').onclick = btn_donateClick; var a_gzw = document.getElementById("guanzhuwo"); a_gzw.href = "javascript:void(0);"; $("#guanzhuwo").attr("onclick","follow('33513f9f-ba13-e011-ac81-842b2b196315');"); }, 900);