winrt-xaml

Windows Runtime: How to set image in a ellipse shape button?

徘徊边缘 提交于 2019-12-31 04:27:07
问题 <Button x:Name="btnProfilePicture" HorizontalAlignment="Center" Click="btnProfilePicture_Click"> <Button.Template> <ControlTemplate> <Ellipse x:Name="ellipsePicture" Fill="Turquoise" Width="150" Height="150" Stroke="White" StrokeThickness="10"> </Ellipse> </ControlTemplate> </Button.Template> </Button > I have a button in ellipse shape, with color fill by default. I want to change the fill to an image in code-behind in runtime. How can I do this? More info: I tried to set the ellipse fill by

Universal App Windows Phone Orientation

不羁的心 提交于 2019-12-31 04:20:28
问题 Recently I was developing a Universal app for both the Windows Phone and Windows Store. In that app, I was trying to fix the Orientation of the App to Landscape. But in WinRT based apps of Windows Phone 8.1, I failed to find any Orientation option. In the Silverlight apps, we can fix the Orientations as we want. But is there any way to fix the Orientation to Landscape mode in the Universal Apps? It will be very helpful if someone help me in this regard. Thanks in advance. :) 回答1: Under WinRT

Sending an email in metro application?

泪湿孤枕 提交于 2019-12-31 03:52:47
问题 I want to send an email with some content as a body in my metro app :- 1)since system.net.mail is not supported in metro application i have decided to use this :- using Windows.System; //starts the default mail app with a subject, cc, bcc, and body Launcher.LaunchUriAsync(new Uri("mailto:windows8devs@almostbeta.com?subject=Code Request&cc=kevin@almostbeta.com&bcc=admin@almostbeta.com&body=Hi!")); but my doubt is that i want to generate a content as a body to this email , but this content is

Toast notification isn't working?

谁说我不能喝 提交于 2019-12-31 01:49:01
问题 I'm following several examples to do a toast notification when I click a button in my app. I stepped through the following example: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868254.aspx I'm not getting any errors but when I run the application I don't get the toast notification. I have created a snippet here: http://codepaste.net/btkzeg ToastTemplateType toastTemplate = ToastTemplateType.ToastImageAndText01; XmlDocument toastXml = ToastNotificationManager.GetTemplateContent

How to improve performance method GetThumbnailAsync in window phone 8.1

放肆的年华 提交于 2019-12-30 11:47:05
问题 I write a function to show images on a folder (assume i have about 60 images in this folder) in window phone 8.1. And the problem is function GetThumbnailAsync() take so long time when i create stream to get bitmapImage. Here's my code //getFileInPicture is function get all file in picture folder List<StorageFile> lstPicture = await getFileInPicture(); foreach (var file in lstPicture) { var thumbnail = await file.GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.PicturesView,50);

Center aligning GridView items in last row

我是研究僧i 提交于 2019-12-30 11:31:33
问题 I want to implement a GridView which takes 3 items in a row, and if the number of items are 2 in last row, then the last row items should be aligned center instead of being left-aligned. Here are a couple of images to explain what I want to achieve. Currently my implementation looks like . And this is what I want to achieve. Any help would be appreciated. 回答1: There are many ways realizing the feature that you mentioned. To summarize it, you need to inherit GridView and override

Windows 8 WrapPanel

不羁岁月 提交于 2019-12-30 08:17:24
问题 I've got problem with automatically breaking StackPanel into next line. Here's the sample code: <StackPanel Orientation="Horizontal" Width="180"> <TextBlock.../> <TextBlock.../> <TextBlock.../> <Image.../> ... </StackPanel> Now I want to achive something like this: when there is not enough space for another element in the StackPanel it should be placed in new line. How I can achive this (it's not necessary to use stackpanel)? PS: My goal is to place text and images in one line (it can of

how to hide on EditText soft keyboard windows 8 Metro Application?

狂风中的少年 提交于 2019-12-30 07:39:29
问题 I'm having an EditText and a Button in my Frame using C#. After writing inside the edit field and clicking on the Button, I want to hide the virtual soft keyboard. 回答1: You cannot. There is more information on the behavior of the Input Hosting Manager and Soft Keyboard and you can register to know when it shows or becomes hidden. But, you cannot programmatically control whether it's up or down. 回答2: Add a dummy button and set focus to it and the keyboard will be hidden. 回答3: Thanks for your

Capture screen of Windows store App

拟墨画扇 提交于 2019-12-30 06:32:12
问题 Is it possible to capture the contents of running Windows store app? I need to capture the entire screen or a user defined rectangular area. The application will provide share option When the application is running and share option is selected, I want to get the screen shot periodically say 4 times in a second This screen shot image will be posted to server, which will store the same 回答1: You can't capture screen programatically. See the below threads from MSDN. Programmatically take snap

SOS Debugging Extensions for Microsoft.NET.CoreRuntime

风格不统一 提交于 2019-12-30 05:23:28
问题 While trying to track down a fatal null pointer language exceptions (c000027b) in a UWP C#/XAML store project with WinDbg, I cannot get to the CLR Exception object because of a missing SOS debugging extention for Microsoft.NET.CoreRuntime. I was unable to locate a matching sos.dll. What am I missing? Note: The app crash is reproducible, but only happens when not debugging. So running the project under the Visual Studio debugger is unfortunately not a solutions in this case. [...] 0:009> dt