The Loupe Agent includes a live viewer control that you can easily integrate with your WinForms or WPF application.
Live Log Viewer |
The Live Log Viewer control can be placed anywhere in your application, and you can have multiple viewers at the same time. The Live Log Viewer control is designed to be easy to integrate. Because it is a WinForms control, it requires a WindowsFormsHost element to be hosted directly on a WPF Window. Here is an example of a Window hosting the control:
Alternate Live Viewer Xaml Example |
Copy Code
|
---|---|
<Window x:Class="AgentTest.Wpf.AlternateLiveViewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Live Viewer Control Example" Height="300" Width="726" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" xmlns:gl="clr-namespace:Gibraltar.Agent.Windows;assembly=Gibraltar.Agent"> <Grid> <TabControl Name="mainTabControl"> <TabItem Header="Live Log Viewer" Name="logViewerTab"> <Grid> <my:WindowsFormsHost Name="logViewerInFormsHost"> <gl:LiveLogViewer x:Name="liveLogViewer" Dock="Fill" /> </my:WindowsFormsHost> </Grid> </TabItem> <TabItem Header="Other Content" Name="contentTab"> <Grid /> </TabItem> </TabControl> </Grid> </Window> |
For complete information on how to program with the Live Log Viewer, see LiveLogViewer Class.
To ensure the agent doesn't cause a problem at runtime all GUI capabilities are disabled if the application type isn't determined to be Windows. If you have manually set the application type to another type or it wasn't detected correctly then the Live Viewer will not work.