windows-phone-8

How to set a default source for an Image if binding source is null?

孤街醉人 提交于 2020-01-01 01:56:06
问题 I'm using binding for source of an Image control. <Image Source="{Binding ImageUri}"/> But this ImageUri can be null, therefor I want to use a default image, a place holder, for that, which can be in /Assets/PlaceHolder.png for example. How can I set a default image? thanks. (It's a WP8 app, but should not be different of WPF) 回答1: You can achieve it by setting TargetNullValue <Image> <Image.Source> <Binding Path="ImageUri" > <Binding.TargetNullValue> <ImageSource>/Assets/PlaceHolder.png<

StorageFile 50 times slower than IsolatedStorageFile

耗尽温柔 提交于 2019-12-31 08:13:57
问题 I was just benchmarking multiple algorithms to find the fastest way to load all data in my app when I discovered that the WP7 version of my app running on my Lumia 920 loads the data 2 times as fast as the WP8 version running on the same device. I than wrote the following independent code to test performance of the StorageFile from WP8 and the IsolatedStorageFile from WP7. To clarify the title, here my preliminary benchmark results I did, reading 50 files of 20kb and 100kb: For the code, see

StorageFile 50 times slower than IsolatedStorageFile

…衆ロ難τιáo~ 提交于 2019-12-31 08:13:08
问题 I was just benchmarking multiple algorithms to find the fastest way to load all data in my app when I discovered that the WP7 version of my app running on my Lumia 920 loads the data 2 times as fast as the WP8 version running on the same device. I than wrote the following independent code to test performance of the StorageFile from WP8 and the IsolatedStorageFile from WP7. To clarify the title, here my preliminary benchmark results I did, reading 50 files of 20kb and 100kb: For the code, see

How to determine the keyboard offset

霸气de小男生 提交于 2019-12-31 07:52:05
问题 I had this issue yesterday and it seems a lot of people have had similar issues in the past, so I figured I would pose my question & the solution I ended up coming up with. Microsoft has cleaner solutions to this in the 8.1 SDK, but the vast majority of WP app users are on 8.0 and below, so I imagine this will still be helpful. When you open the virtual keyboard in a Windows Phone 7/8 Silverlight app, and the text box that caused the keyboard to open is on the lower half of the screen (that

How to determine the keyboard offset

♀尐吖头ヾ 提交于 2019-12-31 07:51:58
问题 I had this issue yesterday and it seems a lot of people have had similar issues in the past, so I figured I would pose my question & the solution I ended up coming up with. Microsoft has cleaner solutions to this in the 8.1 SDK, but the vast majority of WP app users are on 8.0 and below, so I imagine this will still be helpful. When you open the virtual keyboard in a Windows Phone 7/8 Silverlight app, and the text box that caused the keyboard to open is on the lower half of the screen (that

Random numbers for Windows Phone 8 and Windows Store 8?

时光怂恿深爱的人放手 提交于 2019-12-31 07:04:21
问题 I'm struggling with a port of a couple of security libraries to the Windows Phone 8 and Windows Store 8 platform. I need a function which provides random numbers. Win32 has CryptGenRandom and even RtlGenRandom . Windows Store 10 and Universal Windows has BCryptGenRandom . However, there's a hole for Windows Phone 8 and Windows Store 8 because CryptoAPI is not available, and CNG is only available on Windows 10 and Universal Windows. The MSDN docs say BCryptGenRandom is available for "Windows

Random numbers for Windows Phone 8 and Windows Store 8?

☆樱花仙子☆ 提交于 2019-12-31 07:04:20
问题 I'm struggling with a port of a couple of security libraries to the Windows Phone 8 and Windows Store 8 platform. I need a function which provides random numbers. Win32 has CryptGenRandom and even RtlGenRandom . Windows Store 10 and Universal Windows has BCryptGenRandom . However, there's a hole for Windows Phone 8 and Windows Store 8 because CryptoAPI is not available, and CNG is only available on Windows 10 and Universal Windows. The MSDN docs say BCryptGenRandom is available for "Windows

Microsoft pubCenter ads not showing in my WP8 app

泪湿孤枕 提交于 2019-12-31 04:50:11
问题 I can't get Microsoft pubCenter ads to work in my Windows Phone 8 App. When I run my app I only see white space instead of the ad Changing to test values doesn't seem to show an ad neither Can you help me? Thanks in advance That's what I see in my pubCenter account That's my XAML and my app's references 回答1: Try this It Should Work fine Xaml: xmlns:UI="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" <UI:AdControl ApplicationId="test_client" AdUnitId=

access user's microsoft account email id from my app in windows phone 8

不问归期 提交于 2019-12-31 04:15:21
问题 I'm looking to access an email id of user that is used for marketplace in wp8. Email address chooser task is only to obtain the email address of a contact, not from user's mail id set in mail account of phone 回答1: Due to privacy concerns it is not possible to retrieve the account ID. If you just want to identify the user you can use UserExtendedProperties.GetValue("ANID2") (more information on the WP8 version here) 回答2: Also ANID2 is bounded to the the Windows Live Account Id , and the

What is the Height of the Minimized Application Bar in Windows Phone

喜夏-厌秋 提交于 2019-12-31 03:05:10
问题 I'm curious of how it would be possible to get the height of the Windows Phone application bar when in 'mini' mode. I've seen several resources on the height when the regular icon buttons are shown, but none with only the ellipses. 回答1: In codebehind: double appBarMiniSize = ApplicationBar.MiniSize; // 30.0 回答2: I'll help you solve this yourself. Create a test app and modify the mainpage to have the following xaml <phone:PhoneApplicationPage x:Class="WinPhone8App.MainPage" xmlns="http:/