This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathActionMessageView.xaml
41 lines (41 loc) · 2.41 KB
/
ActionMessageView.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
<UserControl x:Class="CloudsdaleWin7.Controls.ActionMessageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mvvm="clr-namespace:CloudsdaleWin7.MVVM" xmlns:local="clr-namespace:CloudsdaleWin7.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" SizeChanged="ActionMessageView_OnSizeChanged">
<UserControl.Resources>
<mvvm:NameColor x:Key="NameColor"/>
<mvvm:TimeOfDayToString x:Key="TimeStamp"/>
<mvvm:DeviceIcon x:Key="MessageDevice"/>
<mvvm:ActionMessagesConverter x:Key="ActionMessages"/>
</UserControl.Resources>
<Grid Margin="5,0,5,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border HorizontalAlignment="Stretch" Height="1" x:Name="Separator"
VerticalAlignment="Top">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Offset="0" Color="#E7E7E7" />
<GradientStop Offset="0.5" Color="LightGray" />
<GradientStop Offset="1" Color="#E7E7E7" />
</LinearGradientBrush>
</Border.Background>
</Border>
<TextBlock Grid.Row="0" FontSize="14" Margin="3" HorizontalAlignment="Center">
<Run Text="{Binding Path=TimeStamp, Converter={StaticResource TimeStamp}, Mode=OneWay}"/>
<Run Text="{Binding Path=Device, Converter={StaticResource MessageDevice}}"/>
</TextBlock>
<local:MessageTextControl Grid.Row="1" FontSize="20" LinebreakHandling="Ignore" Messages="{Binding Path=Messages, Converter={StaticResource ActionMessages}}"
HorizontalAlignment="Stretch" TextAlignment="Center">
<local:MessageTextControl.PrefixInline>
<Run Text="{Binding Path=Name}" DataContext="{Binding Path=Author}" Foreground="{Binding Path=RawUser, Converter={StaticResource NameColor}}" MouseDown="UserInfo" Cursor="Hand"/>
</local:MessageTextControl.PrefixInline>
</local:MessageTextControl>
</Grid>
</UserControl>