Expanderview in listbox, Windows phone 7 - windows-phone-7

I am binding comments of user to expander view. The code looks
<ListBox..>
<ListBox.ItemTemplate>
<DataTemplate>
<toolkit:ExpanderView>
..
</toolkit:ExpanderView>
</DataTemplate>
</ListBox.ItemTemplate>
When we expand two or more items and then scroll till down/up of listbox, and then back to that expanded items, the expander view are overlapping with one another disturbing Ui.
Whether there is any solution for this?

This issue is fixed in November 2011 latest update toolkit.

Related

Side scrolling menu with gesture removable items

I am trying to create a menu (currently a ListBox containing Images) for an app (WP8 specifically, but general principal will be the same for other environments) with the behavior determined by the initial part of each gesture:
dragging/swiping the menu left or right will cause the menu to scroll left or right
dragging an item up from the menu (which is at bottom of screen) will allow it to be detached (or recreated) and placed in another container.
Roughly speaking, I understand how to drag-and-drop the element, and to make a side-scrolling menu, but I am having difficulties in putting the two together and determining whether to be in "menu scroll" mode, or "drag and drop" mode, and how to switch between the two programmatically.
<ListBox Height="100"
ItemsSource="{Binding}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Grid.Row="1"
Name="MainMenuPicker">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal">
</StackPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding Path=Source}" Tap="Image_Tap"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Currently, horizontal scrolling is taken care of by ScrollViewer.HorizontalScrollBarVisibility="Auto"
I attempted to have a ManipluationStarted, ManipulationDelta etc to determine direction of gesture, but didn't get very far. I currently have a Tap event handler on the Image that moves moving to another parent container.
Questions:
1. How can I determine if a gesture is a side-to-side movement on the menu (ListBox) as a whole, or a drag (upwards) of an Image within the ListBox?
How can I programmatically set each case so that the functionality behaves as described?
Thanks in advance!
In this case you need to use Flick events,and use HorizaltalVelocity and vertcalvelocity to detect and distinguish between left-right and top-down swipes.
check this sample for better understanding

How to add more controls in Windows Phone 7 that is larger than screen size using ScrollViewer

In my Windows Phone 7 app, I just tried to add 10 controls in a page, but only 7 controls are visible in the page. I want to add remaining controls in that page which is above phones' default screen size.
When I googled this I found that the ScrollViewer control is used to scroll pages. So I added the ScrollViewer above my grid and set its vertical scrollbar visibility to true, but nothing changes as I'm not able to view the controls.
How do I write the XAML using a ScrollViewer to show all my controls?
ScrollViewer can have only one child under it, but it can be any kind of element or element container like a Grid for instance.
Just add all the elements to that container and then you will be able to scroll all items.
For example you can use a StackPanel since that will simply wrap all items under each one
<ScrollViewer>
<StackPanel>
<!-- All your controls -->
</StackPanel>
</ScrollViewer>
this is working
<ScrollViewer>
<StackPanel>
<!-- All your controls -->
</StackPanel>
</ScrollViewer>
bt in stack panel it goes as stack we cant move controls as we wish. to get rid of that we can use grid.
<ScrollViewer>
<Grid>
<!-- All your controls -->
</Grid>
</ScrollViewer>

WP7 - ListPicker in StackPanel in ScrollViewer

Just started with developing for WP7 and came across the following. I have a pivot application with a few pivotitems. On the first pivotitem (see code below) I want to be able to adjust a lot of settings. For this question all items to be set are called 'TextBox' and the choice in the ListPicker is either A,B or C.
Now if I do NOT use the ScrollViewer and I tap any of the listpickers I get to see all three options BUT I can not scroll through all listpickers.
If I DO use the ScrollViewer, I CAN see all listpickers but only the top one (that's visible) will expand and give me the options A,B and C, they others stay collapsed.
How can I get every listpicker to expand and show me the avaiable options AND be able to scroll to every listpicker on the page?
PS In code below copy the stackpanel between start and end about 15 times.
Thanks in advance for any help!
<controls:PivotItem Header="blabla">
<ScrollViewer>
<StackPanel Margin="0,0,36,0" VerticalAlignment="Top" d:LayoutOverrides="Width">
// start
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Text="TextBox" Width="80" TextAlignment="Right" Margin="10,22,20,0" HorizontalAlignment="Right" VerticalAlignment="Top" />
<toolkit:ListPicker Margin="0" Width="275">
<toolkit:ListPickerItem Content="A"/>
<toolkit:ListPickerItem Content="B"/>
<toolkit:ListPickerItem Content="C"/>
</toolkit:ListPicker>
</StackPanel>
// end - copy/paste code code between start and end about 15 times right here
</StackPanel>
</ScrollViewer>
</controls:PivotItem>
This is, apparently, a common issue with Listpicker and ScrollViewer. You can find a workaround here
Should anybody stumble upon this, this has been fixed since the november 2011 release of the wP7 silverlight toolkit.

WP7 AutoCompleteBox Popup position

The toolkit:AutoCompleteBox in WP7 "opens" the Popup with results above the textfield. I need this Popup to be below the TextBox.
Wasted hours on this. finally, i've written my own autoCompleteBox with a ListBox opening below.
Just out of curiosity, pleas tell me how it shold be with the "original" one
I faced the same issue and this is how I solved it, using Perspective Transforms and RenderTransform in the borders of Popup in the default template.
<Popup>
<Grid>
<Border>
<Border.Projection>
<PlaneProjection GlobalOffsetX="-10" GlobalOffsetY="37" CenterOfRotationY="1" CenterOfRotationX="0" RotationX="180"/>
</Border.Projection>
<Border>
<Border.Projection>
<PlaneProjection RotationX="-180"/>
</Border.Projection>
<ListBox/>
</Border>
</Border>
</Grid>
</Popup>
Change GolbalOffsetX and GlobalOffsetY according to your textbox height and width.
There is no default property that will define the location for the popup in the AutoCompleteBox control.

WP7 PanoramaItem with Icon/Button next to Header

Windows Phone 7's People hub has an "all" panorama item with "search" and a "new" buttons right next to the header/title.
I can't seem to accomplish this with PanoramaItem in Visual Studio using the standard Panorama control. I don't know enough Silverlight/WPF either to be able to position something manually and control transitions/movement correctly.
How can I set a button (or any object, for that matter) to go alongside the header of a wp7 PanoramaItem?
Thanks!
A PanoramaItem Header doesn't have to be a string. It could be another StackPanel that has a CheckBox in it if you wanted, something like this:
<controls:PanoramaItem>
<controls:PanoramaItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock>Item</TextBlock>
<CheckBox>CheckBox</CheckBox>
</StackPanel>
</controls:PanoramaItem.Header>
<Grid>
<TextBlock>Your Content</TextBlock>
</Grid>
</controls:PanoramaItem>
So you can basically put anything in there that you want. Images, buttons, checkboxes, etc.

Resources