Windowscommunitytoolkit: prefix extensions is not defined

Created on 30 Sep 2017  路  5Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

The following is the code in the documentation for ViewExtensions

<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ViewExtensionsPage"
      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:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:viewHelper="using:Microsoft.Toolkit.Uwp.UI.Extensions"
      extensions:ApplicationViewExtensions.Title="View Extensions"
      extensions:StatusBarExtensions.BackgroundColor="Blue"
      extensions:StatusBarExtensions.BackgroundOpacity="0.8"
      extensions:StatusBarExtensions.ForegroundColor="White"
      extensions:StatusBarExtensions.IsVisible="True"
      extensions:TitleBarExtensions.BackgroundColor="Blue"
      extensions:TitleBarExtensions.ForegroundColor="White"
      mc:Ignorable="d">

    <Grid Background="{StaticResource Brush-Grey-05}" />
</Page>

extensions is not defined.

The following code works in an app:

    xmlns:viewHelper="using:Microsoft.Toolkit.Uwp.UI.Extensions"
    viewHelper:StatusBar.IsVisible="false"
bug documentation

Most helpful comment

The next version of app should have the fix

All 5 comments

@zipswich I am pretty sure you cannot use the properties and classes in a namespace without defining it first. In you first code snippet, there is no definition of extensions namespace. Please define it and re-build your code.

After the changes, you code should look something like this:

<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ViewExtensionsPage"
      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:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
      extensions:ApplicationViewExtensions.Title="View Extensions"
      extensions:StatusBarExtensions.BackgroundColor="Blue"
      extensions:StatusBarExtensions.BackgroundOpacity="0.8"
      extensions:StatusBarExtensions.ForegroundColor="White"
      extensions:StatusBarExtensions.IsVisible="True"
      extensions:TitleBarExtensions.BackgroundColor="Blue"
      extensions:TitleBarExtensions.ForegroundColor="White"
      mc:Ignorable="d">

    <Grid Background="{StaticResource Brush-Grey-05}" />
</Page>

馃憤

Thanks for the clarification. That is what I thought. Why does the sample code in the documentation differ?
image

@zipswich Yes, the docs are wrong. Need a fix.

Docs have now been fixed by @theweavrs I will close this issue

The next version of app should have the fix

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michael-hawker picture michael-hawker  路  4Comments

karmaecrivain94 picture karmaecrivain94  路  3Comments

jamesmcroft picture jamesmcroft  路  3Comments

Joebeazelman picture Joebeazelman  路  3Comments

nolanblew picture nolanblew  路  3Comments