12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <Window x:Class="Interface.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:Interface"
- xmlns:prop="clr-namespace:Interface.Properties"
- xmlns:view="clr-namespace:Interface.ViewModels"
- xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- Title="{Binding ApplicationTitle, Mode=TwoWay}" Height="372" Width="850" ResizeMode="CanResize">
- <Window.Resources>
- <CollectionViewSource x:Key="SortedLocations" Source="{Binding LocationList}">
- <CollectionViewSource.SortDescriptions>
- <componentModel:SortDescription Direction="Ascending"/>
- </CollectionViewSource.SortDescriptions>
- </CollectionViewSource>
- </Window.Resources>
- <Grid Margin="0,0,0,2">
- <Button x:Name="ToggleConnectionButton" Content="{Binding ToggleConnectionText}" Margin="10,0,0,10" Command="{Binding ToggleConnection}" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="100"/>
-
- <ComboBox x:Name="ServerListBox" ItemsSource="{Binding ServerList, Mode=TwoWay}" SelectedItem="{Binding SelectedServer, Mode=TwoWay}" Height="25" Margin="0,10,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="125"/>
-
- <ListBox x:Name="LocationListBox" ItemsSource="{Binding Source={StaticResource SortedLocations}}" SelectedItem="{Binding SelectedLocation, Mode=TwoWay}" HorizontalAlignment="Right" Margin="0,40,10,38" Width="125">
- <ListBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="Clear Buffer" Command="{Binding ClearLocation}"></MenuItem>
- <MenuItem Header="Remove" Command="{Binding RemoveLocation}"/>
- </ContextMenu>
- </ListBox.ContextMenu>
- </ListBox>
- <TextBox x:Name="InputBox" Text="{Binding InputBoxText, UpdateSourceTrigger=PropertyChanged}" Margin="115,0,140,10" TextWrapping="NoWrap" AcceptsTab="True" Height="23" VerticalAlignment="Bottom" AcceptsReturn="True">
- <TextBox.InputBindings>
- <KeyBinding Command="{Binding SubmitText}" Key="Enter"/>
- </TextBox.InputBindings>
- </TextBox>
- <Button x:Name="SubmitButton" Content="Submit" Command="{Binding SubmitText}" Margin="0,0,10,10" HorizontalAlignment="Right" Width="125" Height="23" VerticalAlignment="Bottom"/>
-
- <RichTextBox x:Name="BufferWindow" Margin="10,10,140,38" VerticalScrollBarVisibility="Auto" IsReadOnly="True">
- <RichTextBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="Clear Buffer" Command="{Binding ClearLocation}"></MenuItem>
- </ContextMenu>
- </RichTextBox.ContextMenu>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="TextChanged">
- <local:ScrollToBottomAction/>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <FlowDocument>
- <Paragraph>
- <Run Text="{Binding CurrentBuffer, Mode=TwoWay}"/>
- </Paragraph>
- </FlowDocument>
- </RichTextBox>
- </Grid>
- </Window>
|