win-universal-app

How to convert a Windows.UI.Color into a string color name in a Windows Universal app

不问归期 提交于 2019-12-04 10:41:53
I'm trying to convert a Windows.UI.Color into a simple string color name in my Windows 8.1 Universal app. I already have the ARGB values from the Color (even the hex code), and I just want its associated known name (for example, from #7AFF7A7A to "salmon"). Since System.Drawing is not available in WinRT, I cannot use ColorConverter or ColorTranslator. I've tried converting the Windows.UI.Color object into a SolidColorBrush or even a Brush, but none of them provide the name conversion capability. What's the best way of doing this? The Colors class contains named properties for many colors.

HttpClient is adding it's own cookie header

百般思念 提交于 2019-12-04 09:55:49
I have rather strange problem. With all that questions over internet how to add and get cookies, I want the opposite ;) When I try to send request via HttpHandler it is adding it's own Cookie header. I have to get rid of it. Without digging into details - when it is added, server I am trying to request is giving me wrong answer. It works without this cookie (tried in fiddler). But back to the problem, code: string domain = "someMysteriousDomain"; var handler = new HttpClientHandler(); handler.UseDefaultCredentials = false; handler.AllowAutoRedirect = true; handler.ClientCertificateOptions =

Html editing in Windows 10 similar to Mail app?

旧巷老猫 提交于 2019-12-04 09:50:44
I want to read HTML and allow my user to edit HTML by providing him all the formatting options like Bold,Italic,Underline,Bullet points,etc. I also noticed that Microsoft is allowing all such formatting options in their default Outlook Mail app when we click on more in Bottom bar. Can someone please suggest is there any direct API to achieve this in Windows 10 or any third party API available in Nuget ? I want to achieve like below: Got a very good article to achieve my requirement on following RichText Editor Hope it helps someone. 来源: https://stackoverflow.com/questions/36540073/html-editing

How can a universal windows app have multiple independent windows (Like Microsoft's app “Photos”)?

泪湿孤枕 提交于 2019-12-04 08:45:26
问题 I do know how to open additional windows using TryShowAsStandaloneAsync . However, if the original window is closed - TryShowAsStandaloneAsync fails (Why?). And I don't know how to "revive" it (-the original window). But "Photos" seems to work fine just like a desktop application. How does it do that? (I'd like to emulate that.) One can open a window with an image, open another one, close the first, and still be able to open more windows. Any way would be fine - some way to launch windows

How to run a Windows 10 IOT app locally?

别说谁变了你拦得住时间么 提交于 2019-12-04 08:11:36
Is there a way to allow a normal Windows 10 installation to run Windows 10 IOT apps for debugging purposes? Right now when I set the architecture from ARM (Raspberry Pi 3) to x64 (Local machine) I get the following error message when I start a debug session: I've read here that it's got something to do with 'embedded mode' but I can't find any information anywhere about it and the group policy does not appear to contain anything about enabling embedded mode... Help is greatly appreciated! Thanks in advance! It turns out that in addition to applying the policy, you also have to start the

Send eMail in Windows Universal App

空扰寡人 提交于 2019-12-04 07:31:14
Is it possible to send an email message in a Windows Universal App for Windows 8.1 and Windows Phone 8.1? await Launcher.LaunchUriAsync(new Uri("mailto:abc@abc.com?subject=MySubject&body=MyContent")); With this code line I can send an email, but I want to send a message with attachment. Since Microsoft missed to add EmailMessage and EmailManager to the Windows Store Apps libraries it seems as if there are only two unsatisfactory solutions: You could use sharing or initiate email sending via the mailto protocol. Here is how I did it: /// <summary> /// Initiates sending an e-mail over the

Error creating NuGet package for Portable Class Library

岁酱吖の 提交于 2019-12-04 07:19:26
I'm new to Nuget and I'm trying to create a NuGet package for a Portable Class Library project that has a package dependency on another portable class library I've created. I'm running into an issue where I'm receiving an error when calling nuget pack for the project file TestComponent2.csproj (I created this from the Portable for Universal Apps template in VS 2013). This library has a dependency on a nuget package created from another PCL called TestComponent1 . The package created never seems to contain this dependency (the console output even says "Dependencies: None"). However it is in the

Windows OCR engine fails to recognize the text in canvas (converted to bitmap)

人走茶凉 提交于 2019-12-04 06:08:52
问题 I have a cordova project where I have a "scribble pad" where the user can scribble their notes. This is a simple canvas object, and I'd like to get the OCR Engine to convert it into text. I'm struggling to convert the canvas data into the software bitmap that OCR Engine supports. All the samples are based either around loading a file from the storage or reading a stream from camera. Do I have to save this canvas into a file on a device and read it back in into a stream? I'd welcome the

How to collapse child control in listviewitem UWP

无人久伴 提交于 2019-12-04 04:58:19
问题 Universal Windows Platform, C# How can I collapse/expand the child listview of item MainListView listitem from code behind? I have not found anything that works. I'd like to do this on the SelectionChanged event. XAML <ListView x:Name="DestListView" SelectionMode="Single" Margin="0,60,0,0" SelectionChanged="listview_SelectionChanged" > <ListView.ItemContainerStyle > <Style TargetType="ListViewItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property=

Perform synchronous operation on Ui thread

白昼怎懂夜的黑 提交于 2019-12-04 04:44:07
问题 I am trying develop a Windows App and run into issues. I have a MainPage.xaml and 2 others StartScreen.xaml and Player.xaml. I am switching content of the MainPage if certain conditions are true. So I have an event in StartScreen it checks if a directory exist or not but it throws me every time an error. private void GoToPlayer_Click(object sender, RoutedEventArgs e) { if (Directory.Exists(this.main.workingDir + "/" + IDText.Text + "/Tracks")) // Error occurs here { this.main.Content = this