windows-phone-7

Windows Phone 8: How to show messagebox right before exiting the App if pressed Back key?

China☆狼群 提交于 2020-01-25 06:57:05
问题 I have an app that needs to get user's attention when user exit the app at least once. So I get the code below to show a messagebox. What I don't know is how do I really exit the app if user has read the message? Because it seems the back key event will always come to the call I setup (OnBackKeyPress) Or what is a good way to handle showing a messagebox without messing around overriding BackKey? Because if have another pop up on screen and user pressed back key, it seems I got some exception

How can I get a list of all embedded resources defined in my application?

余生长醉 提交于 2020-01-25 06:55:26
问题 How to get a list of all files (e.g. images) embedded as resources or content programmatically? I tried ResourceDictionary res = Application.Current.Resources; But this does not return any files. 回答1: If the resources have build action Content then there is no way to enumerate them. You can only access them directly by name (so you would already have to know the names). For resources with build action Resource or Embedded Resource you can use Ivan's solution. The discussion to this similar

Editing Contacts info in WP7

我的未来我决定 提交于 2020-01-25 06:39:35
问题 Recently in my Country (Egypt) They decided to edit the phone numbers prefix to add an extra number to each cell phone prefix (ex. 011->0111 ) I want to make an application that will handle that editing programmatically for me I know I can retrieve contacts info one by one and I can save new info to a certain contact through the phone tasks (phone number chooser task and phone number save task)... till now my best shot is to make the user choose contacts one by one and for each one I add an

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

How to open TimeSpanPicker on a Button (Coding4Fun toolkit)

廉价感情. 提交于 2020-01-24 23:57:31
问题 I have button and TimeSpanPicker in XAML. <Image x:Name="sleepButton" Source="img/Sleep.png" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Stretch="None" Tap="sleepButton_Tap"/> <controls:TimeSpanPicker x:Name="timespanPicker" Step="0:5" Value="0:0" PickerPageUri="timePickerPage" Grid.Column="1" Grid.Row="2" Visibility="Collapsed" IsEnabled="False" /> And here is my code. private void sleepButton_Tap(object sender, GestureEventArgs e) { TimeSpanPicker timespanPicker = new TimeSpanPicker();

Can I expand downloading images to several threads?

人盡茶涼 提交于 2020-01-24 13:22:56
问题 I had a problem with ListBox , which doesn't work fine with my collection (nested listboxes, non static size, etc). I tried DeferredLoadListBox, but it requires static height(not my variant). So, I tried ItemsControl with ScrollViewer , and it works realy good! I have smooth scrolling, no lags, its exactly what i needed. But! As I understand, ListBox download content dynamically, only when it need this content, and ItemsControl loads all the content in one time. And its a problem, because I

Can I expand downloading images to several threads?

那年仲夏 提交于 2020-01-24 13:22:16
问题 I had a problem with ListBox , which doesn't work fine with my collection (nested listboxes, non static size, etc). I tried DeferredLoadListBox, but it requires static height(not my variant). So, I tried ItemsControl with ScrollViewer , and it works realy good! I have smooth scrolling, no lags, its exactly what i needed. But! As I understand, ListBox download content dynamically, only when it need this content, and ItemsControl loads all the content in one time. And its a problem, because I

Get music tempo or BPM?

雨燕双飞 提交于 2020-01-24 07:50:26
问题 I'm currently building a game in windows phone 7 using xna i'm trying to get beat per minute from song that played in background song, i also not quite sure if what i want is BPM, what i want is something like pace or tempo in music, faster the pace ,faster the sprites is moving. What i'm thinking right now, BPM is how much a frequency from music hits a range of defined constant, e.g 20 Mhz - 30 MHz, Feel free to correct me if i'm wrong, i'm not really familiar with audio thing, i have tried

Where is the composition root in a Windows Phone app?

↘锁芯ラ 提交于 2020-01-24 07:45:45
问题 I'm new to WP 7. For purposes of dependency injection, I want to adhere to practices acquired doing WinForms apps. I therefore want to build my app graph at the composition root. What part of a regular WP 7 app source code can be viewed as the composition root? 回答1: The pattern I prefer, as recommended by the Patterns & Practices team, is: Add a ViewModelLocator class to your resources App.xaml with an x:Key="ViewModelLocator" , and add to that class a property for each ViewModel type and

Windows phone 7 native code support

百般思念 提交于 2020-01-24 02:15:05
问题 2 questions: Can someone tell me if unmanaged c++ code will be supported in future versions of Phone 7 OS for all developers? What are MS reasons for not supporting unmanaged c++ code? 回答1: This answer is purely speculative, but I feel that most others who have answered this question miss the point by a long shot. Let's for a moment assume that this is not a vindictive decision by Microsoft, but instead actually a very well thought out engineering decision that has absolutely nothing to do