在XAML.Windows手机编程中参考SlideView

时间:2015-08-20 18:39:38

标签: c# xaml windows-phone-8.1

您好我的Windows手机项目有错误。我正在尝试使用SlideView库创建横向菜单,但我的项目无法找到它。

MainPage.xaml中

<Page
x:Class="AppBlankProject.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AppBlankProject"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:slideview="clr-namespace:SlideView.Library;assembly=SlideView.Library"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
    <Grid.ChildrenTransitions>
        <TransitionCollection>
            <EntranceThemeTransition/>
        </TransitionCollection>
    </Grid.ChildrenTransitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!-- Title Panel -->
    <StackPanel Grid.Row="0"
                Margin="0,0,0,470" 
                Grid.RowSpan="2"
                Background="#FE8A01">
        <Image
            Source="Assets/logo.png" 
            Stretch="None" 
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            >
            <Image.RenderTransform>
                <CompositeTransform ScaleX="1" ScaleY="1"/>
            </Image.RenderTransform>
        </Image>
    </StackPanel>
    <Grid Background="LightGray">
        <slideview:SlideView x:Name="sld_view">
            <Grid x:Name="PainelMenu" HorizontalAlignment="Left" Width="400">
                <!-- Composição do menu -->
                </Grid>
                <Grid x:Name="PainelPrincipal" Width="480">
                    <!-- Composição da página -->
                </Grid>
        </slideview:SlideView>
    </Grid>
</Grid>

所以,我收到了这个错误:

Error   1   Unknown type 'SlideView' in XML namespace 'clr-namespace:SlideView.Library;assembly=SlideView.Library'  

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我发现的解决方案是:

我更改了这一行:

xmlns:slideview="clr-namespace:SlideView.Library;assembly=SlideView.Library"

到此:

xmlns:slideview="using : SlideView.Library"