using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Tango.Console { /// /// Interaction logic for ConsoleControl.xaml /// public partial class ConsoleControl : UserControl { public ConsoleControl() { InitializeComponent(); MouseDown += ConsoleControl_MouseDown; } public Brush SelectionBrush { get { return (Brush)GetValue(SelectionBrushProperty); } set { SetValue(SelectionBrushProperty, value); } } public static readonly DependencyProperty SelectionBrushProperty = DependencyProperty.Register("SelectionBrush", typeof(Brush), typeof(ConsoleControl), new PropertyMetadata(Brushes.DimGray)); public Brush CaretBrush { get { return (Brush)GetValue(CaretBrushProperty); } set { SetValue(CaretBrushProperty, value); } } public static readonly DependencyProperty CaretBrushProperty = DependencyProperty.Register("CaretBrush", typeof(Brush), typeof(ConsoleControl), new PropertyMetadata(Brushes.White)); public DataTemplate BusyTemplate { get { return (DataTemplate)GetValue(BusyTemplateProperty); } set { SetValue(BusyTemplateProperty, value); } } public static readonly DependencyProperty BusyTemplateProperty = DependencyProperty.Register("BusyTemplate", typeof(DataTemplate), typeof(ConsoleControl), new PropertyMetadata(null)); public Brush SuggestionsBorderBrush { get { return (Brush)GetValue(SuggestionsBorderBrushProperty); } set { SetValue(SuggestionsBorderBrushProperty, value); } } public static readonly DependencyProperty SuggestionsBorderBrushProperty = DependencyProperty.Register("SuggestionsBorderBrush", typeof(Brush), typeof(ConsoleControl), new PropertyMetadata(null)); public Brush SuggestionsBackground { get { return (Brush)GetValue(SuggestionsBackgroundProperty); } set { SetValue(SuggestionsBackgroundProperty, value); } } public static readonly DependencyProperty SuggestionsBackgroundProperty = DependencyProperty.Register("SuggestionsBackground", typeof(Brush), typeof(ConsoleControl), new PropertyMetadata(null)); public Brush SuggestionsForeground { get { return (Brush)GetValue(SuggestionsForegroundProperty); } set { SetValue(SuggestionsForegroundProperty, value); } } public static readonly DependencyProperty SuggestionsForegroundProperty = DependencyProperty.Register("SuggestionsForeground", typeof(Brush), typeof(ConsoleControl), new PropertyMetadata(null)); private void ConsoleControl_MouseDown(object sender, MouseButtonEventArgs e) { Keyboard.Focus(txtCurrentCommand); } private void ScrollViewer_PreviewMouseDown(object sender, MouseButtonEventArgs e) { Keyboard.Focus(txtCurrentCommand); } } }