我真的很喜欢flex中的SplitViewController并且常见于ipad - 想知道如何在WPF中实现这样的控件?
答案 0 :(得分:1)
您可以使用带有列表控件的stackpanel,其中左侧对齐,您选择的项目的foreach,在右对齐部分显示其文本
此外,还有分割控制。
答案 1 :(得分:0)
如果需要动态填充控件,可以使用列表控件哪个项目模板包含行,如下所示:
<ListView ItemsSource="{Binding Path=Contacts}"
ItemContainerStyle="{StaticResource ContactsListItemContainerStyle}"
Template="{StaticResource ListViewTemplate}">
<ListView.View>
<GridView>
<GridViewColumn Width="350">
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Line Width="100" Visibility="{Binding Converter={StaticResource lineVisibilityConverter}}"/>
<Label Content="{Binding Path=Label}"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
答案 2 :(得分:0)
很抱歉,如果我不清楚,但我需要实际样式的帮助:
<SolidColorBrush x:Key="SolidTea" Color="#FF81857A" />
<SolidColorBrush x:Key="WhiteSolid" Color="White" />
<Style BasedOn="{StaticResource {x:Type ListBox}}"
TargetType="ListBox"
x:Key="PinnedList">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.0" Color="#90DDDD" />
<GradientStop Offset="1.0" Color="#5BFFFF" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Grid>
<Rectangle Height="20" Width="20" Fill="{StaticResource SolidTea}" Margin="0,-10,0,-20" VerticalAlignment="Top" x:Name="ui_recPinnedSPOs" HorizontalAlignment="Left">
<Rectangle.LayoutTransform>
<RotateTransform Angle="-45"/>
</Rectangle.LayoutTransform>
</Rectangle>
<Border Name="Border" Background="{StaticResource WhiteSolid}" BorderBrush="{StaticResource SolidTea}" BorderThickness="4" CornerRadius="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="1" Focusable="false" Padding="{TemplateBinding Padding}">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Grid>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ListBoxItem" x:Key="PinnedListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF9CC164"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#FF9CC164"/>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White" />
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>