Skip to content

Commit

Permalink
Add auto complete to the chat
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyelton committed Aug 20, 2013
1 parent 7e70870 commit 29b38e5
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 39 deletions.
21 changes: 17 additions & 4 deletions octgnFX/Octgn/Controls/ChatControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
Margin="10,0,0,0"
Foreground="LightGray"
Canvas.ZIndex="1"
Text="/? for user and chat commands"
Text="Type / or @, or just type a message and press enter"
IsHitTestVisible="False"
Visibility="{Binding ShowChatInputHint,ElementName=thisControl,Converter={StaticResource BooleanToVisibilityConverter}}"/>
<TextBox x:Name="ChatInput" Grid.Row="1" TextWrapping="Wrap" VerticalContentAlignment="Center"
Expand All @@ -107,16 +107,29 @@
SpellCheck.IsEnabled="True" Language="en-US"
>
</TextBox>
<ListBox
<ListBox Grid.Row="0" Grid.Column="0"
Height="Auto" Width="Auto"
ItemsSource="{Binding ElementName=thisControl,Path=AutoCompleteCollection}"
Visibility="{Binding ElementName=thisControl,Path=AutoCompleteVisible,Converter={StaticResource BooleanToVisibilityConverter}}"
Canvas.ZIndex="30"
VerticalAlignment="Bottom"
x:Name="AutoCompleteListBox"
MaxHeight="150"
MaxHeight="150"
MouseDoubleClick="AutoCompleteDoubleClick"
>

<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Item}" FontWeight="Bold"/>
<TextBlock Text="{Binding Path=Description}"
Visibility="{Binding Path=HasDescription,Converter={StaticResource BooleanToVisibilityConverter}}"
Margin="10,0,0,0"
FontStyle="Italic"
FontSize="10"
Height="Auto"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid>
<Grid.RowDefinitions>
Expand Down
Loading

0 comments on commit 29b38e5

Please sign in to comment.