-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommentView.xaml
69 lines (68 loc) · 5.54 KB
/
CommentView.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<UserControl
x:Class="Trivial.UI.CommentView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Trivial.UI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="local:CommentView" >
<Setter Property="Foreground" Value="{ThemeResource WinKit.Foreground}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="AvatarWidth" Value="40" />
<Setter Property="AvatarHeight" Value="40" />
<Setter Property="AvatarCornerRadius" Value="20" />
<Setter Property="AvatarBackground" Value="{ThemeResource WinKit.ImageBackground}" />
<Setter Property="AvatarMargin" Value="0" />
<Setter Property="SenderMargin" Value="50,0,0,0" />
<Setter Property="SenderOrientation" Value="Vertical" />
<Setter Property="NicknameForeground" Value="{ThemeResource WinKit.TitleForeground}" />
<Setter Property="NicknameFontSize" Value="14" />
<Setter Property="DescriptionForeground" Value="{ThemeResource WinKit.DescriptionForeground}" />
<Setter Property="DescriptionFontSize" Value="12" />
<Setter Property="ContentMargin" Value="0,45,0,0" />
<Setter Property="ReplyPanelStyle">
<Setter.Value>
<Style TargetType="StackPanel">
<Setter Property="Background" Value="#20808080" />
<Setter Property="Padding" Value="15" />
<Setter Property="Margin" Value="0,8,0,0" />
<Setter Property="BorderBrush" Value="#30808080" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Spacing" Value="20" />
</Style>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid x:DefaultBindMode="OneWay" Background="{x:Bind Background}" BackgroundSizing="{x:Bind BackgroundSizing}" Width="{x:Bind Width}" Height="{x:Bind Height}" Padding="{x:Bind Padding}" BorderBrush="{x:Bind BorderBrush}" BorderThickness="{x:Bind BorderThickness}" CornerRadius="{x:Bind CornerRadius}" >
<Border x:Name="BackgroundPanel" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Border Width="{x:Bind AvatarWidth}" Height="{x:Bind AvatarHeight}" CornerRadius="{x:Bind AvatarCornerRadius}" Margin="{x:Bind AvatarMargin}" Background="{x:Bind AvatarBackground}" BackgroundSizing="{x:Bind AvatarBackgroundSizing}" HorizontalAlignment="Left" VerticalAlignment="Top" >
<Image x:Name="AvatarImage" Stretch="UniformToFill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Image.Source>
<BitmapImage UriSource="{x:Bind AvatarUri}" />
</Image.Source>
</Image>
</Border>
<Border x:Name="SenderCornerPanel" Margin="0" HorizontalAlignment="Right" VerticalAlignment="Top" />
<StackPanel Orientation="{x:Bind SenderOrientation}" Spacing="{x:Bind SenderSpacing}" Margin="{x:Bind SenderMargin}" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
<TextBlock x:Name="NicknameText" Text="{x:Bind Nickname}" Width="{x:Bind NicknameWidth}" Height="{x:Bind NicknameHeight}" Foreground="{x:Bind NicknameForeground}" FontSize="{x:Bind NicknameFontSize}" FontWeight="{x:Bind NicknameFontWeight}" FontStyle="{x:Bind NicknameFontStyle}" FontFamily="{x:Bind FontFamily}" TextWrapping="NoWrap" TextTrimming="{x:Bind SenderTrimming}" HorizontalTextAlignment="{x:Bind HorizontalTextAlignment}" />
<TextBlock x:Name="DescriptionText" Text="{x:Bind Description}" Width="{x:Bind DescriptionWidth}" Height="{x:Bind DescriptionHeight}" Foreground="{x:Bind DescriptionForeground}" FontSize="{x:Bind DescriptionFontSize}" FontWeight="{x:Bind DescriptionFontWeight}" FontStyle="{x:Bind DescriptionFontStyle}" FontFamily="{x:Bind FontFamily}" TextWrapping="NoWrap" TextTrimming="{x:Bind SenderTrimming}" HorizontalTextAlignment="{x:Bind HorizontalTextAlignment}" />
<Border x:Name="SenderAdditionalInfo" ></Border>
</StackPanel>
<StackPanel Margin="{x:Bind ContentMargin}" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
<Border x:Name="BeforeContentPanel" ></Border>
<TextBlock x:Name="ContentText" Text="{x:Bind Text}" Height="{x:Bind ContentHeight}" Foreground="{x:Bind Foreground}" FontSize="{x:Bind FontSize}" FontWeight="{x:Bind FontWeight}" FontStyle="{x:Bind FontStyle}" FontFamily="{x:Bind FontFamily}" TextWrapping="WrapWholeWords" TextTrimming="WordEllipsis" HorizontalTextAlignment="{x:Bind HorizontalTextAlignment}" />
<Border x:Name="ContentPanel" ></Border>
<Border x:Name="AfterContentPanel" ></Border>
<StackPanel x:Name="ReplayPanel" Style="{x:Bind ReplyPanelStyle}" Visibility="{x:Bind ReplyVisibility}" />
</StackPanel>
</Grid>
</UserControl>