I would like to create a PanoramaItem that has no header at all. I would like to place some controls in this PanoramaItem and I want them to occupy the whole space. Of course I was able to delete the header text and change the font to smaller, but still there are some margins left. This might be easy, but I am new to WP7 development...
Is it possible to achieve and how?
Thanks in advance!
Negative top margin may be the quickest way to get rid the stubborn header padding.
<controls:Panorama Margin="0,-25,0,0">
</controls:Panorama>
You need to modify Styles of Panorama. There is was a question recently for Pivot here: Creating Pivot Footers on Windows phone 7 application, but you can do the same with a Panorama
<phone:Panorama.HeaderTemplate>
<DataTemplate>
<TextBlock FontSize="1"/>
</DataTemplate>
</phone:Panorama.HeaderTemplate>
it's a very funny method but for WP 8.1 Silverlight Apps this works fine.
Related
I'm developing an application using the Windows Phone 8.1 SDK, I write UI descriptions using XAML markup.
I can't get a text box to fill width.
I see similar questions already posted but they involve ListView.
I'm really confused. There seems to be no proportional sizing options.
Tutorials show the use of explicit pixel counts in design.
Is that really the preferred method on Windows? How am I supposed to
deal with unpredictable screen sizes in Windows?
The items which I had, which were failing to fill their parent, were inside a ContentControl. The ContentControl correctly filled its width, but its child, which was a Grid, would not.
I found the solution here – https://stackoverflow.com/a/17627257/5476004 – and I will echo that solution here in case this post is found by someone else searching about the same problem.
The ContentControl requires two special properties in order for its child element to fill the parent. They are HorizontalContentAlignment and VerticalContentAlignment. Like so":
<ContentControl Name="MyContent" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
…
</ContentControl>
Fill now occurs correctly.
Starting with following code
<Grid>
<ScrollViewer>
<ListView Name="listview" ItemsSource="{Binding Source={StaticResource list}}" />
</ScrollViewer>
</Grid>
I've huge list for winrt app around 1k items. it takes too much time to scroll so I've implemented scroll to top and bottom functionality.
listview.SelectedIndex
listview.UpdateLayout();
listview.ScrollIntoView(SelectedItem);
All this works fine on a simulator having around 1000 items in the ListView. but when I run the app with Surface device this method doesn't work. It actually fails and paints black rectangles while trying to render ListView.
I've just wasted my two days on it. I tried many things but no luck. Can someone tell me how can I handle long list using ScrollViewer having a ListView and using MVVM on Surface device itself. Simply put smooth scrolling on Surface device with a list of beyond 1000 while moving start to end programmatically.
PS: implementing search is not the option.
You should remove the outer ScrollViewer because that breaks virtualization. Other than that there's a limit on the size of the panels you can scroll to about 2 million pixels high/wide. After that you will see rendering issues.
The only way around that is rather complicated and involves writing your own list control from scratch. I don't think anyone has done it yet. Usually if the data is too big - people use other strategies like grouping and expanding groups.
I am making a windows 8 phone app and I want to add arabic text items to a longlistselector. Its orientation is supposed to be right from left but I cannot get it to align in the proper direction. Is there a way in Windows 8 xaml to detect the reading order of the text and adjust alignment accordingly?
At the Window/Page level, add the following property
FlowDirection="RightToLeft"
This is a Bindable property, so it can be set at Application Level, and the changes reflected with minimal amount of code.
I have a requirement to create a button in a Windows 8.1 app which has an icon and a text label. The icon will be a symbol from Segoe UI Symbols and the text label will be Segoe UI Semibold at a smaller text size.
I want to be able to reuse the button in different places within the app, using different icons and text labels.
How show I go about this? I could create a button and then edit the ContentPresenter to have a horizontally oriented stack panel with two TextBlocks, but then how could I reuse this? And how could I change the text in the two different text blocks?
Should I create a separate custom control with separate dependency properties for each of the textblock strings? I'm interested in hearing what you would do.
thanks
Create a simple Style. To make it easy, I would base it off the standardized AppBarButton style. You can format it to whatever size you want (I have done something similar to make a larger button or one with text on the side).
Have the main icon simply be a ContentPresenter which binds to the Content using a TemplateBinding. Make sure to set the FontFamily to Segoe UI Symbol. Have the text label pull from AutomationProperties.Name, similar to how the AppBarButton style does.
Then, whenever you want to use this just do:
<Button Style="{StaticResource MyCustomButtonStyle}"
Content="" // Where "000" is replaced by the number of the icon you wish to use.
AutomationProperties.Name="Text Label"/>
This should be extensible and easily reproducible to whatever location you need. When copying over the AppBarButton style, I suggest removing the artificial size limits (specifically the width of the main content Grid). I do suggest either giving the Text Label a fixed size or having it pull its size from the specified parent Width, so that it will Wrap correctly.
Hope this helps and happy coding!
Are you desiring to create something like for an AppBar? Take a look at AppBarButton and the style/types it supports. In Windows 8.1 we added some things around SymbolIcon specifically. Since you basically want two pieces of 'content' for your style you'll have to re-purpose one property (unless you create a custom control which doesn't sound needed for this scenario). Using AutiomationProperties.Name for the visible label is a good idea because it will also help with accessibility by default for those users.
Investigate the style for AppBarButton to get you started.
I'm building a simple Xaml app with the windows 8 store. Using the default (file/new/project) grid template, I get a screen that shows about 8 tiles all nicely aligned. I want to make the tiles a little shorter and wider. When I do that, it seems that the grid itself remembers the previous side.
Where is that set? How can I set it so my grid flows well once I've changed the individual tile size. I'm attaching a picture to clarify the problem. That is, the little nice gaps between tiles seems somehow hard coded to the size I am currently at and I can't figure out where to change that size.
Thanks,
never mind. I found it. (width="500" is what is was looking for)
<DataTemplate x:Key="DefaultGridItemTemplate">
<Grid HorizontalAlignment="Left" Width="500" Height="250">