windows-phone

Windows Phone - Marquee With Template

一个人想着一个人 提交于 2020-01-25 02:22:27
问题 In windows phone i could easily marquee a textblock. But is there any solution to marquee list of items for which i can define template and bind it to a list of items. Thanks Gokoulane Ravi 回答1: Although it's not a WP style... Add storyboard to page resources: <phone:PhoneApplicationPage.Resources> <Storyboard x:Name="Scroll" RepeatBehavior="Forever"> <DoubleAnimation From="480" To="-480" Storyboard.TargetName="translate" Storyboard.TargetProperty="X" Duration="0:0:5" /> </Storyboard> </phone

Code in Application_Activated not running when phone wakes up

余生颓废 提交于 2020-01-23 17:29:08
问题 I've done some reseach on the life cycle of Windows Phone apps and I've gathered that when the phone is locked whilst an app is still running, and you unlock the phone the 'Application_Activated' function is called in the App.xaml.cs file. // Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { //Code to run MessageBox.Show("Hello

Allowing only letters for input

三世轮回 提交于 2020-01-23 16:08:22
问题 How to filter non-letter keys from the virtual keyboard? The following method works just for latin alphabet, for unfortune: public static bool IsLetter(int val) { return InRange(val, 65, 90) || InRange(val, 97, 122) || InRange(val, 192, 687) || InRange(val, 900, 1159) || InRange(val, 1162, 1315) || InRange(val, 1329, 1366) || InRange(val, 1377, 1415) || InRange(val, 1425, 1610); } public static bool InRange(int value, int min, int max) { return (value <= max) & (value >= min); } 回答1: I think

Allowing only letters for input

十年热恋 提交于 2020-01-23 16:06:51
问题 How to filter non-letter keys from the virtual keyboard? The following method works just for latin alphabet, for unfortune: public static bool IsLetter(int val) { return InRange(val, 65, 90) || InRange(val, 97, 122) || InRange(val, 192, 687) || InRange(val, 900, 1159) || InRange(val, 1162, 1315) || InRange(val, 1329, 1366) || InRange(val, 1377, 1415) || InRange(val, 1425, 1610); } public static bool InRange(int value, int min, int max) { return (value <= max) & (value >= min); } 回答1: I think

How to draw an arc in universal windows app

和自甴很熟 提交于 2020-01-23 02:57:04
问题 I need an arc (circle segment) in my universal windows application, but i just cant figure it out how to make it. There are only circle and rectangle shapes available. My goal is to create an arc that is showing the given percent, line 50% 66% etc. 回答1: If you want something like this: Check my solution (tested on Windows 8.1 and Windows 10 UWP): https://github.com/arek-kubiak/ArcControl/tree/master I hope it will be helpful for you :) Be careful, control automatically adjusts the height and

Creating new Windows Phone App project: “Object reference not set to an instance of an object” error (WP8 SDK, VS2012)

こ雲淡風輕ζ 提交于 2020-01-22 16:55:11
问题 I have VS2012 Pro Update 3. I've downloaded and installed Windows Phone 8 SDK to create Windows Phone apps for the latest MS smartphone OS (WP8). However, I get the above-mentioned error when I try to create a new Windows Phone App project. I deinstalled and reinstalled WP8 SDK as suggested on many forums and blogs, and even used the "repair installation" mode for VS2012 and WP8 SDK, but all this did not help. How to get rid of this error? P.S. My pc has Windows 8 Pro 64-bit and the CPU

Creating new Windows Phone App project: “Object reference not set to an instance of an object” error (WP8 SDK, VS2012)

喜欢而已 提交于 2020-01-22 16:53:05
问题 I have VS2012 Pro Update 3. I've downloaded and installed Windows Phone 8 SDK to create Windows Phone apps for the latest MS smartphone OS (WP8). However, I get the above-mentioned error when I try to create a new Windows Phone App project. I deinstalled and reinstalled WP8 SDK as suggested on many forums and blogs, and even used the "repair installation" mode for VS2012 and WP8 SDK, but all this did not help. How to get rid of this error? P.S. My pc has Windows 8 Pro 64-bit and the CPU

How to prevent lockscreen in a Windows (Phone) 8.1 Universal App?

假如想象 提交于 2020-01-22 14:20:09
问题 Do anyone know, how to prevent the lockscreen in a Windows (Phone) 8.1 Universal App? In Windows Phone 8, I have used: PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; Has anyone an idea? 回答1: You may have a look at this question at MSDN, which points to this answer on SO. In short while using WinRT you can use DisplayRequest class: Apps that show video or run for extended periods without user input can request that the display remain on by calling

Separator Between Items in LongListSelector on WP

[亡魂溺海] 提交于 2020-01-21 23:23:07
问题 I Have a LongListSelector which is bonded to a contact list , i would like to add a little line to separate each contacts . Here is my xaml : <phone:LongListSelector> <phone:LongListSelector.ItemTemplate> <DataTemplate> <StackPanel Orientation = "Horizontal" > <TextBlock Text="{Binding informations}" Height="120" /> <Image Source="{Binding photo}" Height="90" Width="90" /> <Line Fill="Red" Height="2" /> </StackPanel> </DataTemplate> </phone:LongListSelector.ItemTemplate> </phone

WP7 ScrollViewer Bug When Content Height > 2000px

纵然是瞬间 提交于 2020-01-21 08:57:45
问题 In my project, I use ScrollViewer to show some long height infomation. I use like this: <Grid Grid.Row="1" Height="630"> <ScrollViewer Background="Red" Grid.Row="1"> <Grid> <Rectangle Height="3000" Fill="LightBlue" Width="440"/> </Grid> </ScrollViewer> </Grid> But,unfortunately, the rectagnle don't show completely when scrollView bar's vertical height > 2000. I have tested without Grid as ScrollViewer's content, only with Rectangle, the result is the same. And the bug is also happens with