UWP tips (与wp8.1的不同)

一、异步调用之后,要更新UI时,代码如下

await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {            
                test.Text = "abc";
            });

 二、原来的ApplicationBar更改为CommandBar

<AppBarButton Label="评价" Click="appbarRank_Click">
     <AppBarButton.Icon>
         <BitmapIcon UriSource="Images/Tools/pingjia.png" />
     </AppBarButton.Icon>
</AppBarButton>
<CommandBar.SecondaryCommands>
    <AppBarButton Icon="Like" Label="Like" IsCompact="True"/>
    <AppBarButton Icon="Dislike" Label="Dislike" />
</CommandBar.SecondaryCommands>

 三、原来在wp8.1中状态栏StatusBar类在UWP中也发生了改变

现在要控制UWP状态栏(显示信号、时间),可以用以下的方法

1.在项目中选择 添加引用

2.选择 Universal Windows , Extensions

3.将Windows Mobile Extensions for the UWP添加进项目中

代码:

if(Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
    StatusBar statusBar = StatusBar.GetForCurrentView();
    statusBar.ForegroundColor = Colors.White;//设置状态栏信号、时间等图标的颜色
await statusBar.HideAsync();//隐藏状态栏 }

 四、PC/Mobile的UWP开发中如果要用到WebView,可以先用windows 10的edge浏览器调试。在edge浏览器中调出F12开发人员工具,选择“仿真”,模式中有桌面和windows10移动版选择。

 五、Segoe MDL2图标指南,地址:https://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/jj841126.aspx

Segoe MDL2图标样式与对应代码可以用cortana搜索“字符映射表”

转载于:https://www.cnblogs.com/cjxy1993/p/4859020.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值