上一页 1 ··· 102 103 104 105 106 107 108 109 110 ··· 133 下一页
摘要: 要理解 C# 中的 volatile 关键字,就要先知道编译器背后的一个基本优化原理。比如对于下面这段代码: public class Example { public int x; public void DoWork() { x = 5; var y = x + 10; Debug.WriteL 阅读全文
posted @ 2020-12-31 07:51 MaxBruce 阅读(85) 评论(0) 推荐(0)
摘要: class Program { private static volatile bool bChanged; static void Main(string[] args) { Thread t1 = new Thread(run1); Thread t2 = new Thread(run2); t 阅读全文
posted @ 2020-12-30 22:18 MaxBruce 阅读(203) 评论(0) 推荐(0)
摘要: 原文:UWP使用AppService向另一个UWP客户端应用程序提供服务 在上篇里,我使用的是寄宿在WPF上的WCF进行两个程序间的通信,在解决问题的同时,我的同事也在思考能否使用UWP来做这件事。于是,我们发现了App Service,两个UWP应用沟通的桥梁。 App Service以backg 阅读全文
posted @ 2020-12-30 00:21 MaxBruce 阅读(173) 评论(0) 推荐(0)
摘要: 一、Dispatcher介绍 微软在WPF引入了Dispatcher,那么这个Dispatcher的主要作用是什么呢? 不管是WinForm应用程序还是WPF应用程序,实际上都是一个进程,一个进程可以包含多个线程,其中有一个是主线程,其余的是子线程。在WPF或WinForm应用程序中,主线程负责接收 阅读全文
posted @ 2020-12-29 23:46 MaxBruce 阅读(322) 评论(0) 推荐(0)
摘要: 在项目中使用Command绑定能够使我们的代码更加的符合MVVM模式。不了解的同学可能不清楚,只有继承自ButtonBase类的元素才可以直接绑定Command(Button、CheckBox、RadioButton等) <Button Content="Normal" Command="{Bind 阅读全文
posted @ 2020-12-29 23:02 MaxBruce 阅读(1212) 评论(0) 推荐(0)
摘要: 1 新建WPF 应用程序WPFMVVMExample 程序结构如下图所示。 2 Model实现 在Model文件夹下新建业务类StudentModel(类文件StudentModel.cs),类的详细代码如下所示。 using System.ComponentModel; namespace WPF 阅读全文
posted @ 2020-12-29 22:41 MaxBruce 阅读(186) 评论(0) 推荐(0)
摘要: 在 Windows 10 中微软为 UWP 引入了 App Service (即应用服务)这一新特性用以提供应用间交互功能。提供 App Service 的应用能够接收来自其它应用传入的参数进行处理后返回数据。 创建应用服务 要使应用支持提供 App Service 非常简单。只需正确配置应用的清单 阅读全文
posted @ 2020-12-29 07:18 MaxBruce 阅读(624) 评论(0) 推荐(0)
摘要: App Service 是一种背景工作运行的服务,提供给其他Apps 使用就像Web Service。它本身无使用介面(UI-less),允许Apps 在同一个设备被引用,甚至Windows 10 1607 开始允许remote devices 使用它。 [ 重点观念 ] Windows 10, v 阅读全文
posted @ 2020-12-29 07:15 MaxBruce 阅读(473) 评论(0) 推荐(0)
摘要: The Universal Windows Platform (UWP) introduces new mechanisms, which allow the applications to perform some functionality while the application is no 阅读全文
posted @ 2020-12-29 07:01 MaxBruce 阅读(221) 评论(0) 推荐(0)
摘要: 在上篇里,我使用的是寄宿在WPF上的WCF进行两个程序间的通信,在解决问题的同时,我的同事也在思考能否使用UWP来做这件事。于是,我们发现了App Service,两个UWP应用沟通的桥梁。 App Service以background task 的形式允许一个UWP向其它UWP提供服务。 首先我们 阅读全文
posted @ 2020-12-27 22:46 MaxBruce 阅读(200) 评论(0) 推荐(0)
上一页 1 ··· 102 103 104 105 106 107 108 109 110 ··· 133 下一页