index > Windows Presentation Foundation ("Avalon") > PageFunction Template

PageFunction Template

Hello,

I was wondering how I could pass a template into a page function. I don't really need a template I can use plain old C# object (do they call these POCO like POJO=Plain Old Java Object?)

public partial class NameAndDescription : System.Windows.Navigation.PageFunction<WizardSession<WorkgroupWizardData>>

I'm not sure how to x:TypeArguments in the XAML file.

Thanks

Houman

Houman b

create a class say Customer

in the PageFunction(XAML), indicate the TypeArguments

xmlns:loc="clr-namespace:WindowsApplication1"

x:TypeArguments="loc:Customer"

and in the PageFunction.cs when you are about to return to the calling page, do something like this

ReturnEventArgs<Customer> rec = new ReturnEventArgs<Customer>();

rec.Result = new Customer();

rec.Result.Name = "XXX";

rec.Result.City="XXXX";

OnReturn(rec);

lee d

Thanks lee, I can do that part...But imagine if Customer is a template then the x:TypeArguments won't work...at least I don't know how to get it to work.

Not a big deal.

Thanks

Houman

Houman b
I guess you can wrap it in a class and expose it as property
lee d
reply 4

You can use google to search for other answers

 

More Articles

• Moving FrameworkElement using DoubleAnimation in code?
• How to draw a line in a canvas that stretches the entire width.
• Unified way to add and remove child element
• IsDisposed equivalent on WPF
• MultiTrigger that checks Keyboard state?
• Binding the TabItem Content
• How to drag/drop custom control in grid.
• Page.Show() ???
• Repeating controls
• Using an image as a repeating background
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Xaml Help with ResourceDictonary (MenuIt
• Regarding to Report Viewer
• How can I select all content of a textbo
• Line break in textbox
• ICollectionView grouping
• about WindowsFormsHost
• ContextMenu for GridViewColumn
• Creating UserControl and compiling as DLL
• Writing reusable effects in XAML
• Viewport3D BUG ?
• WinFX Runtime Version 3.0.4119.1
• MenuItem ItemsSource
• When will MDI be supported?
• Vista User Experience Guidelines
• Disabling Edits/Selections on FlowDocume

Hot Articles

• Layout Transformation
• starting...
• Applying styles at runtime
• how do i reinstall component MSACM32.dll
• XAML Feeds in XAMLdev.com
• How to Execute a XAML file in Work Flow(
• Creating Custom- / User-Controls - best
• Z-order
• Help me design my .Net 3.0 application?
• Application.GetRemoteStream() break in RC1
• [WPF] Performance problems on Windows Vi
• Persistent Window state
• Offline binding
• Where can i get information about Attrib
• How to assign database/source of ListVie

Recommend Articles

• CheckBox and binding path
• Unable to populate WPF Extender Control
• Sharing ControlTemplate
• animate listbox items to scroll
• RichTextBox, turn off the Keyboard-langu
• Tier 2 GFX-card displayed as Tier 0
• Problem Animating Background in Style fo
• Costumzing/using Costum control in a res
• Binding Expression path error
• Items.SourceCollection is not flushed wh
• No AdornerLayer on a floating window.
• Cost of Binding?
• What's the distinction between "c:&
• ListBox not Displaying Feeds Help Please
• Drawing high number of buttons