WPF實現TextBlock呼吸燈效果

 

實現代碼spa

                            <TextBlock Text="錄像中" FontSize="48" Foreground="#ED4646" HorizontalAlignment="Center" FontWeight="Medium" x:Name="TextBlockRecording">
                                <TextBlock.Triggers>
                                    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                        <BeginStoryboard>
                                            <Storyboard BeginTime="0:0:0" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever">
                                                <ColorAnimation From="#ED4646" To="#F0F2F7" RepeatBehavior="Forever" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="TextBlockRecording">
                                                </ColorAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </EventTrigger>
                                </TextBlock.Triggers>
                            </TextBlock>

TextBox關閉中文輸入法:xml

引用:xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"blog

<TextBox x:Name="TextBoxSctm" Style="{StaticResource TextBoxExtend}" controls:InfoElement.Placeholder="掃碼" HorizontalAlignment="Right" Height="35" Width="100" VerticalAlignment="Center" Margin="10,0,0,0" KeyDown="TextBoxSctm_OnKeyDown" input:InputMethod.IsInputMethodEnabled="False"></TextBox>
相關文章
相關標籤/搜索