aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Console/ConsoleControl.xaml
blob: 11d5044cd372f5215655f01f8185bf0ad500f74b (plain)
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
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: itali
<UserControl x:Class="Tango.Console.ConsoleControl"
             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:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:local="clr-namespace:Tango.Console"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" FontFamily="Consolas" FontSize="14" FocusVisualStyle="{x:Null}" Focusabl
UserControl"> <Setter Property="local:ConsoleControl.CaretBrush" Value="White"></Setter> <Setter Property="local:ConsoleControl.SelectionBrush" Value="#828282"></Setter> <Setter Property="local:ConsoleControl.BusyTemplate"> <Setter.Value> <DataTemplate> <TextBlock Margin="0 0 5 0" Foreground="Yellow" >...</TextBlock> </DataTemplate> </Setter.Value> </Setter> <Setter Property="local:ConsoleControl.SuggestionsBorderBrush" Value="DimGray"></Setter> <Setter Property="local:ConsoleControl.SuggestionsForeground" Value="Silver"></Setter> <Setter Property="local:ConsoleControl.SuggestionsBackground" Value="#383838"></Setter> </Style> </UserControl.Style> <UserControl.Resources> <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> <local:ConsoleTextBoxMaxWidthConverter x:Key="ConsoleTextBoxMaxWidthConverter" /> </UserControl.Resources> <Grid> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Focusable="False" PreviewMouseDown="ScrollViewer_PreviewMouseDown"> <StackPanel> <ItemsControl ItemsSource="{Binding Commands}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Margin="0 0 0 10"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center"> <Run Text="{Binding WorkingFolder}"></Run><Run Text=">"></Run> </TextBlock> <StackPanel VerticalAlignment="Center" Margin="5 0 0 0" Orientation="Horizontal"> <TextBox Style="{x:Null}" VerticalAlignment="Center" IsReadOnly="True" Cursor="Arrow" AcceptsReturn="True" Background="Transparent" BorderThickness="0" Foreground="{Binding ElementName=control,Path=Foreground}" CaretBrush="{Binding ElementName=control,Path=CaretBrush}" SelectionBrush="{Binding ElementName=control,Path=SelectionBrush}" Text="{Binding CommandText}"></TextBox> </StackPanel> </StackPanel> <TextBox Style="{x:Null}" IsReadOnly="True" Cursor="Arrow" TextWrapping="Wrap" AcceptsReturn="True" Background="Transparent" BorderThickness="0" Foreground="Silver" CaretBrush="White" SelectionBrush="#777777" Text="{Binding Output,Mode=OneWay}"></TextBox> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <StackPanel Orientation="Horizontal"> <TextBlock x:Name="lbWorkingFolder"> <Run Text="{Binding CurrentCommand.WorkingFolder}"></Run><Run Text=">"></Run> </TextBlock> <StackPanel Margin="0 0 0 0" Orientation="Horizontal"> <ContentControl Margin="0 0 5 0" Content="{Binding}" ContentTemplate="{Binding ElementName=control,Path=BusyTemplate}" Visibility="{Binding CurrentCommand.IsExecuting,Converter={StaticResource BooleanToVisibilityConverter}}"/> <local:ConsoleTextBox x:Name="txtCurrentCommand" Suggestions="{Binding Suggestions}" Height="Auto" AcceptsReturn="False" TextWrapping="Wrap" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled" Cursor="Arrow" MinWidth="10" Background="Transparent" BorderThickness="0" SuggestionsBackground="{Binding ElementName=control,Path=SuggestionsBackground}" SuggestionsForeground="{Binding ElementName=control,Path=SuggestionsForeground}" SuggestionsBorderBrush="{Binding ElementName=control,Path=SuggestionsBorderBrush}" Foreground="{Binding ElementName=control,Path=Foreground}" CaretBrush="Transparent" CaretBottomBrush="{Binding ElementName=control,Path=CaretBrush}" SelectionBrush="{Binding ElementName=control,Path=SelectionBrush}" Text="{Binding CurrentCommand.CommandText,UpdateSourceTrigger=PropertyChanged}" IsReadOnly="{Binding CurrentCommand.IsExecuting}"> <local:ConsoleTextBox.MaxWidth> <MultiBinding Converter="{StaticResource ConsoleTextBoxMaxWidthConverter}"> <Binding ElementName="lbWorkingFolder" Path="ActualWidth" /> <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="ActualWidth"></Binding> </MultiBinding> </local:ConsoleTextBox.MaxWidth> <TextBox.InputBindings> <KeyBinding Key="Enter" Command="{Binding ExecuteCommand}" /> <KeyBinding Key="Up" Command="{Binding HistoryUpCommand}" /> <KeyBinding Key="Down" Command="{Binding HistoryDownCommand}" /> </TextBox.InputBindings> </local:ConsoleTextBox> </StackPanel> </StackPanel> </StackPanel> </ScrollViewer> </Grid> </UserControl>