Introduction:
Still i am really addicted for 'WrapPanel'.Because WrapPanel is great for laying out things in a vertical or horizontal orientation until you reach the edge of the container and then moving on to the next column or row.But unfortunately i found 'WrapPanal' is no longer supported by windows store apps(i.e Universal Apps).Yestereday i found 'UniversalWrapPanel' is an alternative for 'WrapPanel' layout .And i am heartly says very thanks to @gregstoll for making UniversalWrapPanel.However in this post i am going to explain about UniversalWrapPanel.Building the sample:
- Make sure you’ve downloaded and installed the Windows Phone SDK. For more information, see Get the SDK.
- I assumes that you’re going to test your app on the Windows Phone emulator. If you want to test your app on a phone, you have to take some additional steps. For more info, see Register your Windows Phone device for development.
- This post assumes you’re using Microsoft Visual Studio Express 2013 for Windows.
Description:
Previously in windowsphone 8.0,WrapPanel control is available from Microsoft.Phone.Controls.Toolkit.dll.WrapPanel is a good layout for positioning child elements sequentially from left to right or top to bottom. When elements extend beyond the panel edge, they are positioned in the next row or column.Unfortunately now WrapPanel is not supported by windows store apps.And so we need an alternative for 'WrapPanel' in windows store apps (i.e UniversalWrapPanel).Ok all right lets start to knowing about new control with following steps.
Step 1:
- Open Visual Studio 2013
- Create new project using the "Blank App" template available under Visual C# -> Store Apps -> Windows Phone Apps. (Ex: "WrapPanel8.1")
Install UniversalWrapPanel for Windows Phone 8.1, run the following command in the Package Manager Console
PM> Install-Package UniversalWrapPanel
Step 2:
Open MainPage.xaml and add the namespace in xaml:
- xmlns:UniversalWrapPanel="using:Gregstoll"
Step 3:
Lets Write following xaml code to use UniversalWrapPanel
- <Grid Background="#FF59ABB4">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <TextBlock FontSize="25" Text="Horizontal UniversalWrapPanel:"/>
- <!--Horizontal Panel-->
- <UniversalWrapPanel:UniversalWrapPanel Grid.Row="1" Orientation="Horizontal" Background="#FF34AC21">
- <Button Content="Button1" />
- <Button Content="Button2" />
- <Button Content="Button3" />
- <Button Content="Button4" />
- <Button Content="Button5" />
- </UniversalWrapPanel:UniversalWrapPanel>
- <TextBlock FontSize="25" Grid.Row="2" Text="Vertical UniversalWrapPanel:"/>
- <!--Vertical Panel-->
- <UniversalWrapPanel:UniversalWrapPanel Background="#FFC500FF" Grid.Row="3" Orientation="Vertical">
- <Button Content="Button1" />
- <Button Content="Button2" />
- <Button Content="Button3" />
- <Button Content="Button4" />
- <Button Content="Button5" />
- </UniversalWrapPanel:UniversalWrapPanel>
- </Grid>
ScreenShots:
Summary:
From this article we have learned how to use UniversalWrapPanel in Windows Phone 8.1.And i hope you don't need to source code file from me,because of necessary code is available in this post.
FeedBack Note:
Please share your thoughts,what you think about this post,Is this post really helpful for you?I always welcome if you drop comments on this post and it would be impressive.
Summary:
From this article we have learned how to use UniversalWrapPanel in Windows Phone 8.1.And i hope you don't need to source code file from me,because of necessary code is available in this post.
FeedBack Note:
Follow me always at @Subramanyam_B
Have a nice day by Subramanyam Raju :)
Follow me always at @Subramanyam_B
Have a nice day by Subramanyam Raju :)
The Nuget console does not find it.. Can you send me the DLL?
ReplyDelete