Skip to content

Vectron/Vectron.Extensions.Logging.TextBlock

Repository files navigation

Vectron.Extensions.Logging.TextBlock

License: MIT Build status NuGet

Vectron.Extensions.Logging.TextBlock provides a WPF TextBlock logger provider implementation for Microsoft.Extensions.Logging.

To mark a TextBlock as the logger target you can use a behavior. In the next example the TextBlock will be used to display the logs.

<Window
    x:Class="LogExample.Wpf.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:textblockLogging="clr-namespace:Vectron.Extensions.Logging.TextBlock;assembly=Vectron.Extensions.Logging.TextBlock"
    Title="Logging example"
    mc:Ignorable="d">
    <DockPanel>
        <ScrollViewer VerticalScrollBarVisibility="Auto" DockPanel.Dock="Bottom">
            <TextBlock
                textblockLogging:TextblockLoggerBehavior.LoggerTarget="True" />
        </ScrollViewer>
    </DockPanel>
</Window>

Authors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages