LogSearcher.xaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <Window x:Class="PRSServer.LogSearcher"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PRSServer"
  7. mc:Ignorable="d"
  8. Title="Log Searcher" Height="800" Width="1200">
  9. <Window.DataContext><local:logsearcherViewModel x:Name="ViewModel"/></Window.DataContext>
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="Auto"/>
  13. <RowDefinition Height="Auto"/>
  14. <RowDefinition Height="*"/>
  15. </Grid.RowDefinitions>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="3*"/>
  18. <ColumnDefinition Width="4*"/>
  19. <ColumnDefinition Width="Auto"/>
  20. <ColumnDefinition Width="Auto"/>
  21. </Grid.ColumnDefinitions>
  22. <TextBox Grid.Row="0" Grid.Column="0" Padding="2" Text="Keyword" BorderThickness="0" />
  23. <TextBox Grid.Row="0" Grid.Column="5" Padding="2" Text="Lines Before/After" BorderThickness="0" />
  24. <TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="keywordBox" Text="{Binding SearchString}" Padding="2" TextBox.Margin="2" Background="LightYellow"/>
  25. <Button Grid.Row="1" Grid.Column="2" Content="Search" x:Name="searchButton" Command="{Binding SearchCommand}" Padding="2" Button.Margin="2"/>
  26. <TextBox Grid.Row="1" Grid.Column="3" Text="{Binding LineBuffer}" x:Name="LineBuffer" Padding="2" TextBox.Margin="2" Background="LightYellow"/>
  27. <ListBox ItemsSource="{Binding Output}" x:Name="outputBox" Grid.Row="2" Padding="2" ListBox.Margin="2" >
  28. <ListBox.ItemTemplate>
  29. <DataTemplate>
  30. <Grid>
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="Auto"/>
  33. <ColumnDefinition Width="*"/>
  34. </Grid.ColumnDefinitions>
  35. <TextBlock Text="{Binding LineData}" Grid.Column="0" />
  36. <TextBlock Text="{Binding Path=DisplayData}" Grid.Column="1">
  37. <TextBlock.InputBindings>
  38. <MouseBinding Command="{Binding OpenFileCommand}" MouseAction="LeftClick" />
  39. </TextBlock.InputBindings>
  40. </TextBlock>
  41. </Grid>
  42. </DataTemplate>
  43. </ListBox.ItemTemplate>
  44. </ListBox>
  45. <ListBox ItemsSource="{Binding FileInfo}" x:Name="ViewerList" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Padding="2" ListBox.Margin="2" />
  46. </Grid>
  47. </Window>