windows-runtime

Windows.Web.Http.HttpClient Timeout Option

拜拜、爱过 提交于 2019-12-19 19:50:02
问题 Due to SSL certificate issue we are using "Windows.Web.Http.HttpClient" API in my app service layer. I referred below sample for my project. http://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664 How can we implement the timeout option in "Windows.Web.Http.HttpClient" API 回答1: You can use a CancellationTokenSource with a timeout. HttpClient client = new HttpClient(); var cancellationTokenSource = new CancellationTokenSource(2000); //timeout try { var response = await client

How to set animations/transitions when adding elements to a ListViews?

一笑奈何 提交于 2019-12-19 19:28:07
问题 I have got a ListView wich I added Elements by binding. The ListView looks like: <ListView x:Name="ListView" Height="auto" Width="350" ItemsSource="{Binding}" Padding="0,0,-20,0" Grid.Row="1" Grid.Column="0" Background="#EFEFEF" ItemContainerStyle="{StaticResource ListViewStyle}"> <ListView.ItemTemplate> <DataTemplate> <StackPanel Height="50" VerticalAlignment="Top" Margin="0,0,0,0" <TextBlock Text="{Binding name} TextWrapping="NoWrap"/> </StackPanel> </DataTemplate> </ListView.ItemTemplate>

Windows Phone 8.1 check if password set else load new page

女生的网名这么多〃 提交于 2019-12-19 18:23:51
问题 I Have a very similar situation to this guys question in that I have a Login Page which is my MainPage.xaml file but I have another page called SetPassword.xaml that I want to load if a user has not set a password yet. Essentially this is the first time that the App loads after it has been installed. I've spent hours on SO trying various different solutions (including the one I linked to) but I'm just not getting anywhere and it seems that many of the solutions are either for WP7 or WP8 and

Load a Page into a ContentControl

风流意气都作罢 提交于 2019-12-19 11:38:30
问题 I have a ContentControl where I want to load the page myPage2 . My XAML Codefrom this page looks like this: <Page x:Class="ExampleApp.myPage2"> <Grid x:Name="Content" Height="651" Width="941" Background="White"> ... ... </Grid> </Page> I know that I can load a resource from a page with this Code: protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) { var contentControl = (ContentControl)container; return (DataTemplate) contentControl.Resources

How can I play multiple sounds at the same time using SharpDX in WinRT?

吃可爱长大的小学妹 提交于 2019-12-19 10:57:07
问题 I am trying to make a musical instrument type of application. The problem I am having is that a new sound will only play if the old one is finished. I would like to be able to play them simultaneously. This is how my code looks like: First, the MyWave class which simply holds an audio buffer and some other info: class MyWave { public AudioBuffer Buffer { get; set; } public uint[] DecodedPacketsInfo { get; set; } public WaveFormat WaveFormat { get; set; } } In the SoundPlayer class: private

WinRT C# - HttpRequestException: error 500

天大地大妈咪最大 提交于 2019-12-19 10:21:47
问题 I'm trying to port my WP8 application to a Windows Store App and I'm getting an HttpRequestException when performing the getStringAsync of the HttpClient. Here is the code snippet giving me the issue: HttpClient client = new HttpClient(); Stream stream = await client.GetStreamAsync(new Uri("http://www.psnapi.com.ar/ps3/api/psn.asmx/getPSNID?sPSNID=philippemexes", UriKind.Absolute)); and here is the complete exception message: HttpRequestException: Response status code does not indicate

How to get camera feeds in Windows 8 Metro style app?

折月煮酒 提交于 2019-12-19 10:21:04
问题 I am trying to get camera feeds in Windows 8 metro style app so that i can make some changes on it something like augmented reality. I have tried but only able to find how to capture images using CameraCaptureUI(). Can anyone tell me how can i achieve camera feeds for AR? 回答1: All you need to do is pass in CameraCaptureUIMode.Video for CaptureFileAsync. Here is a sample CameraCaptureUI dialog = new CameraCaptureUI(); dialog.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4; StorageFile

Can I convert image/bitmap to writeablebitmap?

二次信任 提交于 2019-12-19 10:18:31
问题 I have two bitmap images that i would like to merge together. I found that I can do that with writeablebitmap but how do I first convert these images to writeablebitmaps? UPDATE: I could not find out a way to convert bitmaps to writeable bitmap directly so what I did was to write my bitmap in isolated storage and read it again in a stream object. After which the code given below by Xyroid can be used to merge the images and convert the merged image to bitmap. 回答1: Here I am giving you the

Behaviors are not working properly inside Style Setter

ε祈祈猫儿з 提交于 2019-12-19 09:48:30
问题 In my Windows-Runtime app, I have a theme with a style that has a Behavior defined for the DoubleTapped action: These are the XML Namespaces: xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:core="using:Microsoft.Xaml.Interactions.Core" And this is the style: <Style x:Name="DisplayImage" TargetType="ScrollViewer"> <Setter Property="VerticalScrollBarVisibility" Value="Hidden" /> <Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="ZoomMode" Value="Disabled" /> <Setter

UWP - binding Enum differences

只愿长相守 提交于 2019-12-19 09:24:00
问题 I have come across a very interesting issue. Suppose you have the following XAML page content in a UWP app: <ContentControl Content="{x:Bind ApplicationDataLocalityEnum}" /> <ContentControl Content="{x:Bind FontStyleEnum}" /> And in the code-behind of the page contains the following properties: public ApplicationDataLocality ApplicationDataLocalityEnum { get; } = ApplicationDataLocality.Local; public FontStyle FontStyleEnum { get; } = FontStyle.Normal; Expected result would be, that the app