Click here to Skip to main content
15,886,137 members
Articles / Desktop Programming / WPF

Wrap Panel Virtualization

Rate me:
Please Sign up or sign in to vote.
4.95/5 (18 votes)
2 Jan 2012CPOL2 min read 53.2K   5.6K   41  
WrapPanel doesn't support virtualization. But we can improve the performance by simulating virtualization.
<Window x:Class="MediaAssistant.Controls.About.AboutWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="About Media Assistant" 
        Height="350" 
        Width="500" 
        WindowStartupLocation="CenterScreen" 
        ResizeMode="NoResize"
        ShowInTaskbar="False" 
        WindowStyle="None" 
        AllowsTransparency="True" 
        Background="Transparent"
        >
    <Window.Resources>
        <ImageBrush x:Key="Close_inact" ImageSource="../../HeaderImages/Close_inact.png" />
        <ImageBrush x:Key="Min_inact" ImageSource="../../HeaderImages/Minimize_inact.png" />
        <ImageBrush x:Key="Max_inact" ImageSource="../../HeaderImages/Maximize_inact.png" />
        <ImageBrush x:Key="Close_act" ImageSource="../../HeaderImages/Close_act.png" />
        <ImageBrush x:Key="Min_act" ImageSource="../../HeaderImages/Minimize_act.png" />
        <ImageBrush x:Key="Max_act" ImageSource="../../HeaderImages/Maximize_act.png" />
        <ImageBrush x:Key="Close_pr" ImageSource="../../HeaderImages/Close_pr.png" />
        <ImageBrush x:Key="Min_pr" ImageSource="../../HeaderImages/Minimize_pr.png" />
        <ImageBrush x:Key="Max_pr" ImageSource="../../HeaderImages/Maximize_pr.png" />
    </Window.Resources>
    <Border BorderThickness="1" BorderBrush="#867B6C" CornerRadius="10,10,0,0" Background="{StaticResource LightBackground}">
        <DockPanel>
            <Grid DockPanel.Dock="Top">
                <Border Background="{StaticResource HeaderGradientBackground}" CornerRadius="10,10,0,0">
                    <Grid>
                        <Rectangle Height="35" Margin="10,0,10,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" MouseDown="move_window" Fill="{StaticResource HeaderGradientBackground}">
                        </Rectangle>
                        <TextBlock Text="About Media Assistant" Foreground="#867B6C" HorizontalAlignment="Center" VerticalAlignment="Center" MouseDown="move_window" />
                    </Grid>
                </Border>
                <Rectangle Margin="8,4,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"
                   Width="56" Height="15" Fill="Transparent"
                   MouseEnter="Activate_Title_Icons" MouseLeave="Deactivate_Title_Icons" />
                <Grid HorizontalAlignment="Right" Margin="10,0,10,0">
                    <Ellipse Margin="50,4,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" 
                 Width="14" Height="15" MouseLeftButtonUp="EXIT" 
                 MouseEnter="Activate_Title_Icons" MouseLeave="Deactivate_Title_Icons" 
                 MouseLeftButtonDown="Close_pressing" Name="Close_btn" 
                 Fill="{DynamicResource Close_inact}" />
                </Grid>
            </Grid>
            <DockPanel DockPanel.Dock="Bottom" Margin="10" LastChildFill="False" >
                <ContentControl DockPanel.Dock="Top" Content="{StaticResource LogoImage}"/>
                <TextBlock DockPanel.Dock="Top" Text="{Binding Version}"/>
                <TextBlock DockPanel.Dock="Top" Margin="0,0,0,10">
                    Home Page <Hyperlink Command="{Binding VisitWebCommand}" CommandParameter="http://mediaassistant.codeplex.com/">http://mediaassistant.codeplex.com/</Hyperlink>
                </TextBlock>
                <TextBlock DockPanel.Dock="Top" Text="Contact: Hasan Shahriar Masud"/>
                <TextBlock DockPanel.Dock="Top">
                    E-Mail: <Hyperlink Command="{Binding ContactCommand}">
                        hsmasud@gmail.com
                    </Hyperlink>
                </TextBlock>
                <Label DockPanel.Dock="Bottom" Margin="0,0,0,10" Content="{Binding Copyright}"/>
            </DockPanel>
        </DockPanel>
    </Border>

</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) KAZ Software Limited
Bangladesh Bangladesh
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions