windows-runtime

Query Local IP Address

匆匆过客 提交于 2019-12-17 17:34:56
问题 I have the need to know my actual local IP address (i.e. not the loopback address) from a Windows 8 WinRT/Metro app. There are several reasons I need this. The simplest is that in the UI of the app I'd like to show some text like "Your local network IP address is: [IP queried from code]". We also use the address for some additional network comms. Those comms are perfectly valid because it all works if I look at the IP address in the Control Panel, then hard-code it into the app. Asking the

When to use a templated control over a UserControl?

故事扮演 提交于 2019-12-17 17:34:42
问题 I was looking some tutorials on how to create custom controls in WinRT, and I have a question. Let's say I want to create a simple control that contains some stuff, like a Grid with an image on the left and a couple of TextBlocks on the right. I mean, something simple like: <Grid Height="100"> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.3*"/> <ColumnDefinition Width="0.7*"/> </Grid.ColumnDefinitions> <Image Source"/Assets/someRandomImage.png"/> <StackPanel Grid.Column="1"

How to disable Suspending || Closing || Terminating event for my Metro Style App on Windows 8 Pro

雨燕双飞 提交于 2019-12-17 17:11:50
问题 I'm a french developer and I need to develop an Metro Style app for Windows 8 Pro who is always launched. I wanted to know how can I disable the close event of my app. My app need to be in front all the time and the user couldn't quit the app. I thought I could disable all the shortcut with the GPO but the close gesture (drag the app from the top to the bottom) need to me disabled too. I hope I was clear and everybody will understand the question :-). Feel free to ask me more specific

What's the equivalent of the System.Diagnostic.Process on WinRT (C#)?

点点圈 提交于 2019-12-17 17:04:07
问题 I need to launch a couple of commands from my WinRT application, like if it were a Command Console, in order to do this, on not WinRT apps the class to be used is System.Diagnostic.Process but on Win RT his class is not available, is there any equivalent class or method that i could use? Thanks in advance :) 回答1: You cannot do that from a Windows Store application - those are sandboxed and do not have access to other processes. More details here. 回答2: Windows Store Apps cannot launch other

Am I right to ignore the compiler warning for lacking await for this async call?

依然范特西╮ 提交于 2019-12-17 16:42:15
问题 I have the following method that is triggered when an exception occurs in a part of my Metro application void Model_ExceptionOccured(Exception ex) { var dlg = new Windows.UI.Popups.MessageDialog("An exception occured during verification: " + ex.Message, "Exception"); dlg.ShowAsync(); } The 'dlg.ShowAsync()'-call is asynchronous, but I don't care to wait for the result. The compiler generates a warning for it though: Because this call is not awaited, execution of the current method continues

Get OS-Version in WinRT Metro App C#

安稳与你 提交于 2019-12-17 16:35:13
问题 I'm programming a Metro Style App with C# and the Visual Studio 11 Beta. Now I want to get the OS-Version of the OS. How can I get this? I found out how to do it in "normal" Applications. There you take the Environment-Class with the attribute OSVersion but in .NET Core there isn't this attribute 回答1: For new applications you should check for specific features, not OS version. As far as I can tell there is no reason to check for OS version as metro applications are only available for win 8.

Load UWP library into .NET Framework app

瘦欲@ 提交于 2019-12-17 16:29:32
问题 There are a number of articles(codeproject, blog1, blog2, forum) to use WinRT library into .Net Framework console application in Windows 8. I tried it with UWP in Windows 10. But failed to make it. I struggled to compile without error, but it occurred BadImageFormatException in runtime. This is what I did. Create Console application with .NET Framework 4.6.1 target. Edit .csproj file to add <TargetPlatformVersion>10.0</TargetPlatformVersion> Reference three libraries as below. c:\Program

Overriding Pivot header foreground brushes in UWP app (Win 10 RTM SDK)

随声附和 提交于 2019-12-17 16:26:13
问题 I'm trying to override the Pivot header foreground theme brushes, but no matter what I do the UWP app just ignores it. Just to be clear, this question is about the UWP Pivot control, not the Win (Phone) 8.1 one. I've used the theme brush override method in a 8.1 app and it worked perfectly. But I can't seem to be able to do the same for a UWP Pivot. I looked for the respective brushes in generic.xaml (and in the Properties pane under Brushes -> System Brush Resources), which are

Is there a possibility to start another App or Program from a Windows 8 Store App (C#)

旧城冷巷雨未停 提交于 2019-12-17 14:56:18
问题 I want to start another App or Program from my Windows Store App. For example my App is showing emails, so if someone clicks on such an email Outlook should open. Is this possible in an "App-Sandbox"? 回答1: It is not possible to just launch an arbitrary application, but with custom protocol activation you can launch an app that handles that protocol and if it is not installed - the OS will ask the user to install it. It means that if you can define a custom protocol in your app - you can

Captured photo with stripes

杀马特。学长 韩版系。学妹 提交于 2019-12-17 13:22:38
问题 I'm using MediaCapture class to take a photo with Windows Phone 8.1 Runtime. The code, where I take a picture looks like this: // create a file StorageFile photoFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("myFirstPhoto.jpg", CreationCollisionOption.ReplaceExisting); // take a photo with choosen Encoding await captureManager.CapturePhotoToStorageFileAsync(ImageEncodingProperties.CreateJpeg(), photoFile); The code is working quite fine, as I get a picture, but with strange