随便写下,试试.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. Python学习基本小练习

    对于python的10个小练习做下笔记 1.使用while循环输入1 2 3 4 5 6 8 9 10...自己写的代码如下: num1 = 0 while num1 < 10: num1 = ...

  2. PowerShell ISE:Windows Server 2008 R2默认不安装

    PowerShell ISE:Windows Server 2008 R2默认不安装,需要手动安装,在PowerShell运行如下两段脚本: Import-Module ServerManager A ...

  3. 使用透视表pivot_table

    使用透视表pivot_table 功能:从一张大而全的表格中提取出我们需要的信息来分析 import pandas as pd unames = ['user_id', 'gender', 'age' ...

  4. 为毛GPU Cache不能移动顶点?

    这篇文章属于典型的剥洋葱文,由表及里,逐步引入新的知识点,挖掘最本质的原因.这篇文的逻辑是先假设再证明,按照这个思路去阅读会比较轻松. Maya里的GPU Cache导入的几何体为什么不能编辑顶点?这 ...

  5. C# .NET MD5 HASH

    using System; using System.Security.Cryptography; using System.Text; namespace AAA { /// <summary ...

  6. 安装.net 服务时出现0x80131515错误的解决办法

    使用InstallUtil.exe安装一个用.NET写的Windows服务时,报错了,错误信息如下: Exception occurred while initializing the install ...

  7. WMware 中CentOS系统Hadoop 分布式环境搭建(一)——Hadoop安装环境准备

    1.创建3台虚拟机并装好系统,这里使用64位CentOS. 2.Ping测试[确保两两能ping通]: [ping xxx.xxx.xxx.xxx] 3.安装SSH:[yum install ssh ...

  8. iOS9.3描述文件怎么安装

    iOS9.3 beta描述文件安装教程:1.复制以下地址:http://bbs.feng.com/plugin.php?id=attachment_download:tongji&aid=11 ...

  9. ABAP笔记

    ABAP程序开发,经常会遇到报表开发需求.使用ABAP的Report类型程序开发报表十分便利,用很少的代码就可以快速开发出一个报表.这种报表需求,抛开各种细枝末节,都可以归结为“三步走”:1.选择屏幕 ...

  10. centos 下安装mulval工具

    我这里采用的是centos 6.5版本系统 MulVAL是企业网络安全分析的工具.它使用漏洞扫描程序(OVAL / Nessus)作为攻击路径生成的数源,其中包括扫描结果和网络可访问性信息. 在这之前 ...