windows-runtime

Exception when trying to read null string in C# WinRT component from WinJS

核能气质少年 提交于 2019-12-29 06:45:14
问题 I have the following scenario: Data lib in C# compiled as a Windows Runtime component. One of its classes is looks like this: public sealed class MyData { string TheGoods { get; private set;} } The UI is in WinJS, and I have the following: var b = dataInstance.theGoods; The problem is that I get an exception and property has the following in it: System.ArgumentNullException at System.StubHelpers.HStringMarshaler.ConvertToNative(String managed) Looking at the implementation of HStringMarshaler

Async and Await with HttpWebRequest.GetResponseAsync

只谈情不闲聊 提交于 2019-12-29 06:40:23
问题 I am trying to use Async and Await when making a web request and am finding that it never gets past the await line. I am doing this from a Metro app, but I also verified the problem in a winforms app. public async Task<string> DoSomething() { string url = "http://imgur.com/gallery/VcBfl.json"; HttpWebRequest request = HttpWebRequest.CreateHttp(url); var ws = await request.GetResponseAsync(); return ws.ResponseUri.ToString(); ; } If I don't use await and instead perform a synchronous wait, it

Async and Await with HttpWebRequest.GetResponseAsync

删除回忆录丶 提交于 2019-12-29 06:40:11
问题 I am trying to use Async and Await when making a web request and am finding that it never gets past the await line. I am doing this from a Metro app, but I also verified the problem in a winforms app. public async Task<string> DoSomething() { string url = "http://imgur.com/gallery/VcBfl.json"; HttpWebRequest request = HttpWebRequest.CreateHttp(url); var ws = await request.GetResponseAsync(); return ws.ResponseUri.ToString(); ; } If I don't use await and instead perform a synchronous wait, it

How to apply image effects like edge detection oncamera stream in Windows 8 app?

為{幸葍}努か 提交于 2019-12-29 06:30:11
问题 I am trying to apply image manipulation effects in Windows 8 app on camera feeds directly. I have tried a way using canvas and redrawing images after applying effects getting from webcam directly. But this approach works fine for basic effects but for effects like edge detection its creating large lag and flickering while using canvas approach. Other way is to create MFT(media foundation transform) but it can be implemented in C about which i have no idea. Can anyone tell me how can i achieve

Listview selection display with no padding and no checkmark

假如想象 提交于 2019-12-28 13:38:44
问题 I have this XAML to display a ListView in a C++/CX code. The ListView will be used as a selection menu. <ListView x:Name="itemsListView" ItemsSource="{Binding Source={StaticResource MenuDataSourceCVS}}" HorizontalAlignment="Stretch" Width="230" Margin="0,45,0,0" VerticalAlignment="Top" Grid.Row="1" SelectionChanged="itemsListView_SelectionChanged" SelectionMode="Single" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" FontFamily="Global User Interface"> <ListView

Unhandled exception handler not called for Metro / WinRT UI async void event handler

巧了我就是萌 提交于 2019-12-28 13:22:48
问题 Consider the following to be extracts from a Windows 8 Metro / WinRT app, which have been reduced to the bare minimum required to show the anomaly: public class App : Application { public App() { UnhandledException += (sender, e) => e.Handled = true; } } public class MainPage : Page { private void Button_Click_1(object sender, RoutedEventArgs e) { throw new NotSupportedException(); } private async void Button_Click_2(object sender, RoutedEventArgs e) { throw new NotSupportedException(); } }

Unhandled exception handler not called for Metro / WinRT UI async void event handler

主宰稳场 提交于 2019-12-28 13:22:15
问题 Consider the following to be extracts from a Windows 8 Metro / WinRT app, which have been reduced to the bare minimum required to show the anomaly: public class App : Application { public App() { UnhandledException += (sender, e) => e.Handled = true; } } public class MainPage : Page { private void Button_Click_1(object sender, RoutedEventArgs e) { throw new NotSupportedException(); } private async void Button_Click_2(object sender, RoutedEventArgs e) { throw new NotSupportedException(); } }

Change cursor in Windows Store Apps

感情迁移 提交于 2019-12-28 06:28:26
问题 I'm making a Windows Store app in C# and I have a normal TextBlock with a link inside it. And all I want to do it to make the cursor change into a hand when it goes over the text block, but unlike in WPF applications, there is no Cursor propriety. I know is a CoreCursor class in Windows.UI.Core . Am I suppose to use it somehow? 回答1: Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Hand, 1); 回答2: WinRT XAML Toolkit has an attached property

Could not load file or assembly Windows.winmd'

浪尽此生 提交于 2019-12-28 05:33:31
问题 My WPF Desktop app is using WinRT classes as well. In order to do that I follow this tutorial https://software.intel.com/en-us/articles/using-winrt-apis-from-desktop-applications. Fine, it works. Now when I try to generate the msi file (I tried both with using Microsoft Installer and ClickOnce), I am getting this error: Problem generating manifest. Could not load file or assembly 'C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Windows.winmd' or one of its

GridView with 2 columns, fill width

不想你离开。 提交于 2019-12-28 02:56:26
问题 The result I want to achieve is pretty simple, a list with 2 columns, both with equal width. In Windows Phone 7/8 this could easily be achieved using a ListBox with a WrapPanel as ItemsPanel and setting the ItemWidth to 240 (as the screen width was 480). Now I'm Writing a Universal App, but here the problem is that the screen is not guaranted to have a width of 480 (not even for the Phone it seems) so I can't set the ItemWidth as I want it to fill the width of the screen. I have been able to