位置: 编程技术 - 正文
推荐整理分享Windows 8技巧:Windows 8中的Popup使用方式介绍 (windows 8 1),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:windows8使用教程,win10win8,windows 8whql,windows 8怎么样,win10win8,win10win8,window八,windows 8 1,内容如对您有帮助,希望把文章链接给更多的朋友!
在上一篇文章中我们将了替代Silverlight中MessageBox的MessageDialog控件,本篇文章将讲诉另外一种弹出提示窗口的控件Popup。
一、我们认识Popup控件的IsLightDismissEnabled属性,这个属性设置为true的时候,点击非Popup控件外任何区域将关闭Popup。复制代码代码如下:<Button Content="弹出窗口一" Name="btn1" Width="" Margin=",,0,0" VerticalAlignment="Top" Height="" Click="btn1_Click"/> <Popup x:Name="tip1" IsLightDismissEnabled="True" HorizontalOffset="" VerticalOffset=""> <Grid Width="" Height="" > <Grid.Background> <ImageBrush ImageSource="./BG.png"></ImageBrush> </Grid.Background> <TextBlock Grid.Row="0" Foreground="White" Grid.Column="0" FontSize="" Height="Auto" HorizontalAlignment="Center" Margin="0 0 0" VerticalAlignment="Top"> <Run>众芳摇落独暄妍,占尽风情向小园</Run> <LineBreak/> <LineBreak/> <Run>疏影横斜水清浅,暗香浮动月黄昏</Run> <LineBreak/> <LineBreak/> <Run>霜禽欲下先偷眼,粉蝶如知合断魂</Run> <LineBreak/> <LineBreak/> <Run>幸有微吟可相狎,不须檀板共金樽</Run> </TextBlock> </Grid> </Popup>二、我们看Popup的显示和隐藏时的动画设置,具体类型有以下几种,具体效果可以自己下载实例并且修改实例来观看。
AddDeleteThemeTransition ContentThemeTransition EdgeUIThemeTransition EntranceThemeTransition PaneThemeTransition PopupThemeTransition ReorderThemeTransition RepositionThemeTransition 复制代码代码如下:<Button Content="弹出窗口二" x:Name="btn1_Copy" Width="" Margin=",,0,0" VerticalAlignment="Top" Height="" Click="btn1_Copy_Click"/> <Popup x:Name="tip2" IsLightDismissEnabled="True" HorizontalOffset="" VerticalOffset=""> <Popup.ChildTransitions> <TransitionCollection> <AddDeleteThemeTransition></AddDeleteThemeTransition> <ContentThemeTransition/> <EdgeUIThemeTransition></EdgeUIThemeTransition> <EntranceThemeTransition></EntranceThemeTransition> <PaneThemeTransition></PaneThemeTransition> <PopupThemeTransition></PopupThemeTransition> <ReorderThemeTransition></ReorderThemeTransition> <RepositionThemeTransition></RepositionThemeTransition> </TransitionCollection> </Popup.ChildTransitions> <Grid Width="" Height="" > <Grid.Background> <ImageBrush ImageSource="./BG.png"></ImageBrush> </Grid.Background> <TextBlock Grid.Row="0" Foreground="Yellow" Grid.Column="0" FontSize="" Height="Auto" HorizontalAlignment="Center" Margin="0 0 0" VerticalAlignment="Top"> <Run>莫笑农家腊酒浑,丰年留客足鸡豚</Run> <LineBreak/> <LineBreak/> <Run>山重水复疑无路,柳暗花明又一村</Run> <LineBreak/> <LineBreak/> <Run>萧鼓追随春社近,衣冠简朴古风存</Run> <LineBreak/> <LineBreak/> <Run>从今若许闲乘月,拄杖无时夜叩门</Run> </TextBlock> </Grid> </Popup></p><p> <Button Content="弹出窗口三" x:Name="btn1_Copy1" Width="" Margin=",,0,0" VerticalAlignment="Top" Height="" Click="btn1_Copy1_Click" /> <Popup x:Name="tip3" IsLightDismissEnabled="True" VerticalOffset="" HorizontalOffset="-" HorizontalAlignment="Right"> <Popup.ChildTransitions> <TransitionCollection> <PaneThemeTransition /> </TransitionCollection> </Popup.ChildTransitions> <Grid Width="" Height="" > <Grid.Background> <ImageBrush ImageSource="./BG.png"></ImageBrush> </Grid.Background> <TextBlock Grid.Row="0" Foreground="Coral" Grid.Column="0" FontSize="" Height="Auto" HorizontalAlignment="Center" Margin="0 0 0" VerticalAlignment="Top"> <Run>舍南舍北皆春水,但见群鸥日日来</Run> <LineBreak/> <LineBreak/> <Run>花径不曾缘客扫,蓬门今始为君开</Run> <LineBreak/> <LineBreak/> <Run>盘飧市远无兼味,樽酒家贫只旧醅</Run> <LineBreak/> <LineBreak/> <Run>肯与邻翁相对饮,隔篱呼取尽馀杯</Run> </TextBlock> </Grid> </Popup>三、Popup的内容还可以直接继承于用户控件,以将用户控件直接弹出。下面的实例代码中UC1是一个用户控件,可下载源码观看复制代码代码如下:<Button Content="弹出窗口四" x:Name="btn1_Copy2" Width="" Margin=",,0,0" VerticalAlignment="Top" Height="" Click="btn1_Copy2_Click" /> <Popup x:Name="tip4" IsLightDismissEnabled="True" HorizontalOffset="" VerticalOffset=""> <Popup.ChildTransitions> <TransitionCollection> <AddDeleteThemeTransition/> </TransitionCollection> </Popup.ChildTransitions> <local:UC1/> </Popup>最后如需源码请点击 Win8Popup_gimoo.net 下载。效果如下:
Windows 8技巧:Windows 8 中的三种进度条和两种定时器的使用技巧 在Windows8中的默认进度条也与时俱进,和之前Silverlight中的不一样。本文将讲述三种不同的进度条,另外在本文中也会将两种定时器。进度条主要属性:V
Windows 8技巧:Windows 8 中Slider控件与ToggleSwitch控件的使用方法 一:Silder控件是滑块控件,在Silverlight中也存在,其主要用于音量调节,亮度调节,色彩调节,温度计等。主要属性:FlowDirection:从左向右滑动或者从右向
Windows 8技巧:Windows 8中FlipView的使用技巧介绍 FlipView控件类似于翻页控件,并且是现成的翻页按钮,你只需要为其增加数据项即可。本文讲述两种方式的FlipView项目和展示。一:直接前台FlipViewItem复
标签: windows 8 1
本文链接地址:https://www.jiuchutong.com/biancheng/363779.html 转载请保留说明!上一篇:Windows 8技巧:Windows 8弹出提示框MessageDialog与awaitasync关键字应用技巧(win10win8)
友情链接: 武汉网站建设