C# 应用程序的设置屏幕正在引发异常
我试图使用phone 8.1运行时中的设置弹出按钮为应用程序生成设置屏幕。然而,编译器抛出了一个错误,我不知道为什么。这在Phone8.0中可以很好地工作,但在8.1运行时似乎不行C# 应用程序的设置屏幕正在引发异常,c#,xaml,windows-phone-8.1,C#,Xaml,Windows Phone 8.1,我试图使用phone 8.1运行时中的设置弹出按钮为应用程序生成设置屏幕。然而,编译器抛出了一个错误,我不知道为什么。这在Phone8.0中可以很好地工作,但在8.1运行时似乎不行 <SettingsFlyout x:Class="popcornpk.Settings" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
<SettingsFlyout
x:Class="popcornpk.Settings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:popcornpk"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
IconSource="Assets/SmallLogo.png"
Title="CustomSetting" >
<!-- This StackPanel acts as a root panel for vertical layout of the content sections -->
<StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<!-- Toggle switch -->
<StackPanel >
<TextBlock Text="Toggle Switch" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Margin="0,0,0,25" Text="Use toggle switches to let users set Boolean values." Style="{StaticResource BodyTextBlockStyle}"/>
<ToggleSwitch Margin="-6,0,0,0" Header = "Download updates automatically" HorizontalAlignment="Left" HorizontalContentAlignment="Left"/>
<ToggleSwitch Margin="-6,0,0,0" Header = "Install updates automatically" HorizontalAlignment="Stretch"/>
</StackPanel>
<!-- Button -->
<StackPanel >
<TextBlock Text="Push button" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Text="Button label" Style="{StaticResource BodyTextBlockStyle}"/>
<Button Margin="-3,0,0,0" Content="Clear"/>
<TextBlock Margin="0,0,0,25" Text="With a push button, users initiate an immediate action." Style="{StaticResource BodyTextBlockStyle}"/>
</StackPanel>
<!-- ComboBox -->
<StackPanel >
<TextBlock Text="ComboBox" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Margin="0,0,0,25" Text="Use the ComboBox to allow users to select one item from a set of text-only items." Style="{StaticResource BodyTextBlockStyle}"/>
<ComboBox Header="State:" Margin="0,7,0,0" SelectedIndex="0" HorizontalAlignment="Left">
<ComboBoxItem Content="Washington"/>
<ComboBoxItem Content="Oregon"/>
<ComboBoxItem Content="California"/>
</ComboBox>
</StackPanel>
<!-- HyperlinkButton -->
<StackPanel >
<TextBlock Text="Hyperlink" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Margin="0,0,0,25" Text="Use a hyperlink when the associated action will take the user out of this flyout." Style="{StaticResource BodyTextBlockStyle}"/>
<HyperlinkButton Padding="-5,0,0,0" Content="View privacy statement" Tag="http://privacy.microsoft.com" HorizontalAlignment="Left"/>
</StackPanel>
<!-- TextBox -->
<StackPanel >
<TextBlock Text="TextBox" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Margin="0,0,0,25" Text="Use a TextBox to allow users to enter text." Style="{StaticResource BodyTextBlockStyle}"/>
<StackPanel Margin="0,7,0,0" Orientation="Horizontal">
<TextBox HorizontalAlignment="Left" Width="150"/>
<Button Margin="20,0,0,0" Content="Add"/>
</StackPanel>
</StackPanel>
<!-- RadioButton -->
<StackPanel>
<TextBlock Text="Radio button group" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Margin="0,0,0,25" Text="Lets users choose one item from a small set of mutually exclusive, related options." Style="{StaticResource BodyTextBlockStyle}"/>
<TextBlock Text="Video quality" Style="{StaticResource BodyTextBlockStyle}"/>
<RadioButton Margin="0,7,0,0" Content="High"/>
<RadioButton Margin="0,17,0,0" Content="Medium"/>
<RadioButton Margin="0,17,0,0" Content="Low"/>
</StackPanel>
</StackPanel>
严重性代码说明项目文件行
错误CS0263“设置”的部分声明不能指定不同的基类popcornpk C:\Users\david\Documents\visualstudio 2015\81storeliveappsphoneonlyive\popcornpk\popcornpkhub\popcornpk\popcornpk\obj\Debug\Settings.g.i.cs 15
我的基类和其他页面一样
注2
公共部分类设置:第页
我在上面更改了设置,并编译了它,但flyont不工作或弹出,所以它不知道为什么不工作
注2
为了避免混淆,我不想要一个页面的基本页面,我希望能够使用8.0中的设置。显然,微软已经为8.1 UAP规定了这一点。异常告诉您需要知道的一切 看看你的xaml。以下是文件的前两行:
<SettingsFlyout
x:Class="popcornpk.Settings"
除此之外,这肯定会解决错误,您可能无法在电话上使用-如下所示:
小心设置仅支持在Windows 8中与设置span一起使用Lyout。虽然SettingsFlyout类型在Windows Phone项目中可见,但Windows Phone上不存在SettingsFlyout,因此不支持使用SettingsFlyout
试着这样启动XAML:
而不是
。这是一个设置弹出按钮romaz,请查看msdn上的文档,它不是按照msdn的页面开始的。如果您想在代码隐藏中有一个基类页面
,xaml部分必须有相同的基类-as。我不想让页面的基类正确阅读问题,它的asettings弹出按钮我正在尝试在8.1运行时中实现一个页面都没有他们之前我不需要他们做什么,但我发现我需要他们的设置,但仍然没有显示设置弹出按钮!那么这个“弹出”是如何实现的呢?(页面、弹出窗口、其他?)如何调用它?(导航、显示、其他?)您的问题似乎缺少最相关的信息。如果您查看我的笔记,我已经做了此操作并进行了调整,但设置仍然没有显示,必须将其从8.1运行时中删除
public partial class Settings
{
// snip