uwp

[UWP]抄抄《CSS 故障艺术》的动画

别来无恙 提交于 2020-03-30 13:38:52
1. 前言 什么是故障艺术(Glitch Art 风)?我们熟知的抖音的 LOGO 正是故障艺术其中一种表现形式。它有一种魔幻的感觉,看起来具有闪烁、震动的效果,很吸引人眼球。故障艺术它模拟了画面信号出现故障导致成像错误的感觉。青色色块与红色色块无法重合就是这种故障的体现。从胶片时代开始到今天的数码时代,这种故障一直是观众非常熟悉的现象。 上个月看到 CSS 故障艺术 这篇文章,最近想转换心情于是开始抄它的动画了(顺便为博客园的UWP板块吊命)。CSS的 mix-blend-mode 好像很好用,这次用UWP中Win2D的 BlendEffect 模仿它的玩法。 2. 什么是BlendEffect Microsoft.Graphics.Canvas.Effects 命名空间下的 BlendEffect 用于组合两张图片(分别是作为输入源的Background和Foreground),它包含多种模式,如下图所示: 要使用BlendEffect,需要为它设置Mode,并将Foreground和Background设置为 CompositionEffectSourceParameter : var blendEffect = new BlendEffect() { Mode = BlendEffectMode.Screen, Foreground = new

Protect an SQLite database in an UWP app

半城伤御伤魂 提交于 2020-03-26 07:19:39
问题 It is an UWP application using a SQLite database. Below, the dependencies for this application: { "dependencies": { "Microsoft.EntityFrameworkCore.Sqlite": "1.0.1", "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", "Microsoft.Xaml.Behaviors.Uwp.Managed": "1.1.0", "Newtonsoft.Json": "8.0.3", "Template10": "1.1.*" }, // ... } The requirement is: " [...]to have a password to access the database either from the application or any

Can desktop app desktop-bridged via Visual Studio call UWP APIs?

荒凉一梦 提交于 2020-03-26 05:14:40
问题 I'm a bit confused about calling Calling UWP APIs from a desktop app. The last sentence of the first paragraph of this link states: a WPF, Windows Forms, or Win32 app cannot call UWP API unless the app is packaged in an MSIX package. Using VS2019 I have desktop-bridged my WPF app (developed in VS2019 ). This process created a folder (under ...\AppPackages folder) whose contents are shown below. Double clicking the .appxbundle from this folder, I can successfully sideload the app on my Windows

Debugging UWP .NET app: Unhandled exception at 0x79A1CFAC (SharedLibrary.dll) in MyApp.exe: 0x00001007

三世轮回 提交于 2020-03-25 12:34:20
问题 I've built a Xamarin.Forms app and when I try to debug its UWP frontend in Debug|AnyCPU mode I get this exception at launch: Unhandled exception at 0x79A1CFAC (SharedLibrary.dll) in MyApp.exe: 0x00001007 Visual Studio wouldn't let me copy all the details to the clipboard so I had to take a screenshot: If I run it in Debug|x64 mode I get a completely different exception: Unhandled exception at 0x00007FFFEA232EC0 (Windows.UI.Xaml.dll) in MyApp.exe: 0xC000027B: An application-internal exception

[UWP]XAML中的响应式布局技术

送分小仙女□ 提交于 2020-03-23 18:22:35
响应式布局的概念是一个页面适配多个终端及不同分辨率。在针对特定屏幕宽度优化应用 UI 时,我们将此称为创建响应式设计。WPF设计之初响应式设计的概念并不流行,那时候大部分网页设计师都按着宽度960像素的标准设计。到了UWP诞生的时候响应式布局已经很流行了,所以UWP提供了很多响应式布局的技术,这篇文章简单总结了一些响应式布局常用的技术,更完整的内容请看文章最后给出的参考网站。 1. 传统的XAML如何适配不同分辨率 所谓的 传统 ,是指在响应式设计没流行前XAML就已经存在的应对不同分辨率的技术,毕竟桌面客户端常常也调整窗体的大小,有些人还同时使用两个不同分辨率的屏幕。以我的经验来说以下这些做法可以使UI有效应对分辨率改变: 使用相对定位代替决定定位 使用 * 和 Auto 代替具体尺寸(除了间距) 使用WrapPanel代替StackPanel 不要忘记使用ScrollViewer 不同的DPI设定、不同的本地化字符串长度都可能使整个页面布局乱掉。而且和网页不同,WPF窗体默认没有提供ScrollViewer,所以千万不能忘记。在桌面客户端合理使用以上技术可以避免客户投诉。但UWP主打跨平台,它需要更先进(或者说,更激进)的技术。 2. 响应式设计技术 微软的官方文档介绍了UWP中响应式设计常用的6个技术,包括重新定位、调整大小、重新排列、显示/隐藏、替换和重新构建

[UWP]用画中画模式(CompactOverlay Mode)让用总在最前端显示

◇◆丶佛笑我妖孽 提交于 2020-03-23 18:22:30
1. 什么是,以及怎么用画中画 Windows 10 Creators Update以后UWP提供了一个新的视图模式CompactOverlay,中文翻译成 紧凑的覆盖层 ?反正大部分时间我们都会称它为 画中画模式 。 上图中右上角即为进入画中画模式的微软“电影和电视”应用。 可以调用 ApplicationView.TryEnterViewModeAsync 函数进入或退出CompactOverlayer模式: //进入CompactOverlay模式 await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay); //返回默认模式 await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default); 还可以使用 ViewModePreferences 控制进入CompactOverlay时窗口的大小: //进入CompactOverlay模式并将窗体设置为 200 x 200 像素 var preferences = ViewModePreferences.CreateDefault(ApplicationViewMode

Change height and width of Flyout in UWP app

女生的网名这么多〃 提交于 2020-03-23 12:05:01
问题 I am using a Flyout element in my UWP app as: <Flyout Placement="Full"/> This opens the flyout in the centre of the app as desired. But I am unable to change the height and width of the flyout. How can this be done? 回答1: Something like the below code should work for what you need. private void Flyout_Opened(object sender, object e) { Flyout f = sender as Flyout; Style s = new Windows.UI.Xaml.Style { TargetType = typeof(FlyoutPresenter) }; s.Setters.Add(new Setter(MinHeightProperty, "200")); s

How to display the uwp application in the tray at the bottom right corner of the system

匆匆过客 提交于 2020-03-23 06:39:07
问题 Can uwp applications be displayed in the tray on the lower right corner of the system desktop? 回答1: It is not supported directly for UWP apps to put themselves into the systray, but you can add a desktop extension to your package that can live in the systray and act as a proxy for your UWP. Here is a blog post on that: https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension/ 来源: https://stackoverflow.com/questions/50820673/how-to-display-the-uwp-application-in-the-tray-at-the-bottom

UWP Update UI From Async Worker

为君一笑 提交于 2020-03-20 14:44:29
问题 I am trying to implement a long-running background process, that periodically reports on its progress, to update the UI in a UWP app. How can I accomplish this? I have seen several helpful topics, but none have all of the pieces, and I have been unable to put them all together. For example, consider a user who picks a very large file, and the app is reading in and/or operating on the data in the file. The user clicks a button, which populates a list stored on the page with data from the file

UWP Update UI From Async Worker

痴心易碎 提交于 2020-03-20 14:44:01
问题 I am trying to implement a long-running background process, that periodically reports on its progress, to update the UI in a UWP app. How can I accomplish this? I have seen several helpful topics, but none have all of the pieces, and I have been unable to put them all together. For example, consider a user who picks a very large file, and the app is reading in and/or operating on the data in the file. The user clicks a button, which populates a list stored on the page with data from the file