0

我有一个应用程序,并在我的 page1 中为我的 Windows Phone 应用程序创建了一个 RichTextBox。UI 在设计框中显示我想要的方式,但是当我尝试运行应用程序时,出现错误“EventHandler 'PhoneApplicationPage_Loaded' not found on class 'PhoneApp1.Page1'”

我根本不明白发生了什么,我想也许我应该在编码cs部分处理richtextbox的实际显示,在该部分我处理按钮单击以进入该页面。当我在网上查看时,我看到的只是如何使用richtextbox,就像我在我的 xaml 文件中所做的那样。任何想法这个错误是什么意思?

这是我的 xaml 和 cs 文件中的代码:

namespace PhoneApp1
{
public partial class Page1 : PhoneApplicationPage
{
    public Page1()
    {
        InitializeComponent();
    }
}
}

而cs对应的xaml是:

  Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <RichTextBox VerticalAlignment="Top">
            <Paragraph>
                <Bold FontSize="32">Great Stuff</Bold>
            </Paragraph>
            <Paragraph>
            Great Stuff
                <LineBreak></LineBreak>
            </Paragraph>
            <Paragraph> 
                <Bold FontSize="32">More Stuff</Bold>
            </Paragraph>
            <Paragraph>
               More Stuff
                <LineBreak></LineBreak>
            </Paragraph>
            <Paragraph>
                <Bold FontSize="32">Some Stuff</Bold>
            </Paragraph>
            <Paragraph>
                Some Stuff
            </Paragraph>
        </RichTextBox>
    </Grid>
4

1 回答 1

0

你的代码没有问题。

search your solution , does a event "PhoneApplicationPage_Loaded" exist?

于 2012-10-22T01:41:14.020 回答