WP7 PanoramaItem with Icon/Button next to Header - windows-phone-7

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.

Related

XAML Control padding overlapping other controls

I am doing a windows phone app that I have a 6 x 6 grid of checkboxes, They have to be sized specifically to line up with a background image. I can get the content size correct, but the entire size of the control is too big. I am using the default controltemplate, and I have tried to set the padding to alter the padding between the content and the outer margin of the control but it does not change.
<CheckBox x:Name="chkc1r1" Content="" HorizontalAlignment="Left" Margin="42,24,0,0"
VerticalAlignment="Top" Height="58" Width="42" Tap="chkc1r1_Tap"
BorderThickness="0" UseLayoutRounding="True" Padding="-10"/>
What am I missing here?
After doing some more digging, I found that the property that I looking for is the touch overhang property, has anyone ever altered this property? A very old post that says it can be done in the App.xaml, but did not say how. Anyone have any Ideas?
Anyone have any Ideas?
Specify your own control template for your checkboxes. In Blend, right-click on a checkbox, "Edit Template/Edit a copy", save. Then in visual studio edit the template, replacing "{StaticResource PhoneTouchTargetOverhang}" with e.g. "0".

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>

Adding UI elements to scrolviewer dynamically, win phone

I know how to add children to panels. It is like this
stackpanel.children.add(uielement);
But I have a scrollviewer inside stackpanel.
I wanted to add textblocks and other elements inside the scrollviewer but there is no function to add children to scrollviewer.
I tried to add another stackpanel inside the scrollview and add elements to it... but if I add elements dynamically to the stackpanel defined inside scrollviewer the elements show right but there is no scroll. If I do the same that is:
<ScrollViewer>
<StackPanel x:Name="StckPanel">
<TextBlock Text="etc" />
</StackPanel>
</ScrollViewer>
Doing this enabled the scroll. But If I add elements to the stack panel using
StckPanel.Children.Add(Textblock Object);
It does add the elements but the scroll is now disabled.
Here is what I did:
The XAML code is
<ScrollViewer>
<StackPanel x:Name="Hello"></StackPanel>
</ScrollViewer>
In my c# file I did this:
TextBlock x= new TextBlock();
x.Text="Here it goes";
StckPanel.Children.Add(x);
But when I do this the scroll is disabled. I am not able to scroll.
So I need to know why is the scroll not working here. And how am I supposed to add child elements inside ScrollViewer.
As in XAML we can add UIElements inside the tags of ScrollViewer. Why cant we do the same using c#.
Well I found the problem. I was not specifying the height width and margins properly. As a result this messed up the scroll somehow.

Expanderview in listbox, 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.

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.

Resources