-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWhisperWindow.xaml
49 lines (48 loc) · 2.8 KB
/
WhisperWindow.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
<Controls:MetroWindow x:Class="BusinessCats.WhisperWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:BusinessCats"
mc:Ignorable="d"
TitleCaps="False"
WindowTransitionsEnabled="False"
GlowBrush="{DynamicResource AccentColorBrush}"
SnapsToDevicePixels="True"
Title="Whispering" Height="420" Width="360" Icon="Resources/partycats.ico">
<DockPanel>
<Viewbox DockPanel.Dock="Top" Stretch="Uniform" Height="32" MinHeight="32">
<TextBlock x:Name="textBlock" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="18.667" TextAlignment="Center"/>
</Viewbox>
<!--<TextBox x:Name="tbMessage" />-->
<TextBox x:Name="tbMessage" DockPanel.Dock="Bottom" Margin="0, 4, 0, 0"
Controls:TextBoxHelper.Watermark="send a whisper..."
Controls:TextBoxHelper.ButtonContent="8"
Controls:TextBoxHelper.ButtonCommand="{Binding SendMessageCmd, Mode=OneWay }"
Style="{DynamicResource MetroButtonTextBox}">
<TextBox.InputBindings>
<KeyBinding Command="{Binding SendMessageCmd, Mode=OneWay }" Key="Enter" />
</TextBox.InputBindings>
</TextBox>
<ListBox x:Name="lbWhispers" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock x:Name="message" Text="{Binding Path=Text}" TextWrapping="Wrap" ToolTip="{Binding Path=CipherText}"/>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsSelf}" Value="True">
<Setter TargetName="message" Property="TextAlignment" Value="Right"/>
<Setter TargetName="message" Property="Foreground" Value="{DynamicResource GrayBrush2}"/>
<!--<Setter TargetName="message" Property="Background" Value="{DynamicResource GrayBrush10}"/>-->
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Controls:MetroWindow>