随便写下,试试.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简单测试的更多相关文章

  1. TODO:Golang UDP连接简单测试慎用Deadline

    TODO:Golang UDP连接简单测试慎用Deadline UDP 是User Datagram Protocol的简称, 中文名是用户数据报协议,是OSI(Open System Interco ...

  2. .net orm比较之dapper和Entity Framework6的简单测试比较

    .net orm比较之dapper和Entity Framework6的简单测试比较

  3. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(37)-文章发布系统④-百万级数据和千万级数据简单测试

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(37)-文章发布系统④-百万级数据和千万级数据简单测试 系列目录 我想测试EF在一百万条数据下的显示时间! ...

  4. ORACLE 数据库简单测试

    ORACLE 数据库简单测试 操作系统:Windows 7 – ORACLE:oracle database 10.2.0.4 一.目的 测试 启动监听程序.数据库  非同一个用户的情况,用户是否可以 ...

  5. Javascript的简单测试环境

    在<JavaScript忍者秘籍>2.4测试条件基础知识中,作者给出了一个精简版的assert和assert组的实现,对于初学者而言,这无疑是一个很好的例子,既让我们得到了一个好用的小工具 ...

  6. struts2+hibernate+spring注解版框架搭建以及简单测试(方便脑补)

    为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...

  7. struts2+hibernate+spring配置版框架搭建以及简单测试(方便脑补)

    为了之后学习的日子里加深对框架的理解和使用,这里将搭建步奏简单写一下,目的主要是方便以后自己回来脑补: 1:File--->New--->Other--->Maven--->M ...

  8. [20190423]简单测试latch nowilling等待模式.txt

    [20190423]简单测试latch nowilling等待模式.txt --//我对这个问题的理解就是如果参数willing=0,表示无法获取该latch,直接退出,再寻找类似的latch.--/ ...

  9. Javascript学习-简单测试环境

    Javascript学习-简单测试环境 在<JavaScript忍者秘籍>2.4测试条件基础知识中,作者给出了一个精简版的assert和assert组的实现,对于初学者而言,这无疑是一个很 ...

随机推荐

  1. 安装Visual Studio 语言包时出现windows 程序兼容模式已打开.请将其关闭

    打开 cmd.exe 输入 安装包路径 /Uninstall例如:D:\vs_lang_cn.exe /Uninstall (中间有个空格,Uninstall前是个左斜杠)回车 后 安装包会运行.点击 ...

  2. CRC16 的生成及校验原理

    参考:https://blog.csdn.net/niepangu/article/details/45499383 计算CRC的过程,就是用一个特殊的“除法”,来得到余数,这个余数就是CRC. 它不 ...

  3. Fiddler2如何对Android应用进行抓包

    Fiddler2抓包工具的下载和使用  2018-04-22 18:06:37     0     0     0 Fiddler是一款非常流行并且实用的http抓包工具,它的原理是在本机开启了一个h ...

  4. opcache 参数说明 --转自https://www.cnblogs.com/tudou1223/p/5362785.html

    PHP的opcode缓存又出了新成员(说新不新,也有一段日子了),那就是opcache.新浪微博等都在使用,惠新宸老师强力推荐.本人最近根据官网地址(http://www.php.net/manual ...

  5. 在图像中随机更改像素值程序——matlab

    I=imread('C:\Users\wangd\Desktop\result3.png'); % m = rgb2gray(I); % r = unidrnd(,,); %产生一个1*100的数组, ...

  6. LeetCode - 13. 罗马数字转整数

    1 题目描述 罗马数字包含以下七种字符: I, V, X, L,C,D 和 M. 字符 数值 I V X L C D M 例如, 罗马数字 2 写做 II ,即为两个并列的 1.12 写做 XII , ...

  7. 用c语言创建双向环形链表

    作为一个C开发人员,无论在求职笔试题中,还是在工程项目中,都会遇到用c语言创建双向环形链表.这个也是理解和使用c指针的一项基本功. #include<...>//头文件省略 typedef ...

  8. 【Centos】Postgresql连接测试(Perl和Ruby)

    Centos安装了PostgreSQL之后,将考虑如何让Perl与Ruby连接它. Perl连接方式 1,安装Perl的数据库连接包 perl-DBD-Pg perl-DBI yum install ...

  9. LeetCode——17. Letter Combinations of a Phone Number

    一.题目链接: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ 二.题目大意: 给定一段数字字符串,其中每个数 ...

  10. vue插件大全汇总

    Vue是一个构建数据驱动的 web 界面的渐进式框架.Vue.js 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件特别整理了常用的vue插件,来了个大汇总,方便查找使用,便于工作 ...