Intersoft ClientUI 8 > ClientUI Fundamentals > Panels Overview > Panel Walkthroughs > Walkthrough: Create Wrapping Layout using WrapPanel |
This walkthrough shows you how to create wrapping layout using WrapPanel for wrapping the Image control.
In this walkthrough, you perform the following tasks:
You need the following components to complete this walkthrough:
The first step is to create a new ClientUI Application project using Intersoft ClientUI Application project template in Visual Studio.
This section shows you how to create layout using WrapPanel.
CanMinimize | False |
CanMaximize | False |
CanClose | False |
CanResize | True |
HeaderDisplayMode | Content |
IsClientVisible | True |
IsActive | True |
Header | Hotels |
Width | 700 |
Height | 400 |
XAML |
Copy Code
|
---|---|
<Grid x:Name="LayoutRoot"> <Intersoft:UXWindow CanMinimize="False" CanMaximize="False" CanClose="False" CanResize="True" HeaderDisplayMode="Content" IsClientVisible="True" IsActive="True" Header="Hotels" Width="700" Height="400"> <Intersoft:UXScrollViewer> <Intersoft:WrapPanel> </Intersoft:WrapPanel> </Intersoft:UXScrollViewer> </Intersoft:UXWindow></Grid> |
XAML |
Copy Code
|
---|---|
<Intersoft:WrapPanel> <Intersoft:WrapPanel.Background> <LinearGradientBrush> <GradientStop Color="AliceBlue" Offset="0" /> <GradientStop Color="Black" Offset="1" /> </LinearGradientBrush> </Intersoft:WrapPanel.Background></Intersoft:WrapPanel> |
XAML |
Copy Code
|
---|---|
<Border Margin="10 10 0 0" BorderBrush="Black" BorderThickness="1"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/altira-macau.jpg" Height="150" ToolTipService.ToolTip="Altira macau" /></Border> |
XAML |
Copy Code
|
---|---|
<Intersoft:WrapPanel> <Intersoft:WrapPanel.Background> ... </Intersoft:WrapPanel.Background> <Border Margin="10 10 0 0" BorderBrush="Black" BorderThickness="1"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/altira-macau.jpg" Height="150" ToolTipService.ToolTip="Altira macau" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/amanjiwo-resort.jpg" Height="150" ToolTipService.ToolTip="Amanjiwo resort" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/burj-al-arab.jpg" Height="150" ToolTipService.ToolTip="Burj al arab" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/emirates-palace.jpg" Height="150" ToolTipService.ToolTip="Emirates palace" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/grand-hotel-europe.jpg" Height="150" ToolTipService.ToolTip="Grand hotel Europe" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/le-meurice.jpg" Height="150" ToolTipService.ToolTip="Le meurice" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/mardan-place.jpg" Height="150" ToolTipService.ToolTip="Mardan place" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/palazzo-versace.jpg" Height="150" ToolTipService.ToolTip="Palazzo versace" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/st-regis.jpg" Height="150" ToolTipService.ToolTip="St regis" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/swissotel-berlin.jpg" Height="150" ToolTipService.ToolTip="Swiss hotel berlin" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/thornbury-castle-hotel.jpg" Height="150" ToolTipService.ToolTip="Thornbury castle hotel" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/town-house-galleria.jpg" Height="150" ToolTipService.ToolTip="Town house galleria" /> </Border> </Intersoft:WrapPanel> |
After the application is running in the browser, you can try to resize the window you will see the content will follow the size of the window, such as shown in the following figure.
In this walkthrough, you have learned how to create ClientUI project using project template. You also learned how to create the WrapPanel for layouting.
This section lists the complete code used in this walkthrough.
XAML |
Copy Code
|
---|---|
<Intersoft:UXPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Intersoft="http://intersoft.clientui.com/schemas" x:Class="CreateWrappingLayoutUsingWrapPanel.MainPage" Title="MainPage Page" d:DesignWidth="800" d:DesignHeight="600"> <Grid x:Name="LayoutRoot"> <Intersoft:UXWindow CanMinimize="False" CanMaximize="False" CanClose="False" CanResize="True" HeaderDisplayMode="Content" IsClientVisible="True" IsActive="True" Header="Hotels" Width="700" Height="400"> <Intersoft:UXScrollViewer> <Intersoft:WrapPanel> <Intersoft:WrapPanel.Background> <LinearGradientBrush> <GradientStop Color="AliceBlue" Offset="0" /> <GradientStop Color="Black" Offset="1" /> </LinearGradientBrush> </Intersoft:WrapPanel.Background> <Border Margin="10 10 0 0" BorderBrush="Black" BorderThickness="1"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/altira-macau.jpg" Height="150" ToolTipService.ToolTip="Altira macau" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/amanjiwo-resort.jpg" Height="150" ToolTipService.ToolTip="Amanjiwo resort" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/burj-al-arab.jpg" Height="150" ToolTipService.ToolTip="Burj al arab" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/emirates-palace.jpg" Height="150" ToolTipService.ToolTip="Emirates palace" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/grand-hotel-europe.jpg" Height="150" ToolTipService.ToolTip="Grand hotel Europe" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/le-meurice.jpg" Height="150" ToolTipService.ToolTip="Le meurice" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/mardan-place.jpg" Height="150" ToolTipService.ToolTip="Mardan place" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/palazzo-versace.jpg" Height="150" ToolTipService.ToolTip="Palazzo versace" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/st-regis.jpg" Height="150" ToolTipService.ToolTip="St regis" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/swissotel-berlin.jpg" Height="150" ToolTipService.ToolTip="Swiss hotel berlin" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/thornbury-castle-hotel.jpg" Height="150" ToolTipService.ToolTip="Thornbury castle hotel" /> </Border> <Border Margin="10 10 0 0"> <Border.Effect> <DropShadowEffect /> </Border.Effect> <Image Source="/CreateWrappingLayoutUsingWrapPanel;component/Images/town-house-galleria.jpg" Height="150" ToolTipService.ToolTip="Town house galleria" /> </Border> </Intersoft:WrapPanel> </Intersoft:UXScrollViewer> </Intersoft:UXWindow> </Grid> </Intersoft:UXPage> |