I'm currently developing a Windows Phone 7.5 app with a panorama page.
At the panorama page, I'm implementing an appbar to deal with several things in the app, such as displaying phone location in a Bing Map which is located in one of the panorama page items.
Now, I believe I have two options, but I don't know how they would work (if they even do work...):
Show only appbar icons relevant to current page/item
If you're not at the respective page/item, redirect to the page/item when clicking the appbar icon.
Would any of these actually work? Could I set an ID for each of the panorama items, and then make either 1 or 2 to work?
Thanks :)
Both are possible to accomplish.
For showing only the appbar icons relevent to the page you can use the Panorama.SelectionChanged Event:
var currentPanormaItem = ((Panorama)sender).SelectedItem
if(currentPanormaItem.Equals(firstPageItem))
{
// Set AppBar icons for first page
}
else if(currentPanormaItem.Equals(secondPageItem))
{
// Set AppBar icons for secondpage
}
If you know which panorama item is selected you can set the appbar icon accordingly.
Changing the selected item of a Panorama can be accomplished like this:
panoramaControl.DefaultItem = panoramaControl.Items[indexToSet];
Though changing the selected index of a Panorama is possible, I would advise using a Pivot control. With a Pivot control it is easier to keep track of the selected item and you get a nice animation when you programatically switch the selected page.
Related
This question about WP8 project.
I have a LongListSelector with pictures and html formatted text below. Currently each pictire implemented as an Item of the list. The last Item with browser has its own template and shows WebBrowser instead of picture.
I am expected this item behave such as TextBox which I can scroll by interacting with LongListSelector.
But this WebBrowser has it's own scroll inside and intercepts any surrounding scrolling events. Thus whenever I scroll down the list to show WebBrowserControl to the whole screen, I can't go back to the pictures.
Please help me with this issue. What is the appropriate solution? I need a separate pictures since want to implement "Clicked" logic on top of it. And I want to have WebBrowser too (but prefer to behave it similar to RichTextBox (which I can't find in WP8))
USE ListBox.ItemTemplate along with DataTemplate and inside dataTemplate we could custom create xaml tag !
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item.
Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
If you do this, aren't you going to be breaking the design guidelines for the Panorama control, therefore the control is no longer a Panorama control, making your application inconsistant with other applications using the unmodified version of the control?
You can give a panorama item a negative margin:
Margin="-24,0,0,0"
Ok, the way to do this is to wrap the content of the panoramaItem into a WrapPanel and set the orientation of the panoramaItem to horizontal.
i have a problem with my WP7 app. i'm creating a screen where the user can make some input and then generate something.
but i can't fit the whole input into the screen size, so i would need a element which has a scroll bar or something and i can add so many elements as i which and then the user scrolls up and down. how to make this?
There is a ScrollViewer control that you can use. Put the grid in the ScrollViewer and you can then scroll around.
encapsulate your content in a <scrollviewer> That should show a scrollable content.
I am working on a sample which contains list view to display list of names in the data base. Once the application is launched list view will be invisible. After clicking on some button I am making it to visible. If I make it to visible the control bellow the list view are also visible. And I have button bellow that control, once I hove on the list view the button also displays over the list view.
Please let me now how to solve this problem.
It sounds like you have child windows on top of each other in a dialog. Use ShowWindow(SW_HIDE) to hide the windows that are 'underneath'. So when you make the listview visible, hide the button that is underneath.
On the windows desktop, application windows will properly hide other windows that are underneath one another, but in a dialog, different styles are used, and you have to be careful not to let controls overlap or they can draw on top of each other. Instead you need to hide the ones that you don't want to be visible.
I have page containing 4 textboxes and a button. The content is within ScrollViewer. When user goes to the last textbox, the button below it is 50% visible. So, to click it, user has to click on non-focusable area to hide the keyboard and then click on button.
Is there any way to move the ScrollViewer up? Or move the content up so that the button below focused textbox can be seen 100%?
The solution is to remove the buttons on the page and replace them with buttons in the ApplicationBar as this is always viewable below the SIP.
If this is not a solution you can implement (from a design view-point there is no reason to not do this but sometimes these decisions come from elsewhere) then you could look to use the ScrollToVerticalOffset method to try and bring the desired item into view.
I would suggest you read Alex Sorokoletov's article on how to transform the view. It might be of help for your problem.