TileLayoutControl虚拟化

时间:2014-08-05 13:22:11

标签: c# wpf devexpress virtualization tiles

你好我正在写一个WPF应用程序,我有一些动态Tiles(说实话,超过1000),我正在尝试实现虚拟化,但无论我尝试加载这个页面的时间不要下去。如何为此代码实现虚拟化?

<dxlc:TileLayoutControl ScrollBars="None" ItemsSource="{Binding Customers, NotifyOnSourceUpdated=True}" AllowItemMoving="False">
        <dxlc:TileLayoutControl.Resources>
            <Style TargetType="dxlc:Tile">
                <Setter Property="Width" Value="380" />
                <Setter Property="Header" Value="{Binding}" />
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="FontSize" Value="16"/>
                <Setter Property="Background" Value="DarkGray" />
                <Setter Property="Foreground" Value="Black" />
                <Setter Property="dxwuin:Navigation.NavigateTo" Value="CustomerDetailsView" />
                <Setter Property="dxwuin:Navigation.NavigationParameter" Value="{Binding clmnsn}" />
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation="Horizontal">
                                        <Label FontWeight="Bold" FontSize="12" Width="90" HorizontalContentAlignment="Right" VerticalAlignment="Center" Content="AFM:"/>
                                        <TextBlock FontWeight="Normal" FontSize="12" Foreground="Black" VerticalAlignment="Center" Text="{Binding clmnafm}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <Label FontWeight="Bold" FontSize="12" Width="90" HorizontalContentAlignment="Right" VerticalAlignment="Center" Content="Phone I:"/>
                                        <TextBlock FontWeight="Normal" FontSize="12" Foreground="Black" VerticalAlignment="Center" Text="{Binding clmnheadtela}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <Label FontWeight="Bold" FontSize="12" Width="90" HorizontalContentAlignment="Right" VerticalAlignment="Center" Content="Phone II:"/>
                                        <TextBlock FontWeight="Normal" FontSize="12" Foreground="Black" VerticalAlignment="Center" Text="{Binding clmnheadtelb}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <Label FontWeight="Bold" FontSize="12" Width="90" HorizontalContentAlignment="Right" VerticalAlignment="Center" Content="Mobile Phone:"/>
                                        <TextBlock FontWeight="Normal" FontSize="12" Foreground="Black" VerticalAlignment="Center" Text="{Binding clmncellphone}"/>
                                    </StackPanel>
                                </StackPanel>
                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation="Horizontal">
                                        <Label FontWeight="Bold" FontSize="12" Width="90" HorizontalContentAlignment="Right" VerticalAlignment="Center" Content="Address:"/>
                                        <TextBlock FontWeight="Normal" FontSize="12" Foreground="Black" VerticalAlignment="Center" Text="{Binding clmnheadaddr}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <Label FontWeight="Bold" FontSize="12" Width="90" HorizontalContentAlignment="Right" VerticalAlignment="Center" Content="City:"/>
                                        <TextBlock FontWeight="Normal" FontSize="12" Foreground="Black" VerticalAlignment="Center" Text="{Binding clmnheadcity}"/>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </dxlc:TileLayoutControl.Resources>
    </dxlc:TileLayoutControl>

0 个答案:

没有答案