aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Console/ConsoleControl.xaml
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-27 18:25:51 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-27 18:25:51 +0200
commit03970962af1bfbfc5c13109c3f0a465cf9a1dc29 (patch)
tree94d97e7aff1e6c0e95495636540c7fa99f5ef16d /Software/Visual_Studio/Tango.Console/ConsoleControl.xaml
parentcd974051e442dd0420eb14513a57855e69beef86 (diff)
downloadTango-03970962af1bfbfc5c13109c3f0a465cf9a1dc29.tar.gz
Tango-03970962af1bfbfc5c13109c3f0a465cf9a1dc29.zip
Create FSE module project template.
Implemented core PPC console components. Added FSE PPC Console module.
Diffstat (limited to 'Software/Visual_Studio/Tango.Console/ConsoleControl.xaml')
-rw-r--r--Software/Visual_Studio/Tango.Console/ConsoleControl.xaml75
1 files changed, 75 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Console/ConsoleControl.xaml b/Software/Visual_Studio/Tango.Console/ConsoleControl.xaml
new file mode 100644
index 000000000..fba10403a
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Console/ConsoleControl.xaml
@@ -0,0 +1,75 @@
+<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}" Focusable="False" d:DataContext="{d:DesignInstance Type=local:ConsoleControlVM, IsDesignTimeCreatable=False}" Background="Black" Foreground="Silver" x:Name="control">
+
+ <UserControl.Style>
+ <Style TargetType="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>
+ </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>
+ <Run Text="{Binding WorkingFolder}"></Run><Run Text=">"></Run>
+ </TextBlock>
+ <StackPanel Margin="5 0 0 0" Orientation="Horizontal">
+ <TextBox 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 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" Height="Auto" AcceptsReturn="False" TextWrapping="Wrap" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Disabled" Cursor="Arrow" MinWidth="10" Background="Transparent" BorderThickness="0" 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>