Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

How to pass object to XAML page

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-23-2006   #1 (permalink)
Lorenzo Soncini
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I pass object along the pipeline to a ps1? Marco Shaw PowerShell 3 03-08-2007 09:46 PM
Any way(s) to pass an IComparer object instance to ArrayList.sort? Sung M Kim PowerShell 4 11-27-2006 09:23 PM
Re: Hosting a XAML page within a Winform. Jason Avalon 2 02-08-2006 11:32 AM
Hosting a XAML page within a Winform. Jason Avalon 0 02-08-2006 11:32 AM
Hosting a XAML page within a Winform. Jason Avalon 3 02-04-2006 03:37 AM


Vistax64.com 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 2005-2008

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 47 48 49 50 51