mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
33 lines
969 B
C#
33 lines
969 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
using Bloxstrap.Integrations;
|
|
using Bloxstrap.UI.ViewModels.ContextMenu;
|
|
|
|
namespace Bloxstrap.UI.Elements.ContextMenu
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for LogTracer.xaml
|
|
/// </summary>
|
|
public partial class LogTracer
|
|
{
|
|
private bool _autoscroll = true;
|
|
|
|
public LogTracer(ActivityWatcher activityWatcher)
|
|
{
|
|
DataContext = new LogTracerViewModel(this, activityWatcher);
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void KeepOnTopMenuItem_Click(object sender, RoutedEventArgs e) => Topmost = ((MenuItem)sender).IsChecked;
|
|
|
|
private void AutoScrollMenuItem_Click(object sender, RoutedEventArgs e) => _autoscroll = ((MenuItem)sender).IsChecked;
|
|
|
|
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
|
{
|
|
if (_autoscroll)
|
|
ScrollViewer.ScrollToEnd();
|
|
}
|
|
}
|
|
}
|