WPF 右下角弹窗的简单实现
生活随笔
收集整理的這篇文章主要介紹了
WPF 右下角弹窗的简单实现
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
軟件中經(jīng)常出現(xiàn)右下角彈窗,從下面緩緩彈出的,這次就做個(gè)簡(jiǎn)陋的實(shí)現(xiàn),
思路就是在窗口加載和關(guān)閉時(shí)執(zhí)行動(dòng)畫(huà)DoubleAnimation
今天懶得做界面了,只實(shí)現(xiàn)了功能。
看看效果:
下面看看代碼:
主窗口添加一個(gè)按鈕 ,點(diǎn)擊事件:
,新建一個(gè)NotifyWindow:
xaml:
<Window x:Class="WPFDemos.NotifyWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WPFDemos"mc:Ignorable="d"Background="Transparent"AllowsTransparency="True"WindowStyle="None"x:Name="window"Title="NotifyWindow" Height="200" Width="300"><Grid Margin="8" Background="White"><Grid.Effect><DropShadowEffect BlurRadius="8" ShadowDepth="0" Color="Black"/></Grid.Effect><Button Content="關(guān)閉" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" Click="Button_Click"/><TextBlock Text="{Binding Message,ElementName=window}" FontSize="35" HorizontalAlignment="Center" VerticalAlignment="Center"/></Grid> </Window>后臺(tái)代碼:
完啦?
總結(jié)
以上是生活随笔為你收集整理的WPF 右下角弹窗的简单实现的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 接口管理平台YApi
- 下一篇: asp.net ajax控件工具集 Au