Skip to content

XamlExtensionMethods

mbrit edited this page Sep 17, 2012 · 1 revision

You can use the GetLogger extension method which is available on UserControl, and hence is also available on Page.

public sealed partial class LogSamplePage : Win8Sample.Common.LayoutAwarePage
{
    private ILogger Log { get; set; }

    public LogSamplePage()
    {
        this.InitializeComponent();

        // you can initialize using the extension methods...
        this.Log = this.GetLogger();
    }

    // ...

}

You could also the Log property as a protected property on the LayoutAwarePage class.

Clone this wiki locally