UWP简单测试
随便写下,试试.Net Core与UWP开发,后台WCF
XAML
<Page
x:Class="App3.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App3"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Column="0" Grid.Row="0" Name="btnNew" Content="New" Click="btnNew_Click" ></Button>
<TextBox x:Name="txtTime" Grid.Column="0" Grid.Row="1" TextWrapping="Wrap" Text="" VerticalAlignment="Stretch" />
<Button Grid.Column="1" Grid.Row="0" x:Name="btnNew_Copy" Content="New" Click="btnNew_Copy_Click" />
<TextBox x:Name="txtText" Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Text="" VerticalAlignment="Stretch" Grid.ColumnSpan="2" />
</Grid>
</Page>
CS页
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation; // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 namespace App3
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
protected int count = ;
public MainPage()
{
this.InitializeComponent();
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = new TimeSpan();
timer.Tick += Timer_Tick;
timer.Start();
} private void btnNew_Click(object sender, RoutedEventArgs e)
{
var buttonLabel = Dispatcher.RunAsync( Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
{
var popup = new Windows.UI.Popups.MessageDialog("Question", "Please pick a button to continue");
popup.Commands.Add(new Windows.UI.Popups.UICommand("Button 1"));
popup.Commands.Add(new Windows.UI.Popups.UICommand("Button 2", new Windows.UI.Popups.UICommandInvokedHandler(commandShow)));
popup.CancelCommandIndex = ; // About to show the dialog
var command = await popup.ShowAsync(); // Dialog has been dismissed by the user
}); } private void commandShow(IUICommand command)
{
txtText.Text = "";
} public static async Task<string> ShowMessageAsync()
{
// Set up a MessageDialog
var popup = new Windows.UI.Popups.MessageDialog("Question", "Please pick a button to continue");
popup.Commands.Add(new Windows.UI.Popups.UICommand("Button 1"));
popup.Commands.Add(new Windows.UI.Popups.UICommand("Button 2"));
popup.CancelCommandIndex = ; // About to show the dialog
var command = await popup.ShowAsync(); // Dialog has been dismissed by the user
return command.Label;
} private void Timer_Tick(object sender, object e)
{
txtTime.Text = (count++).ToString();
} private async void btnNew_Copy_Click(object sender, RoutedEventArgs e)
{
txtText.Text = await WCFService.GetDataAsync();
}
}
}
发布可通过store发布windows store或发布测试版,需手工安装证书与对应版本CoreRuntime
UWP简单测试的更多相关文章
- TODO:Golang UDP连接简单测试慎用Deadline
TODO:Golang UDP连接简单测试慎用Deadline UDP 是User Datagram Protocol的简称, 中文名是用户数据报协议,是OSI(Open System Interco ...
- .net orm比较之dapper和Entity Framework6的简单测试比较
.net orm比较之dapper和Entity Framework6的简单测试比较
- 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(37)-文章发布系统④-百万级数据和千万级数据简单测试
原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(37)-文章发布系统④-百万级数据和千万级数据简单测试 系列目录 我想测试EF在一百万条数据下的显示时间! ...
- ORACLE 数据库简单测试
ORACLE 数据库简单测试 操作系统:Windows 7 – ORACLE:oracle database 10.2.0.4 一.目的 测试 启动监听程序.数据库 非同一个用户的情况,用户是否可以 ...
- Javascript的简单测试环境
在<JavaScript忍者秘籍>2.4测试条件基础知识中,作者给出了一个精简版的assert和assert组的实现,对于初学者而言,这无疑是一个很好的例子,既让我们得到了一个好用的小工具 ...
- struts2+hibernate+spring注解版框架搭建以及简单测试(方便脑补)
为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...
- struts2+hibernate+spring配置版框架搭建以及简单测试(方便脑补)
为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...
- [20190423]简单测试latch nowilling等待模式.txt
[20190423]简单测试latch nowilling等待模式.txt --//我对这个问题的理解就是如果参数willing=0,表示无法获取该latch,直接退出,再寻找类似的latch.--/ ...
- Javascript学习-简单测试环境
Javascript学习-简单测试环境 在<JavaScript忍者秘籍>2.4测试条件基础知识中,作者给出了一个精简版的assert和assert组的实现,对于初学者而言,这无疑是一个很 ...
随机推荐
- python requests 请求禁用SSL警告信息解决
Python3 requests模块发送HTTPS请求,关闭SSL 验证,控制台会输出以下错误: InsecureRequestWarning: Unverified HTTPS request is ...
- python 将本地目录暴露为http服务
python3 nohup python3 -m http.server 8080 &
- delphi 调用QQ邮箱发送邮件
procedure TForm1.FormCreate(Sender: TObject); begin try IdSMTP1.AuthenticationType := atLogin; IdSMT ...
- python 画图工具matplotlib 去掉坐标轴和坐标的方法
1. 去掉坐标轴的方法: plt.axis('off') 2.去掉刻度的方法: plt.xticks([]) plt.yticks([]) 以上语句需要将其置于 plt.show() 之前,plt.i ...
- Azure CosmosDB (12) 创建Cosmos DB并执行查询语句
<Windows Azure Platform 系列文章目录> The SQL API supports the following aggregate functions. SUM an ...
- 黄聪:原生js的音频播放器,兼容pc端和移动端(原创)
更新时间:2018/9/3 下午1:32:54 更新说明:添加音乐的loop设置和ended事件监听 loop为ture的时候不执行ended事件 1 2 3 4 5 6 7 8 9 10 11 12 ...
- CentOS 6 update curl
touch /etc/yum.repos.d/city-fan.repo vi /etc/yum.repos.d/city-fan.repo add the following: [CityFan] ...
- 系统右键菜单(级联菜单)资料--cascading menus
通过RegistryKey 简单的实现单级菜单 http://www.cnblogs.com/sjcatsoft/archive/2009/02/25/1398203.html 通过subcomman ...
- python request Payload 数据处理
普通的http的post请求的请求content-type类型是:Content-Type:text/html; charset=UTF-8, 而另外一种形式request payload,其Cont ...
- 实现mypwd和mybash
一.pwd 1.学习pwd命令 man pwd查看pwd功能 可以得知pwd功能是打印当前目录 2.研究pwd实现需要的系统调用(man -k; grep),写出伪代码 (1)man -k direc ...