uwp

Problems with serial device communication in UWP

纵饮孤独 提交于 2019-12-04 11:29:40
I have a peculiar problem. I am trying to communicate with a peripheral unit that requires serial communication in a UWP project. I am using Windows.Devices.SerialCommunication. For purpose of demonstration, I made a new page that has two buttons, with two different click handlers. One for opening the port, and other for sending messages to the peripheral. One handler is: SerialDevice device; private async void Button_Click_1(object sender, RoutedEventArgs e) { string selector = SerialDevice.GetDeviceSelector("COM7"); DeviceInformationCollection devices = await DeviceInformation.FindAllAsync

Deploy Windows Apps to Family and Friends without store, enterprise or development-tools

南楼画角 提交于 2019-12-04 11:11:02
问题 I wrote a App for my family/friends and now we would like deploy it on or PCs. Publishing it in the store is not an option and not everyone has an Widows Live account. Sideloading isn't an option, because we do not own a Enterprise edition. I found only the three already described ways. Either by publishing it in the store, using the development tools or having the enterprise edition. Is there a fourth way to deploy a Windows UWP App without using the Windows Store or the need to install a

Acrylic material in win32 app

寵の児 提交于 2019-12-04 10:41:57
Microsoft recently revealed their new "fluent" design langauge, and one part of it is the "acrylic" material . This effect makes an element transparent and blurs the background. It can either be applied to a window, such that parts of underlying windows shine though (background acrylic), or to individual elements in the window, so other controls shine through (in-app acrylic). It is conceptually and visually very similar to vibrancy on macOS. It is implemented as a special Brush in XAML, but I wonder it there is a way to use it (background acrylic) in a regular Win32 app? The effect looks very

c# UWP 控件 Button(十一)

馋奶兔 提交于 2019-12-04 10:35:13
⚫ Button的VisualStates Button的CotrolTemplate中包含四个VisualState,分别是Normal、PointerOver、Pressed、Disabled。 Normal : Button的默认状态,UWP的按钮是完全扁平化的设计。没有边框。 PointerOver: 鼠标进入的状态,出现边框,背景颜色也会改变。Windows中通常不会用改变鼠标指针来表明“这是一个Button”, 而是让Button进入PointerOver状态。只有HyperlinkButton是特例,符合 W3C的建议 使用了CoreCursorType.Hand作为鼠标指针。 Pressed : 按下的状态,有趣的是除了改变颜色Button还应用了PointerDownThemeAnimation使得按钮向按下方向倾斜, 营造一种有深度的设计。不过这个做法会导致Button的内容变模糊(Projection都有这个问题)。 Disabled : 当IsEnabled="False"时的状态,一般控件都有这个状态,大部分都表现为背景变灰,字体颜色变浅,表示不可操作。 习惯做触屏设计的话很容易就忽略PointerOver状态,目前UWP大部分的应用场景还是在桌面上,所以应该在ControlTemplate中包含这四种VisualState

c# UWP 控件 Button(三)

拈花ヽ惹草 提交于 2019-12-04 10:33:29
⚫ 属性 画布(6) 布局(14) 文本(6) 外观(3) 公共(12) 转换(2) 交互(5) 画布 属性 描述 类型 继承自 Background 获取或设置一个用于描述控件背景的画笔。默认值为 Transparent。 Brush Control BorderBrush 获取或设置一个用于描述控件的边框背景的画笔。默认值为 Transparent。 Brush Control Foreground 获取或设置一个用于描述前景色的画笔。默认值是系统对话框字体颜色 Brush Control FocusVisualPrimaryBrush 获取或设置控件获得焦点时的视觉指示器矩形外边框颜色。 Brush FrameworkElement FocusVisualSecondaryBrush 获取或设置控件获得焦点时的视觉指示器矩形内边框颜色。 Brush FrameworkElement Opacity 获取或设置当 UIElement 在 用户界面 (UI) 中呈现时为其整体应用的不透明度因子。默认不透明度为 1.0。 值应介于 0.0 和 1.0 之间 Double UIElement 布局 属性 描述 类型 继承自 Width 获取或设置元素的宽度。以与设备无关的单位(每个单位 1/96 英寸)为单位。默认值为 NaN(自动调整大小);此值必须等于或大于 0.0。

c# UWP 控件 Button (一)

倖福魔咒の 提交于 2019-12-04 10:31:24
按钮的分类 Extensible Application Markup Language (XAML) 框架提供了一个标准按钮控件,以及多个专用的按钮控件,例如导航、重复的操作或提供菜单。 按钮类型 类型 描述 需求 按钮 Button 用于启动即时操作的按钮。 可以与 Click 事件或 Command 绑定配合使用。 重复按钮 RepeatButton 一种按钮,在被按下时会持续引发 Click 事件。 超链接按钮 HyperlinkButton 一种按钮,其样式设置类似于超链接,用于导航。 有关超链接的详细信息,请参阅超链接。 下拉按钮 DropDownButton 一种带 V 形图标的按钮,用于打开附加的浮出控件。 Windows 10 版本 1809(SDK 17763)或更高版本 拆分按钮 SplitButton 一种按钮,分为两端。 一端启动操作,另一端打开菜单。 Windows 10 版本 1809(SDK 17763)或更高版本 切换式拆分按钮 ToggleSplitButton 一种切换按钮,分为两端。 一端进行开/关切换,另一端打开菜单。 Windows 10 版本 1809(SDK 17763)或更高版本 切换式按钮 ToggleButton 可以打开或关闭的按钮。 Windows 10 版本 1809(SDK 17763)或更高版本

Storing a BitmapImage in LocalFolder - UWP

独自空忆成欢 提交于 2019-12-04 10:24:11
I'm trying to store a BitmapImage to the filesystem using C# on UWP. The image is downloaded from Facebook using the graph api and returned as a BitmapImage. That part works, and to retrieve the image (once I can store it, tested with pictures just dropped in the local folder) I'm using the following code: public static async Task<BitmapImage> GetProfilePicture(string userId){ BitmapImage profilePicture = new BitmapImage(); StorageFolder pictureFolder = await ApplicationData.Current.LocalFolder.GetFolderAsync("ProfilePictures"); StorageFile pictureFile = await pictureFolder.GetFileAsync(userId

UWP: BrightnessOverride StartOverride logic

只愿长相守 提交于 2019-12-04 10:01:41
Does anybody know StartOverride method logic? From documentation: The request to start overriding does not mean that the screen brightness level always changes to match the specified override brightness level. It's still up to the system to decide whether or not to honor this override request. I've wrote simple method to debug brightness changes: protected override void ApplyBrightness(double brightness) { var brightnessOverride = BrightnessOverride.GetForCurrentView(); Debug.WriteLine($"Try to change brightness from {brightnessOverride.BrightnessLevel} to {brightness}"); void

UWP ListView drag behavior for touch

此生再无相见时 提交于 2019-12-04 09:59:32
When using touch to trigger a drag and drop action for a ListView item, it would appear that the behavior has changed between WinRT (Windows 8/8.1) and UWP (Windows 10) apps. In WinRT, "tearing" an item to the left or right would cause it to get detached, initiating the drag behavior. In UWP, the user has to tap and hold an item for a short while, after which moving it initiates the drag action. My question is: is there a way to revert to/implement the old WinRT-style behavior? The new way is not very obvious and in limited user testing I haven't seen one person work it out without having it

How to use autofac in an UWP app?

余生颓废 提交于 2019-12-04 09:59:27
问题 I am using autofac in an UWP application. In my App instance, I am setting up the dependency, like this: public sealed partial class App { private readonly IFacade m_facade; public App() { InitializeComponent(); m_facade = InitializeDependencies(); Suspending += OnSuspending; } private IFacade InitializeDependencies() { var containerBuilder = new ContainerBuilder(); // Registers all the platform-specific implementations of services. containerBuilder.RegisterType<LoggingService>() .As