I 'm developping a windows phone 8.1 application and I would like to make a view with the panorama control but Its impossible to find the control
I have the Pivot control but not the panorama, is the panorama control is available on windows phone 8.1 ?
I have find nothing on it on the Internet so far :/
Thanks for the help :)
The Panorama control has been renamed Hub because it’s now available on both Windows Phone and on Windows. So, you would do something like:
<Hub Header="My header">
<HubSection Header="My sub header">
<DataTemplate>
<Grid />
</DataTemplate>
</HubSection>
<HubSection Header="My sub header 2">
<DataTemplate>
<Grid />
</DataTemplate>
</HubSection>
There are some changes in the API, as you will use HubSection instead of a PanoramaItem, and you must have a DataTemplate inside a HubSection, so be sure to check the following reference:
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.hub.aspx
There are some nuances as a slightly different and odd behaviour when you have only 2 HubSections, as noted here: Windows Phone 8.1 app with 2 hub sections, but that may or may not be an issue for you. Some guidelines and implementation examples can be found here:
https://msdn.microsoft.com/en-us/library/windows/apps/dn449149.aspx
Related
I am working on a windows phone project, under a universal project. A feature I am looking for is the longlistselector template, that I am unable to find under toolbox. Am I missing something?
Or rather, if there is a way to arrange a list (of say countries), and lets say alphabetically, I wouldn't mind using that either.
VS2013 - U4; W8.1;
Thanks in advance!
There is no LongListSelector in WP8.1 RunTime/Universal app. Take a look at available controls at MSDN.
If you need a simple list, take a look at ListView.
If you need grouping, then think of using SemanticZoom. In this case you will find also some help here at blog, here or here.
LongListSelector is not available for Universal apps, it's only available for Silverlight Phone apps. Instead you can use ListView .
Example :
<phone:LongListSelector ItemsSource="{Binding Items}" >
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}">
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" >
</DataTemplate>
</ListView.ItemTemplate>
More details check this article : Migrating from the LongListSelector to the ListView in Windows Phone XAML Apps
I am trying to change the context of a button inside a DataTemplate, but in my code-behind I can't acses it. What am I doing wrong?
Here is the XAML I am using:
<Grid>
<Hub>
<HubSection>
<DataTemplate>
<Grid>
<Button x:Name="THEbutten" Content="Button" HorizontalAlignment="Left" Margin="186,230,0,0" VerticalAlignment="Top"/>
</Grid>
</DataTemplate>
</HubSection>
</Hub>
</Grid>
Your Button is inside a DataTemplate, and therefore it is in a different context than the page and not accessible from it's codebehind.
Consider the following options:
Modify your Buttons Properties using Data Binding.
Create a UserControl for your HubSections Content.
Sadly, the Hub Control is fairly hard to understand and use for beginners, because of this DataTemplate.
Here are some tutorials:
Mikaelkoskinen - Getting started
DotNetCurry - The Windows 8.1 Hub Control
There are also several questions around here on that topic:
How to access controls within hubsections
I am new to Windows Phone Dev. I d like to do a slideshow of for images with swipe gesture in C#, but i cant... The development app is for Win8 in visual studio 2013.
Somebody know a good tutorial or some example to do this?
Cheers!
I think the control you are looking for is the FlipView
It will work on both Windows 8.1 and Windows phone 8.1
Using it is very simple, add that in your XAML:
// SelectionChanged event will be fired every time a picture changes (optional)
<FlipView x:Name="flipView1" SelectionChanged="FlipView_SelectionChanged">
// Of course replace the source with the relative paths
// of the pictures you want to show
<Image Source="Assets/Logo.png" />
<Image Source="Assets/SplashScreen.png" />
<Image Source="Assets/SmallLogo.png" />
</FlipView>
This is the simple usage of a FlipView control, but as always it is better to use Bindings and MVVM design pattern, in case you are using it here is what you should write
In your XAML:
<FlipView x:Name="Diaporama"
ItemsSource="{Binding FlipViewImage}">
<FlipView.ItemTemplate>
<DataTemplate>
<Image Source="{Binding}"
Stretch="Fill" />
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
And in my ViewModel:
// I binded the FlipView with FlipViewImage
// which is a list of strings (each string being a path)
private List<string> _flipViewImage;
public List<string> FlipViewImage
{
get { return _flipViewImage; }
set
{
_flipViewImage = value;
NotifyPropertyChanged("FlipViewImage");
}
}
// Then I fill the list
FlipViewImage = new List<string>
{
// Again replace the image paths with your own
"../Assets/Seel_photo_Aurelien.png",
"../Assets/shop_woman.jpg",
"../Assets/Poster.jpg"
};
You now have a slideshow of pictures that you can change with swipe gesture.
I just showed the basic stuff you can do with it, you can find more on the MSDN website or looking in Google
Msdn documentation for FlipView
I want to add a contextual menu to a button from the appBar(bottom appBar). My min SDK is Windows 8.0. I would like something like this popup from MSDN:
Unfortunately I cannot use MenuFlyout since it is available only from Windows 8.1+, so I want to achieve this menu in another way. If you know how it can be done, please tell me.
Below is my bottom bar:
<common:LayoutAwarePage.BottomAppBar>
<AppBar x:Name="bottomAppBar" Padding="10,0,10,0" DataContext="{Binding}">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button Style="{StaticResource EditAppBarButtonStyle}" Click="EditQuote_Click"/>
<Button Style="{StaticResource RemoveAppBarButtonStyle}" Click="RemoveQuote_Click"/>
<Button Style="{StaticResource AddAppBarButtonStyle}" Click="AddQuote_Click"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource HelpAppBarButtonStyle}"/>
</StackPanel>
</Grid>
</AppBar>
You should take a look at the Flyout Settings sample at:
http://code.msdn.microsoft.com/windowsapps/Settings-Flyout-eceaafea
Or if you are targeting Windows 8.1, flyouts have become much easier, check the MenuFlyout element:
http://msdn.microsoft.com/en-us/library/windows/apps/bg182878.aspx#menuflyout
I would look at the Callisto library on Nuget. It's built by Tim Heuer who's one of the guys working on the xaml team at Microsoft and fills in some of the gaps in the 8.0 control set. It includes a Menu Flyout control that looks not that coincidentally like the controls added in 8.1.
The samples app in the project includes an example of what you're looking for (a Menu Flyout from an App Bar).
Edit: If you're targeting Windows 8.1 with your project then the Menu Flyout control is now built into the platform.
in my window phone 7.1 application(silverlight application, c# language using VS 2010 express for windows phone) i created gridview to show my data(search results) in table format. I created a class and bound that gridview to that class succussfully. this is my xaml code:
<phone:PhoneApplicationPage.Resources>
<local:searchResultItemModel x:Key="searchResultIM"/>
</phone:PhoneApplicationPage.Resources>
<gridView:GridView x:Name="GridView1" CellSpacing="1" RowSpacing="1" SelectedItemChanged="GridViewSelectedItemChanged" Margin="26,16,25,22" ItemsSource="{Binding Source={StaticResource searchResultIM}, Path=Data}">
But i want to add rows dynamically. As this is static i cant able to add rows to it. Is anyother way to add rows dynamically. Could anybody help me please?
You have to use the ListBox Control and template it to your liking. The ListBox also includes bunch of features like UIVitualization that will help with bigger sets of data.
As said you can use the ListBox with a datatemplate to control the look of each row. Example:
<ListBox ItemsSource="{Binding Source={StaticResource searchResultIM}, Path=Data}" ItemTemplate="{StaticResource SearchItemTemplate}" />
Put the above ListBox element inside your LayoutRoot (usually a Grid control) in your Phone page. In the ListBox you will refer to the ItemTemplate to use (defined as DataTemplate) which you define in your resources section, example:
<DataTemplate x:Name="SearchItemTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding YourDataProperty1}" />
<TextBlock Text="{Binding YourDataProperty2}" Grid.Column="1" />
</Grid>
</DataTemplate>
The datacontext for the template will be the type of object you get in your results. So YourDataProperty1 etc could be a property on that resultobject.
Hope it helps!
/Anders
Building a DataGrid Control for Silverlight for Windows Phone
http://www.silverlightshow.net/items/Building-a-DataGrid-Control-for-Silverlight-for-Windows-Phone-Part-1.aspx
This suits the way to create a dynamic table perfectly, The problem in using list box is if the contents goes beyind windows phone, its not easy then to create table using listbox. This grid control has lot of features that would help a newbie like me. Its totally intuitive