windows-phone-8

Grouped LongListSelector: headers appear, items don't

半腔热情 提交于 2019-12-23 20:22:02
问题 WinPhone 8 project in C#. I'm trying to populate a grouped list. The group headers appear, the items don't. The relevant code is: class MyPage { public class Group : IGrouping<string, string> { public string Title{get;set;} public string[] Items; public string Key { get { return Title; } } public IEnumerator<string> GetEnumerator() { return (Items as IEnumerable<string>).GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return Items

Horizontally Stretch Content in an ItemsControl

流过昼夜 提交于 2019-12-23 20:18:08
问题 I have a itemscontrol, but, the items are being aligned to the left and I can't figure out how to Stretch them Horizontally. Here is my XAML: <ItemsControl x:Name="ItemsSnaps" ItemsSource="{Binding}" HorizontalContentAlignment="Stretch"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> </StackPanel> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Button x

Windows Phone 8 - Center PanoramaItem.Header

岁酱吖の 提交于 2019-12-23 20:16:02
问题 I'm developing a Panorama App for Windows Phone 8 and I got a small problem. I added an image to the header of one of my Panorama.Item (and it shows up fine) but I'd love it to be centered and not aligned left. I don't even know if it's possible or if you can't change the alignment at all. Here's the code for the header I'm talking about: <phone:PanoramaItem.Header> <Image x:Name="Logo" Height="100" HorizontalAlignment="Center" Tap="Logo_Tap" /> </phone:PanoramaItem.Header> The

How to specify a callback method for IAsyncOperation

核能气质少年 提交于 2019-12-23 20:07:04
问题 Is it possible to specify a method to be called after finishing an async operation? Platform : C++, Windows Phone 8 I need to implement non-blocking method for sending UDP packets asynchronously. And them have my method: onWriteComplete(int errorCode) called back when the operation completes. Here's what I've tried: res = await asyncWrite(); onWriteComplete( res ); But no luck. 回答1: Asynchronous operations work in similar ways across all languages in Windows Phone 8 and Windows RT

Error: GenerateWinPRTManifest

帅比萌擦擦* 提交于 2019-12-23 20:04:30
问题 I've tried to create a new monogame windows phone 8 project, when I tried to run it I got this error: Error 1 The "GenerateWinPRTManifest" task failed unexpectedly. System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at Microsoft.Silverlight

HttpClient uploading MultipartFormData to play 2 framework

我与影子孤独终老i 提交于 2019-12-23 20:03:28
问题 I have the following code in a Windows Phone 8 project that uses RestSharp client: public async Task<string> DoMultiPartPostRequest(String ext, JSonWriter jsonObject, ObservableCollection<Attachment> attachments) { var client = new RestClient(DefaultUri); // client.Authenticator = new HttpBasicAuthenticator(username, password); var request = new RestRequest(ext, Method.POST); request.RequestFormat = DataFormat.Json; request.AddParameter("json", jsonObject.ToString(), ParameterType.GetOrPost);

How can i change the background color of a stackpanel programmatically in windows phone app?

。_饼干妹妹 提交于 2019-12-23 19:13:46
问题 I just want set the background property of StackPanel , currently i setting it by the following code, statusPanel.Background = new SolidColorBrush(Colors.Cyan); But i just want to set a hexadecimal value. How can i do it?? 回答1: statusPanel.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0, 0)); If this answered your question, Please check right on left side. 回答2: Use this function: public SolidColorBrush GetColorFromHexa(string hexaColor) { byte R = Convert.ToByte(hexaColor

-ms-viewport causing div not scrolling

匆匆过客 提交于 2019-12-23 18:12:30
问题 I seem to have encountered a very strange bug; I am doing an app for Windows Phone 8 with PhoneGap. The problem I am having is that that I have scrollable div which works when I use: <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, height=480, width=320, target-densitydpi=device-dpi" /> (I tried using height=device-height , width=device-width , all worked) However, when I remove the viewport meta tag and use this instead: @-ms-viewport {

How to change the font in windows phone 8?

こ雲淡風輕ζ 提交于 2019-12-23 17:16:51
问题 I use the " Lucida Handwriting " for one textblock control at design time. But i run it on emulator it is take someone font like At Design Time At Run on Emulator How is Possible. How can i solve this difference. Please Help Me. Thanks in advance. 回答1: Are you including the font file in your app package? 1) Add the font file that you wish to use to your project, and set the Build Action to Embedded Resource. Also ensure you are copying the file to the assembly in the "Copy to output directory

WP8 Memory leak opening and closing PhoneApplicationPage

假如想象 提交于 2019-12-23 16:41:53
问题 I'm creating a Windows phone application that shows a list of thumbnails. I'm using a LongListSelector to do it. My application has memory leaks when I navigate forward and backward to the thumbnails list some times. I review the memory usage while using the App and I see that the memory increases when opening the page with the thumbnails (as I expect to). When I navigate back to the previous page the memory usage decrease but not as much at it was increased. Repeating the proces several