Skip to content

Instantly share code, notes, and snippets.

[NamedPartMetadata("CommandHistoryWindow"), Export(typeof(IDbgToolWindow))]
public class CommandHistoryWindow : IDbgToolWindow
public Control GetToolWindowView(object parameter)
{
return new HistoryControl { DataContext = this };
}
<ui:ToolWindowView
x:Class="WinDbgExt.History.HistoryControl"
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:ui="clr-namespace:DbgX.Interfaces.UI;assembly=DbgX.Interfaces"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
ui:ToolWindowView.TabTitle="History"
mc:Ignorable="d"
using System;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition;
using System.Text;
using System.Windows.Controls;
using DbgX.Interfaces;
using DbgX.Interfaces.Listeners;
using DbgX.Interfaces.Services;
namespace WinDbgExt.History
<ui:ToolWindowView
x:Class="WinDbgExt.History.HistoryControl"
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:ui="clr-namespace:DbgX.Interfaces.UI;assembly=DbgX.Interfaces"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
ui:ToolWindowView.TabTitle="History"
mc:Ignorable="d"
[Import]
private IDbgToolWindowManager _toolWindowManager;
public CommandHistoryWindow()
{
History = new ObservableCollection<Tuple<string, string>>();
OpenCommand = new DelegateCommand<string>(Open);
}
public DelegateCommand<string> OpenCommand { get; }
<ListBox x:Name="HistoryList" ItemsSource="{Binding Path=History}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding Path=OpenCommand}" CommandParameter="{Binding Path=SelectedItem.Item2, ElementName=HistoryList}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Item1}" />
</DataTemplate>
using System.ComponentModel.Composition;
using System.Windows.Controls;
using DbgX.Interfaces;
using DbgX.Interfaces.Services;
namespace WinDbgExt.History
{
[NamedPartMetadata("CommandWindow"), Export(typeof(IDbgToolWindow))]
public class CommandWindow : IDbgToolWindow
{
<UserControl x:Class="WinDbgExt.History.CommandControl"
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"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
private void AppendDmlOutput(string content)
{
var paragraph = new Paragraph();
ContentTextBox.Document.Blocks.Add(paragraph);