1

我一直在使用 Silverlight 小工具,但是当我创建新页面时,我无法导航到新页面;导航不存在。

代码

public partial class Test
{
    public Test()
    {
        MessageBox.Show("af");
        InitializeComponent();
    }

    // Executes when the user navigates to this page.
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
    }

    private void button1_Click(object sender, RoutedEventArgs e)
    {

    }
}

和 xaml 代码是

<navigation:Page x:Class="SilverlightGadgetDocked.Test" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="359" d:DesignHeight="225"
           Title="Test Page">
    <Grid x:Name="LayoutRoot">
        <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="182,103,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
    </Grid>
</navigation:Page>
4

0 回答 0