VS-2015我遇到错误你是否错过了使用指令或程序集引用?

时间:2016-07-26 09:31:33

标签: c# visual-studio-2015 windows-phone windows-store-apps

当我尝试部署我的应用时,我面临以下错误。

严重级代码描述项目文件行抑制状态 错误CS1061“AboutView”不包含“TermsOfUseTextBlock”的定义,并且没有可以找到接受“AboutView”类型的第一个参数的扩展方法“TermsOfUseTextBlock”(您是否缺少using指令或程序集引用?)学校C:\用户\ lucp2272 \ Downloads \ r2swinphone \ School \ obj \ x86 \ Release \ Views \ AboutView.g.cs 49 Active ..

XAML代码。

<!-- Title Panel -->
    <StackPanel Grid.Row="0" Margin="0,10,0,0" Background="#FF16ACC4">
        <TextBlock Text="Info" HorizontalAlignment="Center" Style="{ThemeResource TitleTextBlockStyle}" Foreground="White"/>
    </StackPanel>
    <Image x:Name="LogoImage" VerticalAlignment="Top" Margin="0,20,0,0" Grid.Row="1" Height="100" Source="../Assets/Logo.png"/>

    <StackPanel Background='#EEEEEE' Grid.Row="2" VerticalAlignment="Center">
        <TextBlock Text="Support" Foreground="#FF16ACC4" FontWeight="Bold" FontSize="18" Margin="15,0,0,0"/>
        <Grid x:Name="emailgrid" Background="#DDDDDD" Height="50" Margin="0,10,0,0" >
            <TextBlock Text="E-mail" Foreground="#FF16ACC4" VerticalAlignment="Center" FontSize="18" Margin="15,0,0,0"/>
            <Image Source="../Assets/fab_right.png" Height="30" Width="30" HorizontalAlignment="Right" Margin="0,0,30,0" IsTapEnabled="True" Tapped="Image_Tapped"/>
        </Grid>

        <TextBlock Text="App" Foreground="#FF16ACC4" FontWeight="Bold" FontSize="18" Margin="15,40,0,0"/>
        <Grid x:Name="collectedgrid" Background="#DDDDDD" Height="50" Margin="0,10,0,0">
            <TextBlock Text="Collected Data" Foreground="#FF16ACC4" VerticalAlignment="Center" FontSize="18" Margin="15,0,0,0"/>
            <Image x:Name="colltedImage" Source="../Assets/fab_right.png" Height="30" Width="30" HorizontalAlignment="Right" Margin="0,0,30,0" IsTapEnabled="True" Tapped="colltedImage_Tapped"/>
        </Grid>
        <Grid x:Name="termsgrid" Background="#DDDDDD" Height="50" Margin="0,10,0,0">
            <TextBlock Text="Terms of use" Foreground="#FF16ACC4" VerticalAlignment="Center" FontSize="18" Margin="15,0,0,0"/>
            <Image x:Name="termsImage" Source="../Assets/fab_right.png" Height="30" Width="30" HorizontalAlignment="Right" Margin="0,0,30,0" IsTapEnabled="True" Tapped="termsImage_Tapped"/>
        </Grid>
        <Grid x:Name="versionrid" Background="#DDDDDD" Height="50" Margin="0,10,0,0">
            <TextBlock Text="Version" Foreground="#FF16ACC4" VerticalAlignment="Center" FontSize="18" Margin="15,0,0,0"/>
            <TextBlock x:Name="versionnumber" Foreground="#FF16ACC4" HorizontalAlignment="Right" Margin="0,0,30,0" VerticalAlignment="Center" FontSize="18"/>
        </Grid>
    </StackPanel>

    <Grid x:Name="logOutrid" Grid.Row="1" Background="#FF16ACC4" Height="50" VerticalAlignment="Bottom">
        <TextBlock Text="Log out" Foreground="White" VerticalAlignment="Center" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" IsTapEnabled="True" Tapped="TextBlock_Tapped"/>
    </Grid>
</Grid>

CS Code。

 public AboutView()
    {
        this.InitializeComponent();
    }

    private void getVersionNumbr()
    {
        var version = Package.Current.Id.Version;
        versionnumber.Text = version+"";
    }

    private async void Image_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
    {
        await Launcher.LaunchUriAsync(
            new Uri(
                " content"
                ));

    }

    private async void termsImage_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
    {
        await Launcher.LaunchUriAsync(new Uri(""));
    }

    private void colltedImage_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
    {
        this.Frame.Navigate(typeof(CollectedDataView));
    }

    private async void TextBlock_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
    {
        var dialog = new MessageDialog("Are you sure that you want to log out?");
        dialog.Title = "Log out";
        dialog.Commands.Add(new UICommand { Label = "Ok", Id = 0 });
        dialog.Commands.Add(new UICommand { Label = "Cancel", Id = 1 });
        var res = await dialog.ShowAsync();

        if ((int)res.Id == 0)
        {
            this.Frame.Navigate(typeof(LoginView));
        }
    }
}

我该如何解决?

0 个答案:

没有答案