New Posts New Posts RSS Feed: Silverlight Trace Viewer Control Example
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Silverlight Trace Viewer Control Example

 Post Reply Post Reply
skingaby View Drop Down
DevForce MVP
DevForce MVP

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Topic: Silverlight Trace Viewer Control Example
    Posted: 17-Sep-2009 at 7:30pm
The sample TraceViewer from IdeaBlade is in the folder:
C:\Program Files\IdeaBlade DevForce\Learning Resources\110_Deployment\Snippets\Silverlight\TraceWindow

Here is another version of that control that appears as a popup panel within your page. The Popup control has no TitleBar and can't be easily moved, but it does sit on top of other controls, so, for better or worse, here it is:

<UserControl x:Class="Silverlight.Controls.IdeabladeTraceViewer.TraceViewer"
    Width="Auto" Height="Auto"

    <Popup x:Name="TraceViewerPopup"
    <Grid x:Name="LayoutRoot" Margin="20,20,20,20" >

Code behind:
using System;
using System.Collections.ObjectModel;
using System.Windows.Controls;
using IdeaBlade.Core;

namespace Silverlight.Controls.IdeabladeTraceViewer
    public partial class TraceViewer : UserControl
        public TraceViewer()


            TraceViewerPopup.IsOpen = true;

            _messages = new ObservableCollection<TraceMessage>();
            _subscriber = new TraceSubscriber();
            _subscriber.Publish += new EventHandler<PublishEventArgs>(_subscriber_Publish);

            _dataGrid.ItemsSource = _messages;

        private void _subscriber_Publish(object sender, PublishEventArgs e)
            if (_dataGrid.Columns.Count > 0)
               _dataGrid.ScrollIntoView(e.TraceMessage, _dataGrid.Columns[0]);

        TraceSubscriber _subscriber;
        ObservableCollection<TraceMessage> _messages;


And, last but not least, in the View's Constructor to instantiate the popup trace viewer:
var traceViewer = new Silverlight.Controls.IdeabladeTraceViewer.TraceViewer();
If anyone has a simple way to float the viewer so it can be moved around, please post a sample. Thanks!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down