Results 1 to 2 of 2

Thread: root element is not valid for navigation

  1. #1

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    root element is not valid for navigation

    Good Day i have a Window in WPF defined like this

    Code:
     <Window x:Class="RVI_Education.Gavigator"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="Gavigator" Height="673.2" Width="1304.4">
        <Frame Name="FrameWithinGrid" >
        </Frame>
    </Window>
    and im using it as a start up in my app.xaml

    Code:
     <Application x:Class="RVI_Education.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 StartupUri="Gavigator.xaml">
        <Application.Resources>
             
        </Application.Resources>
    </Application>


    and on Window loaded event i navigate to another Window

    like this

    Code:
        public Gavigator()
            {
                InitializeComponent();
                Loaded += Gavigator_Loaded;
               
            }
    
            void Gavigator_Loaded(object sender, RoutedEventArgs e)
            { 
    
              FrameWithinGrid.Navigate(new System.Uri("Splash.xaml",UriKind.RelativeOrAbsolute));
    
            }
    when i load the Project i get an Error


    'RVI_Education.Splash' root element is not valid for navigation.

  2. #2
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    259

    Re: root element is not valid for navigation

    Is the Splash.Xaml file a window? You should use pages to load into a Frame not a window. It is possible but not recommended.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width