uwp

UWP: BrightnessOverride StartOverride logic

孤者浪人 提交于 2019-12-06 05:51:48
问题 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

UWP apps accessing files from random location on system

烈酒焚心 提交于 2019-12-06 05:41:24
问题 in UWP there are files and permissions restrictions, so we can only acces files directly from few folders or we can use filepicker to access from anywhere on system. how can I use the files picked from filepicker and use them anytime again when the app runs ? tried to use them again by path but it gives permission error. I know about the "futureacceslist" but its limit is 1000 and also it will make the app slow if I am not wrong? . Is there a better way to do this ? or can we store storage

Acrylic material in win32 app

烈酒焚心 提交于 2019-12-06 05:38:40
问题 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

Notifying all properties of the viewmodel has changed with null or string empty

你说的曾经没有我的故事 提交于 2019-12-06 05:16:43
I'm coming from developing WPF solutions where to update all properties of the viewmodel was as simple as: OnPropertyChanged(String.Empty); In the Universal Windows Platform scenario, I just have the same method to update/refresh the properties. This works fine in most of cases but sometimes it raise an error something like this: COMException Error HRESULT E_FAIL has been returned from a call to a COM component. at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) at GeekyTool.Base.BindableBase.OnPropertyChanged(String propertyName) at Pooo.set

【UWP】仅在TextBlock文本溢出时显示Tooltip

和自甴很熟 提交于 2019-12-06 05:11:34
原文: 【UWP】仅在TextBlock文本溢出时显示Tooltip 前言 这是我今天在回答SO问题时偶然遇到的,觉得可能还比较通用,就记录下来以供参考。 通常,我们使用 ToolTip 最简单的方式是这样: <TextBlock Text="Test" ToolTipService.ToolTip="Test" /> 这样在光标悬浮在 TextBlock 上方时,会显示一个提示条,但是这似乎又违背了一个设计原则: ToolTip作为提示,应该仅在当前内容显示不全,且用户有意愿查看完整内容时作为替代元素出现 这很好理解,如果 TextBlock 足以显示所有文本内容,那么显示 Tooltip 显然是多此一举的事情。但UWP并没有对这种常见的情况进行自动处理,比如将 TextBlock 在文本溢出时自动显示 Tooltip 作为一个默认行为,所以我们就需要自己来实现这个操作。 思路 我能想到的思路是借助 TextBlock.IsTextTrimmed 属性,在 True 的时候设置Tooltip的值为 TextBlock.Text ,在 False 的时候设置 Tooltip 的值为 null 。 但在实际创建的时候,我发现这很难做到,原因如下: Converter的 ConverterParameter 属性是一个简单对象(object),无法通过绑定进行传值(只有

Xamarin Form - TaskCanceledException thrown on ScanFilesToFolderAsync

老子叫甜甜 提交于 2019-12-06 04:52:22
in my UWP application i am working on scan functionality. in this application user can scan the document through scanner by selecting flatbed or auto feeder.Now problem is when i am trying to scan it gives the en exception a Task was canceled. please help.. thanks in advance. :) have a great day... :) private async void Btnscan_Click(object sender, RoutedEventArgs e) { FolderPicker folderPicker = new FolderPicker(); folderPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; folderPicker.FileTypeFilter.Add("*"); StorageFolder folder = await folderPicker.PickSingleFolderAsync(); /

c# UWP autoscrolling text

萝らか妹 提交于 2019-12-06 04:47:32
问题 I'm currently building an application for raspberry Pi (windows IoT) which accepts UDP messages and shows them on the screen. I need a way to make the text horizontally scroll over the screen automatically. I can't let the user click a button because there are no input devices connected to the Pi. So far I've been toying around with a scrollviewer and adjusting it's HorizontalAlignment value manually, but with no avail (I'm kinda new to the whole UWP/XAML stuff). Can anyone show me some code

In universal windows apps, how to change the background color of a button using xaml and databinding if a property in the view model changes

杀马特。学长 韩版系。学妹 提交于 2019-12-06 04:32:21
问题 Universal windows apps don't support data triggers. Without data triggers, how can I change the background color of a button using xaml and data binding only when a boolean property in the view model changes? For example given this XAML: <StackPanel> <Button Name="ButtonA" Click="ButtonA_Click" Content="A" /> <Button Name="ButtonB" Click="ButtonB_Click" Content="B" /> <Button Name="ButtonC" Click="ButtonC_Click" Content="C" /> </StackPanel> with this code behind private void ButtonA_Click

UWP check the current page for name or instance

社会主义新天地 提交于 2019-12-06 04:29:16
问题 In my UWP app I am launching from protocol or toast. In the onactivated method I want to check whether the apps' mainview is open or which page it is showing. All from the App.xaml.cs I wanna do something like: If Mainpage is not showing --> Navigate(typeof(MainPage)); or If main window is not open since i am coming from protocol or toast launch open frame and navigate to mainpage. not sure how to go about it. 回答1: So I'm checking for var frame = Window.Current.Content as Frame; if (frame !=

UWP UnauthorizedException

喜夏-厌秋 提交于 2019-12-06 04:28:17
问题 I am currently writing my first UWP app just to learn the ropes. I am building a small application that pulls data from downloaded facebook-archive. But when I try to open the file (even though everybody has full access) I get an UnauthorizedException. I don't understand this and I haven't found anybody having this problem with just any old file (there are many people having problems with more specific scenarios but not just a simple file on their hard drive) System