UWP AppBarButton可见性在Page.BottomAppBar上不接受Binding Converter

时间:2016-05-31 23:39:40

标签: c# wpf xaml

我有这个xaml:

<Page
    x:Class="Tablaturas.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tablaturas"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:VM="using:Tablaturas.ViewModels"
    xmlns:res="Tablaturas.Resources.Languaje.resw"
    xmlns:cvt="using:Tablaturas.Code"
    mc:Ignorable="d" Loaded="Page_Loaded">
    <Page.BottomAppBar>
        <CommandBar>
            <AppBarButton Style="{StaticResource HamMenuBtnPhone}" Content="" Command="{Binding  ElementName=MainPageGrid,Path=DataContext.SongsViewModel.AddSongCommand}" Visibility="{Binding SongsListMenu,Converter={StaticResource BoolToVis}}"></AppBarButton>
        </CommandBar>
    </Page.BottomAppBar>
    <Page.Resources>
        <VM:SongsListVM x:Key="ViewModel"/>
        <cvt:boolToVisibilityConverter x:Key="BoolToVis"/>
        <cvt:ObjetToVisibilityConverter x:Key="ObjToVis"/>
        <cvt:NotBoolToVisibilityConverter x:Key="NotBoolToVis"/>
    </Page.Resources>
    <Grid        
        x:Name="MainPageGrid"
        DataContext="{StaticResource ViewModel}"
        Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
   </Grid>
</Page>

这个错误

类型&#39; Windows.UI.Xaml.Markup.XamlParseException&#39;的例外情况发生在Tablaturas.exe但未在用户代码中处理。 WinRT信息:无法找到名称/密钥BoolToVis的资源 [行:14位置:177]。其他信息:找不到与此错误代码关联的文本。

为什么资源被定义为页面资源无法在AppBar实例化 哪里必须申报资源?要么 我该怎么做才能引用它?

0 个答案:

没有答案
相关问题