private UIElement CreateTextWithIcon(string text, ImageSource icon, object tooltip = null)
{
return dispatcher.Invoke(() =>
{
StackPanel stackPanel = new StackPanel();
stackPanel.Orientation = Orientation.Horizontal;
Grid.SetColumn(stackPanel, NameColumnIndex);
TextBlock textBlock = new TextBlock();
textBlock.Text = text;
Image image = new Image();
image.Width = image.Height = 16;
image.Source = icon;
image.ToolTip = tooltip;
stackPanel.Children.Add(image);
stackPanel.Children.Add(textBlock);
return stackPanel;
});
}