Windows8开发5-Windows 8 App AppBar

Windows8开发5-Windows 8 App AppBar

ID:40581150

大小:45.63 KB

页数:4页

时间:2019-08-04

Windows8开发5-Windows 8 App AppBar_第1页
Windows8开发5-Windows 8 App AppBar_第2页
Windows8开发5-Windows 8 App AppBar_第3页
Windows8开发5-Windows 8 App AppBar_第4页
资源描述:

《Windows8开发5-Windows 8 App AppBar》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、TravelJourney-AppBar1.1添加AppBar这里,我们选择在ItemDetailsPage页面添加AppBar,代码如下:

2、Name="RightPanel"Orientation="Horizontal"Grid.Column="1"HorizontalAlignment="Right">1.2实现AppBar上的按钮(PINtoStart)在ItemDetailsPage的后台文件中添加代码:voidInit(){pinToAppBar.Click+=pinToAppBar

3、_Click;pageRoot.BottomAppBar.Opened+=BottomAppBar_Opened;}voidBottomAppBar_Opened(objectsender,objecte){ToggleAppBarButton(!SecondaryTile.Exists(((SampleDataItem)this.flipView.SelectedItem).UniqueId));}RectGetElementRect(FrameworkElementelement){FrameworkEl

4、ementsender=(FrameworkElement)pinToAppBar;Windows.UI.Xaml.Media.GeneralTransformbuttonTransform=sender.TransformToVisual(null);Windows.Foundation.Pointpoint=buttonTransform.TransformPoint(newPoint());Windows.Foundation.Rectrect=newRect(point,newSize(element

5、.ActualWidth,element.ActualHeight));returnrect;}asyncvoidpinToAppBar_Click(objectsender,RoutedEventArgse){varitem=(SampleDataItem)this.flipView.SelectedItem;varuri=newUri(item.TileImagePath.AbsoluteUri);if(SecondaryTile.Exists(item.UniqueId)){SecondaryTiles

6、econdaryTile=newSecondaryTile(item.UniqueId);boolisUnpinned=awaitsecondaryTile.RequestDeleteForSelectionAsync(GetElementRect((FrameworkElement)sender),Windows.UI.Popups.Placement.Above);ToggleAppBarButton(isUnpinned);}else{SecondaryTilesecondaryTile=newSeco

7、ndaryTile(item.UniqueId,item.UniqueId,item.UniqueId,item.UniqueId,TileOptions.None,uri);boolisPinned=awaitsecondaryTile.RequestCreateForSelectionAsync(GetElementRect((FrameworkElement)sender),Windows.UI.Popups.Placement.Above);ToggleAppBarButton(!isPinned);

8、}pageRoot.BottomAppBar.IsOpen=false;}privatevoidToggleAppBarButton(boolshowPinButton){if(pinToAppBar!=null)pinToAppBar.Style=(showPinButton)?(Application.Current.Resources["PinAppBarButtonStyle"]asStyl

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。