我ListBox
在 rad 窗格中有两个 es,我希望一个ListBox
用户可以看到一个,另一个用户可以看到两个列表框。
当我制作时ListBox
,隐藏高度没有调整,它有一个空白。
这是代码,请参阅图片。
<telerik:RadPane x:Name="customerfilterPane"
Header="{Binding ApplicationStrings.CustomerPanelTitle, Source={StaticResource ResourceWrapper}}"
CanUserClose="False"
GotFocus="customerfilterPane_GotFocus"
telerik:StyleManager.Theme="Summer">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Border Grid.Row="0" >
<ListBox x:Name="lstCustomers"
ScrollViewer.VerticalScrollBarVisibility="Auto"
VerticalAlignment="Stretch"
VerticalContentAlignment="Stretch"
ItemsSource="{Binding ItemList,
Source={StaticResource CustomerViewModel}}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
>
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox x:Name="chkCustomer"
IsChecked="{Binding IsChecked, Mode=TwoWay}"
Content="{Binding CustomerName}"
Click="chkCustomer_Click" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<Border Grid.Row="1" Margin="4" BorderThickness="3" CornerRadius="2"
Visibility="{Binding IsPanelHiddenToCustomer, Source={StaticResource PlannerViewModel},Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
<StackPanel Orientation="Vertical" Visibility="{Binding IsPanelHiddenToCustomer, Source={StaticResource PlannerViewModel},Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
<TextBlock Text="{Binding ApplicationStrings.PlannerPanelTitle, Source={StaticResource ResourceWrapper}}" />
<ListBox x:Name="lstCustomerPlanner" ScrollViewer.VerticalScrollBarVisibility="Auto"
VerticalAlignment="Stretch" Height="180"
Visibility="{Binding IsPanelHiddenToCustomer, Source={StaticResource PlannerViewModel},Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
VerticalContentAlignment="Stretch"
ItemsSource="{Binding ItemList, Source={StaticResource PlannerViewModel}}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
>
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox x:Name="chkCustomerPlanner"
IsChecked="{Binding IsChecked, Mode=TwoWay}"
Content="{Binding PlannerId}"
Click="chkPlanner_Click" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Border>
<StackPanel Orientation="Horizontal"
FlowDirection="LeftToRight"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Grid.Row="2">
<Button Content="{Binding ApplicationStrings.CheckAll, Source={StaticResource ResourceWrapper}}"
Style="{StaticResource StandardButtonStyle}"
Click="Customer_CheckAll" Margin="0,0,4,0" />
<Button Content="{Binding ApplicationStrings.UncheckAll, Source={StaticResource ResourceWrapper}}"
Margin="0 0 4 0"
Style="{StaticResource StandardButtonStyle}"
Click="Customer_UncheckAll" />
<Button Content="{Binding ApplicationStrings.Apply, Source={StaticResource ResourceWrapper}}"
Margin="0 0 0 0" x:Name="btnCustApply"
Style="{StaticResource StandardButtonStyle}"
Click="Customer_Apply" />
</StackPanel>
</Grid>
</telerik:RadPane>
我会很高兴你能解决这个问题。