Edi Wang

.NET and Azure Developer

Posts in September 2016

Windows 10 UWP开发:拼音首字母分组如何去掉“拼音”前缀并支持切换系统语言

Windows 10里面有个脑残设计,就是系统默认的CharacterGroupings类型在中文版系统上会产生除了A-Z字母以外的带“拼音”前缀的另外24个分组。比如开屎菜单里就是这样: 如果我们用这个CharacterGroupings类型去创建带分组的ListView,就会变成这样: 更蛋疼的是,如果用户的系统是英文语言的,他就会发现分组变成空白了,没有任何数据。用户不知道这是微软干的,又得给我们的APP打1星,还要骂我们傻逼。 今天经过研究,终于把这个问题给解决了,不仅去掉了“拼音”前缀,也不用担心用户系统是什么语言的,都能正常显示分组列表。 我们先看看原来的代码。 public class AlphaKeyGroup<T> : List<T> { const string GlobeGroupKey = "?"; …
Windows UWP

Sharing Images in Windows 10 UWP

Starting from Windows 8, one big feature for Windows Store Apps is to share data using Charm Bar across Apps. Although the Charm Bar is removed in Windows 10, but the API for sharing is still in the fight.  For example, in my "Image Portray" App, I can share ink to OneNote or Outlook. Today, I added same capability for my "Shanghai Metro" App. Here's how to do it. First, to share data across …
Windows UWP