|
|
<UserControl
|
|
|
x:Class="DownKyi.Views.UserSpace.ViewChannel"
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
xmlns:prism="http://prismlibrary.com/"
|
|
|
prism:ViewModelLocator.AutoWireViewModel="True">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="*" />
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<ListBox
|
|
|
x:Name="nameChannels"
|
|
|
ItemsSource="{Binding Channels}"
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
SelectedIndex="{Binding SelectedItem}">
|
|
|
<i:Interaction.Triggers>
|
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
|
<i:InvokeCommandAction Command="{Binding ChannelsCommand}" CommandParameter="{Binding ElementName=nameChannels, Path=SelectedItem}" />
|
|
|
</i:EventTrigger>
|
|
|
</i:Interaction.Triggers>
|
|
|
<ListBox.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<WrapPanel IsItemsHost="True" />
|
|
|
</ItemsPanelTemplate>
|
|
|
</ListBox.ItemsPanel>
|
|
|
<ListBox.Style>
|
|
|
<Style TargetType="{x:Type ListBox}">
|
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
|
<Setter Property="Template">
|
|
|
<Setter.Value>
|
|
|
<ControlTemplate TargetType="ListBox">
|
|
|
<Border
|
|
|
x:Name="Bd"
|
|
|
Padding="0"
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
BorderThickness="{TemplateBinding BorderThickness}">
|
|
|
<ScrollViewer Focusable="False">
|
|
|
<ItemsPresenter />
|
|
|
</ScrollViewer>
|
|
|
</Border>
|
|
|
</ControlTemplate>
|
|
|
</Setter.Value>
|
|
|
</Setter>
|
|
|
</Style>
|
|
|
</ListBox.Style>
|
|
|
<ListBox.ItemContainerStyle>
|
|
|
<Style TargetType="{x:Type ListBoxItem}">
|
|
|
<Setter Property="Template">
|
|
|
<Setter.Value>
|
|
|
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
|
|
<StackPanel
|
|
|
Grid.Row="0"
|
|
|
Margin="30,0,30,10"
|
|
|
HorizontalAlignment="Left"
|
|
|
Orientation="Vertical">
|
|
|
<Border
|
|
|
Width="190"
|
|
|
Height="119"
|
|
|
HorizontalAlignment="Center"
|
|
|
CornerRadius="5"
|
|
|
Cursor="Hand">
|
|
|
<Border.Background>
|
|
|
<!-- 长宽比:1.6 -->
|
|
|
<ImageBrush ImageSource="{Binding Cover}" />
|
|
|
</Border.Background>
|
|
|
|
|
|
<Border
|
|
|
Width="70"
|
|
|
HorizontalAlignment="Right"
|
|
|
Background="{DynamicResource BrushBorderTranslucent100}"
|
|
|
CornerRadius="0 5 5 0">
|
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
<TextBlock
|
|
|
FontSize="16"
|
|
|
Foreground="{DynamicResource BrushText}"
|
|
|
Text="{Binding Count}" />
|
|
|
|
|
|
<Image
|
|
|
Height="18"
|
|
|
Margin="0,10,0,0"
|
|
|
Source="/DownKyi;component/Resources/channel.png" />
|
|
|
</StackPanel>
|
|
|
</Border>
|
|
|
</Border>
|
|
|
|
|
|
<TextBlock
|
|
|
MaxWidth="190"
|
|
|
Margin="0,5,0,0"
|
|
|
HorizontalAlignment="Left"
|
|
|
Cursor="Hand"
|
|
|
Tag="{Binding Cid}"
|
|
|
Text="{Binding Name}"
|
|
|
TextTrimming="CharacterEllipsis"
|
|
|
ToolTip="{Binding Name}">
|
|
|
<TextBlock.Style>
|
|
|
<Style TargetType="TextBlock">
|
|
|
<Style.Triggers>
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
<Setter Property="Foreground" Value="{DynamicResource BrushPrimary}" />
|
|
|
</Trigger>
|
|
|
<Trigger Property="IsMouseOver" Value="False">
|
|
|
<Setter Property="Foreground" Value="{DynamicResource BrushTextDark}" />
|
|
|
</Trigger>
|
|
|
</Style.Triggers>
|
|
|
</Style>
|
|
|
</TextBlock.Style>
|
|
|
</TextBlock>
|
|
|
<TextBlock
|
|
|
Name="nameZoneCount"
|
|
|
Margin="0,5,0,0"
|
|
|
HorizontalAlignment="Left"
|
|
|
Foreground="{DynamicResource BrushTextGrey2}"
|
|
|
Text="{Binding Ctime}" />
|
|
|
</StackPanel>
|
|
|
</ControlTemplate>
|
|
|
</Setter.Value>
|
|
|
</Setter>
|
|
|
</Style>
|
|
|
</ListBox.ItemContainerStyle>
|
|
|
</ListBox>
|
|
|
</Grid>
|
|
|
</UserControl>
|