Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - How to pass object to XAML page

 
 
Old 10-23-2006   #1 (permalink)
Lorenzo Soncini


 
 

How to pass object to XAML page

Hi,
I have a WindowsForm with a Frame and I load some page inside the frame.
The XAML of the main form is:
<Window x:Class="Sicop.Contabilita.WindowMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="abilita"
Height="600" Width="800" Initialized="Init">
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Left" VerticalAlignment="Top"
Name="stackPanel1">
</StackPanel>
<Frame Content="" Name="frameWorkPage">
</Frame>
</DockPanel>
</Window>

I loade in the frame some page without problem with this command:
this.frameWorkPage.Navigate(new
System.Uri("ContiCorrenti/PageContiCorrentiMovimenti.Xaml",
UriKind.Relative));
and work fine, but how I can pass a parametrs to the loaded page?

I have tried using the page constructor:

ImpegniAccertamenti.iaPageElenco pageIA = new
Sicop.Contabilita.ImpegniAccertamenti.iaPageElenco(object param);
this.frameWorkPage.Navigate(pageIA);

but don't work.

I have tried witn the Navigation . I have added the event in lhe page
costructor
this.NavigationService.LoadCompleted += new
LoadCompletedEventHandler(NavigationService_LoadCompleted);
And I have created the method:
void NavigationService_LoadCompleted(object sender, NavigationEventArgs e)
{
this._IA = 'I';
}

But I get a null reference exception System.NullReferenceException {"Object
reference not set to an instance of an object."}


Thanks.
Lorenzo Soncini



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Anyone know how to pass by reference to a COM object? PowerShell
Can I pass object along the pipeline to a ps1? PowerShell
Any way(s) to pass an IComparer object instance to ArrayList.sort? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46