Windows Phone 8 expandable list view - windows-phone-8

I need to implement expandable list view on windows phone 8. My target is to bind the values from JSON output which i receive as parent child format.

I'm assuming you are wanting something similar to Androids ExpandableListView?
If so, then take a look at Windows Phone Toolkits ExpanderView

The WPToolkit has a pretty awesome ExpanderView control. Check it out
http://www.geekchamp.com/articles/windows-phone-toolkit-expanderview-in-depth-part1-key-concepts-and-api
If you want to make a custom solution, in your datatemplate add a grid whose visibility is bound to your model property and on ListBox SelectionChanged, toggle the value of that property

Related

How to use the same ViewModel for different Pages (views)

I am searching for a way to use one ViewModel for two different Views (Pages). I know there is Multi-view support in Caliburn.Micro and I read a lot of it but I'm not sure if it is what I am looking for or how it works on Windows Phone.
Currently, I have one View ItemPage.xaml and one ViewModel ItemPageViewModel. I use this View/ViewModel to add a new Item and display an existing Item. Depending on the mode (add, show, ...) I need to show/hide or enable/disable some UI elements and display different AppBar buttons.
Instead of control these UI elements by binding to properties, I want to create two seperate Pages(Views) with the corrrect UI elements.
It would be nice to use the same ViewModel for both Pages to avoid repitive code. So is my use-case above possible with Caliburn.Micro for Windows Phone?

Windows PhoneToolkit ListPicker: implementing a countries list as in the settings?

I have a list of countries that I want to display in a list similar to that in the phone settings app
I tried using the toolkit's ListPicker but it had a poor performance in loading as the list size is large, it seems that this is a known issue with ListPicker.
is there any alternatives to implementing such a list ?
I know this is an old question, but here's the solution that worked for me:
Implement a new page with a ListBox.
In the new page, when an item is selected, save the selected Item/Index in the PhoneApplicationService.Current.State
Then navigate backwards and retrieve the saved Item/Index from the page state.

How to add footer to the list box in windows phone 8

I'm doing one windows phone 8 application. In this I've used list box. For the very first page I'm getting the data from server and adding that data to list box. Now I want to add Show More at the bottom of the list box i.e after the last item, to get the next items from the server.
How could I achieve this?
Hear you have to use Horizontal scrolling for load next data
Check below tutorial
Detect when a ListBox scrolls to its end (WP7)
Windows phone tutorial:Listbox
WP7 – How To Extend ListBox When Reaching Last Item
Windows Phone 7 ListBox Pagination with MVVMLight & ApplicationBar
we can Gets or sets the amount of data to fetch for virtualizing/prefetch operations by using
ListViewBase.DataFetchSize property and can Initiates the asynchronous request to load more data items, in accordance with the active incremental loading settings by ListViewBase.LoadMoreItemsAsync method.
If you want to do it by pagination then the following links may be helpfull for you
DataFetchSize method
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.datafetchsize.aspx
LoadMoreItemsAsync method:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.loadmoreitemsasync.aspx
You can see examples of using these here (though note that the sample was based on Windows 8 BUILD release and the apis have had some changes)
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e71b7036-4fb7-4963-a65d-5bcb9fd8f664
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

WP8 Control for picking a number

I need to allow a user to select a number between 5 and 30 in my Windows Phone app, and I find it overall difficult to do.
I am using pivot control so I shouldn't use slider according to MS guidelines.
I have downloaded WPToolkit and they have a neat DatePicker and TimePicker controls, and I think something similar would be perfect to pick a number (just the same way you pick time when setting up an alarm).
I was considering simple textbox, but I think it would be much nicer to just pick from a list of numbers instead of typing in...
Any ideas how to implement it? Or have anyone done that alrady? I think I could put like a textbox with focus or click event that would redirect to another page that has LongListSelector and once an item has been selected I would redirect back to the original page and populate the textbox with the selected number... Is that doable?
You can download the Toolkit source code and modify the DatePicker/TimePicker control to be more generic.
If you don't want to do that, you could just use the ListPicker control instead which is also included in the toolkit. Simply pass a list of numbers between 5 and 30 and the user can pick from the list.
You need to use LoopingSelector from Windows Phone Toolkit. An example how to customize it is here http://www.maxpaulousky.com/blog/archive/2011/01/31/windows-phone-looping-selector-for-digits.aspx.

Dojo/HTML equivalent for list box control

We are porting our MFC based client to Dojo. Is there any widget similar to listbox control. At present I am using DataGrid, but that seems heavy and overkill for our purposes. Alternatively what is best widget to replace listbox.
Update: I have already looked at dijit.form.multiselect, and I dont think that meets my requirement. MFC Listbox typically looks like this. I dont see (or rather dont know) how to replicate this with multiselect. It is possible that DataGrid is best fit for the control.
If you use dojo 1.7, take a look at the new DGrid.
For an example looking like yours, go to the tests page and pickup the Selector.html example.
Here are some options depending on which part of the ListBox you want to create:
dijit.Dialog to create a basic dialog box.
dijit.form.FilteringSelect to create a drop-down with your options (single select only).
You could also use radio buttons or checkboxes for your options depending on whether multiple selections are allowed.