English 中文(简体)
自动增加银团
原标题:Silverlight ListBox Height Automatically increase

我正在使用sil光仪表箱控制,并 i。 每个清单箱项目含有另一个清单箱项目。 现在,如果我对我的数据进行控制,就会看到横向的滚动障碍,这不是一个可以消除的问题。 当我向第二个名单箱增加新项目时,其高度自动增加?

第二份名单箱“Height=Auto码头工程”,因为其滚动。

这是可能的。

图十

这里是XAML法典:

   <DataTemplate x:Key="VesselListItem">
    <Border  Height="Auto" HorizontalAlignment="Left" Margin="0"  Name="border1" VerticalAlignment="Top" Width="271" CornerRadius="7" BorderThickness="2">
        <Grid  Name="grid1" Width="Auto">
            <TextBlock Height="23" HorizontalAlignment="Left" Margin="6,1,0,0" Name="textBlock1" Text="BOSPOROTUES PIRATES"  VerticalAlignment="Top" FontWeight="Normal" FontSize="14" Width="197" Foreground="#FFF9DD06" >
                    <TextBlock.Effect>
            <DropShadowEffect ShadowDepth="2" BlurRadius="2" Direction="338"/>
        </TextBlock.Effect>
            </TextBlock>
            <Rectangle Canvas.ZIndex="-1"  Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Margin="0,0,0,0" Name="rectangle1" Stroke="Black" StrokeThickness="2" Width="Auto" RadiusX="7" RadiusY="7" Opacity="0.15" Fill="White" />
            <c1ext:C1Expander Height="Auto" HorizontalAlignment="Left" Margin="6,22,5,10" Name="c1Expander1"  VerticalAlignment="Top" Width="255" IsExpanded="True">
                <Grid HorizontalAlignment="Stretch" Name="grid6" VerticalAlignment="Stretch" ShowGridLines="False" Height="50">
                    <ListBox Height="Auto"  HorizontalAlignment="Stretch" Margin="0" Name="listBox1" VerticalAlignment="Stretch" Width="Auto" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        <ListBoxItem Content="sdfgdsfgdsfg" />
                        <ListBoxItem Content="sdfhsdfhdsfh" />
                        <ListBoxItem Content="sdfhsdfhsdfh" />
                        <ListBoxItem Content="sdfhsdfhsdfh" />
                        <ListBoxItem Content="sdfhdsfhsdfh" />
                        <ListBoxItem Content="sdfhdsfhd" />
                        <ListBoxItem Content="tttttttttt" />
                    </ListBox>
                </Grid>
            </c1ext:C1Expander>
        </Grid>
        <Border.BorderBrush>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="#9FFFFFFF" Offset="0" />
                <GradientStop Color="White" Offset="0.654" />
                <GradientStop Color="#4A408B9D" Offset="0.423" />
                <GradientStop Color="#BA002D76" Offset="1" />
            </LinearGradientBrush>
        </Border.BorderBrush>
    </Border>
</DataTemplate>
问题回答

绘制你名单Box的“MaxHels”财产。 然后,在马克斯·希亚尔达到后,马克斯·维埃克的高度应相应调整,届时将出现滚动。





相关问题
Silverlight Rich text box control

Our team decided that we need our own custom Rich text box control for Silverlight app we are developing. We looked at existing controls mentioned at A good rich text control for Silverlight but ...

Silverlight ImageBrush not rendering (with Bing Map Control)

I m trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can t seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather ...

Silverlight OpenFileDialog DoEvents equivalent

I m processing large files after they are selected by the user. My code looks like the following: if (FileDialog.ShowDialog() == true) { // process really big file } This freezes up the UI so ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Silverlight 3 - FindName returns null

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null. <Grid> <common:CommonGridEditPanel x:...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called dates which is populated by a WCF service. The property is an ...

热门标签