w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
windows phone data binding listpicker to List of Strings
This is all: public List<String> m_Distances = new List<String>(); public List<String> Distances { get { return m_Distances; } } listPickerDistance.ItemsSource = Distances; <toolkit:ListPicker x:Name="listPickerDistance"> </toolkit:ListPicker>

Categories : C#

StackPanel don't grow with Textblock in Windows Phone 8 Application
A StackPanel will not resize its content in the same way that a Canvas will not resize its content. However, a Grid control can resize its contents. Try replacing this: <StackPanel Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> <TextBlock Text="Asystent Barmana" Style="{StaticResource PhoneTextNormalStyle}"/> <TextBlock Name="PageName" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> </StackPanel> with this: <Grid Name="TitleGrid" Grid.Row="0" Margin="12,17,0,28"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Grid.Row="0" Text="Asystent Barmana" Style="{StaticResource PhoneTex

Categories : Wpf

Windows Phone change text of textblock in listbox
You can define a value converter: public class PriceConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) return String.Empty; var text = (string) value; return text.Contains("Free") ? "text to free" : text; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } and use in in your xaml <TextBlock Text="{Binding Text, Converter={StaticResource PriceConverter}}">

Categories : C#

Windows Phone 8 xaml textblock binding format
use Run <TextBlock> <Run Text="R" /> <Run Text="{Binding cost}" /> </TextBlock> or use StringFormat <TextBlock Text="{Binding cost, StringFormat=R{0}}" />

Categories : Xaml

Finding the Line Count of a Textblock in windows phone 7 & 8
What you need is TextTrimming="CharacterEllipsis". Either do it yourself: http://igrali.com/2013/03/31/character-ellipsis-trimming-in-windows-store-apps/ Or wait some weeks: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.texttrimming.aspx

Categories : C#

long list in c# windows phone.What are the ways to display LISTs in windows phone?
The idea of a ListBox/LongListSelector is to show a list of items that wouldn't fit on the screen at once. The user can scroll through all the items so it sounds like it's doing what you'd expect it to. If each item is too long for your deign plans then you have to change your item template design.

Categories : C#

How Can I fetch/scrape HTML text and images to Windows phone?
This is not as simple as you would think. You will have to use HTMLAgility pack to parse and normalize the HTML content. but then you will need to go through each node to assess if it's content node or not, i.e. you would want to ignore DIVs, Embeds etc. I'll try to help you get started. READ THE DOCUMENT Uri url = new Uri(<Your url>); HtmlAgilityPack.HtmlWeb web = new HtmlAgilityPack.HtmlWeb(); HtmlAgilityPack.HtmlDocument document = web.Load(url.AbsoluteUri); HERE IS HOW YOU CAN EXTRACT THE IMAGE AND Text tags var docNode = documentNode; // if you just want all text withing the document then life is simpler. string htmlText = docNode.InnerText; // Get images IEnumerable<HtmlNode> imageNodes = docNode.Descendants("img"); // Now iterate through all the images and do what

Categories : C#

Sending large strings through TCP - Windows Phone
while ((RecBytes = netstream.Read(RecData, 0, RecData.Length)) > 0) { Fs.Write(RecData, 0, RecBytes); totalrecbytes += RecBytes; } Edit: now that section of code has been reduced down to only int k = s.Receive(b); is bad: it assumes all the data sends perfectly in one go, which isn't how networking works. Two options: At the start of the string, include how long it should. At the end of the string, have an end symbol (a null perhaps) that won't be anywhere else in the message Then that while loop should keep going until either the entire length is found or the end symbol is found. (Also, sending Base64 is a bad idea when you can avoid it. Why not send as a strea

Categories : C#

Strings are appearing in uppercase in Windows Phone 8 with Cordova
I am guessing that you began your work on the new app by extending the template onwards. That's a valid strategy, but the template's CSS styles include the following rule: body { text-transform:uppercase; } That effectively causes everything to show in upper case.

Categories : Windows Phone 8

Fetch contact list along with their primary email and phone number in a single query from the ContactProvider
Below is the code to fetch all the contacts including email. private void getContacts() { ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); String id = null, name = null, email = null, phone = null, note = null, orgName = null, title = null; String Phone1 = "unknown", Phone2 = "unknown", Phone3 = "unknown", type1 = "unknown", type2 = "unknown", type3 = "unknown"; int size = cur.getCount(); StringBuilder addbuffer = null; if (cur.getCount() > 0) { int cnt = 1; while (cur.moveToNext()) { email = ""; name = ""; cnt++; id = cur.getString(cur.getColumnIndex(ContactsContra

Categories : Android

How to create Windows Phone 8 app package for windows store using VS Express 2012 for windows phone?
If I understand correctly, you're hoping to publish a Windows Phone 8 app to the Windows Store (on Windows 8)? Publishing to each store (phone/Windows) is a separate process, requiring different projects, and as you've seen, different versions of Visual Studio Express 2012. There's an helpful Windows Phone 8 and Windows 8 App Development Dev Center for guidance on doing this, and a recent article by Doug Holland on "Sharing Code between Windows Phone 8 and Windows 8 Applications" that should help as well.

Categories : Windows Phone 8

How to add footer to the list box in windows phone 8
I'll go ahead posting the logic as My code might not match with yours So 1 -> Save the server data in an array or a list. 2 -> Design the xaml in a way that the Parent Grid has two or more rows with the last row for the show more. And the one before for the list. (Adjust height accordingly) 3 -> Populate it with a limited amount of data. 4 -> Next use the ListBox.Items.Add(data) method to add the data to the list. Keep sorted property off so that the elements are inserted at the bottom of the list -> Go through the link Add Method for Observable Collections Use step four on the show more button click .. and also adjust the height of the list or put it into a scrollviewer so that limited height scrolling can be done . olease update if further queries

Categories : Windows Phone 8

databinding to a int list "windows phone 8"
I'm not sure what the issue is. Bind your ListBox, ItemsControl, or whatever, to the list, then bind the width of your rectangle to the current item (by setting an empty binding expression): <Rectangle Width="{Binding}" />

Categories : C#

Add contact list on windows phone 8
try this code ... longlist selector works fine on panaroma ... just change the list binded with your own list and make the datatemplate according to ypour wish it will work fine ... <phone:PanoramaItem Header="first item"> <!--Single line list with text wrapping--> <phone:LongListSelector Margin="0,0,-22,0" ItemsSource="{Binding Items}"> <phone:LongListSelector.ItemTemplate> <DataTemplate> <StackPanel Margin="0,-6,0,12"> <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeExtraLarge}"/> </St

Categories : C#

how to save a list in windows phone 8
The following link has some really great videos. I started off on using them. There is one video which does pretty much exactly what you want, I think it's at the bottom of page 4, and the continuation on page 5, but can't quite remember. But you should check several of them out, there really great. Channel 9 - Windows phone for beginners I would also suggest you looking at this website which contains nice clear info about IsolatedStorage: All about IsolatedStorage In fact the GeekChamp website is really good for finding out how to do things after you've started understanding more about Windows Phone and C#

Categories : List

Searching a list of strings to return only those strings that match another input list of strings in Linq
var result = S.Where(x=> X.Any(y=>x.EndsWith(y))); If you want to ignore case: var result = S.Where(x => X.Any(y => x.EndsWith(y, StringComparison.CurrentCultureIgnoreCase)));

Categories : C#

How to list all media files in windows phone 7?
Use the MediaLibrary class. Here's an example of how to retrieve all the songs in the media library and play the first one. http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.xna.framework.media.medialibrary.aspx

Categories : C#

i need a list view example program in windows phone 8
Here's the simplest example I could come up with. I've also added handling for contacts without any phone numbers. xaml: <phone:PhoneApplicationPage x:Class="so17564250.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait"> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/>

Categories : C#

trying to create a list of deserialized data windows phone
Check carefully this place CreationDate = news_items[i].CreationDate.Substring(0, news_items[i].CreationDate.IndexOf('T')), LastUpdateDate = news_items[i].LastUpdateDate.Substring(0, news_items[i].LastUpdateDate.IndexOf('T')), DisplayUntilDate = news_items[i].DisplayUntilDate.Substring(0, news_items[i].DisplayUntilDate.IndexOf('T')), I suppose one of your dates just in wrong format and has no "T"

Categories : C#

print the text box value in list view in windows phone 8
you will have to add a item source of the list box .. List<data> asd = new List<data>); asd.Add(new data(textBlockNumber.Text,DateTime.Now)); myList.ItemSource = asd; make a data class public class data { public string liststing {get;set;} public DateTime datetime {get;set;} public data(string textblocktext,DateTime date) { this.liststring = textblocktext; this.datetime = date; } } then bind the text of textblock in xaml like Text="{Binding liststring}" and your other Text="{Binding datetime}" i hope it helps ...

Categories : C#

How to add NEXT and PREVIOUS buttons after all the items to list box in windows phone 8
You could put your ListBox inside another ListBox, where the items are the result ListBox and the buttons, e.g: <Grid x:Name="ContentPanel" Grid.Row="3" Background="White" Margin="0,-3,0,0"> <ListBox x:Name="outerList"> <ListBox x:Name="companiesList" Height="{Binding ActualHeight, ElementName=ContentPanel}" SelectionChanged="companiesList_SelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Auto"> <ListBox.ItemTemplate> <DataTemplate> <Grid x:Name="listItem"> <Grid.RowDefinitions> <RowDefinition Height="50"/> <RowDefinition Height="30"/>

Categories : Xaml

Serializing and deserializing a list of objects in a Windows Phone 8 app
I'm using these methods to Save and Load from a XML file in/to the IsolatedStorage : public static class IsolatedStorageOperations { public static async Task Save<T>(this T obj, string file) { await Task.Run(() => { IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication(); IsolatedStorageFileStream stream = null; try { stream = storage.CreateFile(file); XmlSerializer serializer = new XmlSerializer(typeof (T)); serializer.Serialize(stream, obj); } catch (Exception) { } finally { if (stream != n

Categories : Windows Phone 8

Using Azure how do you list blobs in a container for Windows phone 8?
Hello yes the toolkit has been deprecated the other way is I think that you can start using the Windows Azure Mobile Services: http://www.windowsazure.com/en-us/develop/mobile/ if you previously have worked on Windows Azure Node JS then you can easily build a new Windows Azure Mobile API that do the required action which is listing the blob and call this API from your Windows Phone application. here is the resources of the NodeJS and how it uses the Windows Azure Blob Storage: http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/blob-storage/ to integrate it with the Mobile Services, just fo to your portal, create new Windows Azure Mobile Services and under API enter the NodeJS Code. here is a link demonstrating how to work with it: http://weblogs.asp.net/scottgu/archive/20

Categories : C#

Convert ArrayOfString to List in C# for Windows Phone 7
If ArrayOfString is truly a basic array of string types, you can do the following: string[] names = { "John", "Doe" }; List<string> namesList = new List<string>(names); // OR List<string> namesList2 = new List<string>(); foreach (string name in names) { namesList2.Add(name); }

Categories : C#

Pull To Refresh with Long List Selector Windows Phone 8
You can accomplish this with the ItemRealized event and using a ListHeader (or ListFooter to pull from bottom). Within the ItemRealized event you check if the item is your header object. If it is then load more items. From the Windows Phone Dev Blog The ItemRealized event is raised every time a LongListSelector item acquires a UI container to be displayed on the screen. In other words, every time an item enters the UI buffers above or below the current viewport, the ItemRealized event is raised. The event argument property ItemKind indicates whether the UI container is an Item, ListHeader, GroupHeader, or ListFooter. Using the property Container.Content you can get the actual object associated with the UI container that was realized. This way you can monitor the objects within the UI

Categories : C#

unable to bind JSON data to list in windows phone 8
your deserialization should be var example = JsonConvert.DeserializeObject<List<readqueriesObject>>(json); No need for listreadqueries PS: your json is an array, not an object cotaining array ({queries:[...]})

Categories : C#

How to save list picker selected data in windows phone
The problem is at the line: postData.AppendFormat("&{0}={1}", "retailer",HttpUtility.UrlEncode(this.RetailerList.SelectedItem.ToString())); this.RetailerList.SelectedItem will return the BestinukRetailers object. What you need is the retailername property of that object. To retrieve it, simply cast the object to its original type: var retailer = (BestinukRetailers)this.RetailerList.SelectedItem; postData.AppendFormat("&{0}={1}", "retailer",HttpUtility.UrlEncode(retailer.retailername));

Categories : PHP

Custom list, moving stuff up automatically after removal in Windows Phone
1) Use animations for your fade out and slide up. For fade, you'll be doing a DoubleAnimation on the Opacity property. For sliding items up, you'll be doing an animiation on the TranslateTransform property. See these MSDN guides: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206955(v=vs.105).aspx and http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.media.translatetransform(v=vs.105).aspx 2) For actually properly moving things up, you'll want to capture the Completed event from the animiation (http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.media.animation.timeline.completed(v=vs.105).aspx). When the animiation completes, remove those controls from the StackPanel inside the ScrollViewer, and undo any position animatio

Categories : C#

Image inside textblock c# windows 8
Try this : Using Grid or canvas we can place elements one over the other <ScrollViewer x:Name="ScrollViewer"> <Grid> <Image Source="Assetspicture.png" /> <TextBlock x:Name="TextBlock" /> </Grid> </ScrollViewer>

Categories : C#

How to do image collision in C# for Windows Phone 8 using Windows Phone App?
I don't see a reference to the bar object in your code. But the detection of the collision is much easier than the physics of handling the collision. There are several schools of thought to something as simple as Pong collision, and the way you choose to handle it depends on the gameplay you want. Here is an easy way to detect and handle the collision, simply by negating the X velocity just as you are handling the wall collisions: if(greenBallPositionX1 < leftBar.X || greenBallPositionX1 > rightBar.X) { this.greenBallVelocityX *= -1; } Keep in mind you might also have to take into account the width of the bar or the ball depending on where the coordinate is in relation to the image. For example: if(greenBallPositionX1 < (leftBar.X + leftBar.Width) || greenBallPositionX1 &

Categories : C#

Can I create a proper drop down menu list in windows phone, nothing like Picker Box, ListPicker, AutoCompleteBox achieving my objective properly?
The ListPicker has a property ItemCountThreshold. This property allows you to specify when the ListPicker should display the full screen selector. This property defaults to 5. You can change the default to a much high number, but you should take caution with doing this. The ListPicker is meant to mimic controls that are used throughout the core apps (like Settings) of the phone. You'd have a hard time finding built in apps that show more than five items in the "dropdown". When displaying in FullMode, you should specify a FullModeItemTemplate and FullModeHeader. The FullModeHeader should be in all caps

Categories : C#

WPF binding textblock to column in parent table, in addition parse childtable and set appropriate values to the textblock
I recommend you to build a custom model or viewModel to handle these complex relationships between child and parents. For example: Create two classes named Parent and Child. Each classes have properties to keep their corresponding datasets. Parent have a collection of their child. Child implements INotifyPropertyChanged so the parents can subscribe to the PropertyChanged event and know when a child has been read (and keep track of that). At the end you bind to the classes properties and not to the datasets. Remember to implement INotifyPropertyChanged in the properties you want to bind or use DependencyProperties. Here are some tricks about implementing INotifyPropertyChanged

Categories : C#

MyToolkit for windows phone 7.x "Sorry we can't play this file on your phone" for VEVO videos
It's a YouTube restriction I'm afraid. Not entirely sure how to unblock it but a fair amount of videos are tagged as HQ or have a "non-mobile" flag. Certain channels also only allow desktop viewing and changing the browser version on your phone (mobile vs desktop) does not help. Not even sure if it's possible from Windows Phone devices for uploaded videos. One suggestion is to look at the YouTube developer pages to see if there are any tags you can set programatically while uploading.

Categories : C#

Centering text vertically and horizontally in TextBlock and PasswordBox in windows store app
TextAlignment is for horizontal alignment. TextBloxk itself doesn't suport vertical alignment. I suggest put a border around it and let border do vertical alignment, <Border BorderBrush="{x:Null}" Height="50"> <TextBlock Text="Your text" VerticalAlignment="Center"/> </Border> Or other way would be using height and set padding within textblock For password box use (WPF) <PasswordBox HorizontalContentAlignment="Center" VerticalContentAlignment="Center" /> (silverlight) you will need to extract the actual template of passwordbox (use blend it allows you to edit template and copy that) then you can change the members (on ContentElement which is of type Border) with template binding like, HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Ve

Categories : C#

how to access phone memory from 3rd party application in windows phone 8
This question has been answered here: Can I write some data to SD card on Windows Phone 8 It tells you how to access memory on an SD card and in other Windows Phone 8 folders, including a Win32 Storage API which can be used to try to access files in phone storage that aren't normally available to you. I'm not sure if this will allow your app access. http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402541%28v=vs.105%29.aspx#BKMK_Medialibrary

Categories : Dotnet

Windows Phone: How to get list of installed applications & install/remove applications remotely
AirWatch is a software for entreprise deployment. It's simply built upon Windows Phone's company hub. http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206943(v=vs.105).aspx

Categories : C#

Find if a String in a list of Strings is in another list of Strings in Esper
You'd want to look at enumeration methods, see http://esper.codehaus.org/esper-4.9.0/doc/reference/en-US/html_single/index.html#enumerationreference It seems that "intersect" and "countOf" in combination would suit.

Categories : Java

Read all phone contacts and update them. windows phone 8
try something like this void GetContact() { cons = new Contacts(); //Identify the method that runs after the asynchronous search completes. cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(ContactsSearchCompleted); //Start the asynchronous search. cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #1"); } private void ContactsSearchCompleted(object sender, ContactsSearchEventArgs e) { cons.SearchCompleted -= ContactsSearchCompleted; //e.Results should be the list of contact, since there's no filter applyed in the search you shoul have all contact here } not this is a copy paste of an old not tested code of mine so you might have to change something

Categories : C#

Fetch row by various key strings SQL
UPDATED A possible solution might be to split your string on the client by space and then use a query like this (if you need exact matches in columns) SELECT * FROM products WHERE product_id IN (123, 94) OR price IN (123, 94) or SELECT * FROM products WHERE 93 IN (product_id, price, productname) OR 123 IN (product_id, price, productname) OR 'cooldrink' IN (product_id, price, productname) Here is SQLFiddle demo Now if you need to ensure that both of the keywords are either price or product_id for the same row SELECT * FROM products WHERE (product_id = 123 AND price = 94) OR (product_id = 94 AND price = 123) Here is SQLFiddle demo Another way, if partial matches are OK, to approach this SELECT product_id, price, productname FROM ( SELECT p.*, ','

Categories : SQL

Bind a textblock in a nested list member
From your example, if I understand what you're doing correctly, you should just be able to use an index to bind to the desired item from the collection. I'm not sure it's the best approach, but it should yield the result you're after. E.g. (adapting your example): <ListBox ItemsSource="{Binding}" HorizontalAlignment="Left" Height="580" Margin="0,80,0,0" VerticalAlignment="Top" Width="446"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <ListBoxItem Tap="ListBoxItem_Tap" Tag="{Binding Path=id}"> <TextBlock Name="First" Text="{Binding Path=name}" /> <TextBlock Name="Second" Foreground="Gray" Text="{Binding Path=breweries[0].name

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.