WPF Page Navigation using PageController and CSLA binding

WPF Page Navigation using PageController and CSLA binding

Old forum URL: forums.lhotka.net/forums/t/7768.aspx


tiptop posted on Monday, October 12, 2009

Hello

I had made steady progress last week using CSLA on a prototype that followed the Project Tracker example closely.

However, in our proposed application we are planning to use WPF pages and not windows for page navigation. The problem is that I cannot find a way to convert the EditForm.cs and IRefresh interface for use with a Page form and because I can't do this, i cannot do any of the binding in the XAML.

Has anybody else used Pages instead of windows and how have they done the CSLA binding?

RockfordLhotka replied on Monday, October 12, 2009

You mean the page model with the built-in navigation where the WPF app is 'hosted' in a pseudo-browser?

That model is a real mess, and I really, really hope Microsoft eventually just kills it off (not that they will). It is a mess because whoever designed that model worked very hard to simulate the web - you know, how web browsers and servers can't remember anything between transitions?

To do this, it appears WPF spins up isolated memory for each page, and erases all data as you move to another page. It really sucks, and I never did figure out a reliable way to remember anything from page to page...

In Chris Anderson's 'WPF Unleashed' book he has a whole chapter where he builds a mini-framework to overcome some of the limitations of the page model - but even that wasn't enough to make me successful.

tiptop replied on Monday, October 12, 2009

I am using the PageController object to load pages into a MainForm that has a content frame. Each page is based on a System.Windows.Controls.Page control.

This is loaded into the content frame.

RockfordLhotka replied on Monday, October 12, 2009

Yeah, all I can say is good luck. I spent some time with this model and found it to be incredibly frustrating. Even things like storing values on the thread (which Csla.ApplicationContext does) turned out to be unreliable...

The way I look at UI frameworks is that if I spend 2-3 days fighting with it and even after that time it is making my life harder instead of easier, then that framework must have some serious issues...

That said, maybe you'll have better luck with it. Maybe it is a zen thing, and I just wasn't able to be the UI sufficiently enough to understand what they were trying to do to me (sorry, I mean do for me).

tiptop replied on Wednesday, October 14, 2009

Thanks for the information Rocky.

We are not using a web-based type page navigation but simply using the page controller to load WPF Pages into a content frame.

I have managed to convert the EditForm equivalent usercontrol object into a custom Page object.

We will see how it goes and hopefully won't hit the problems you described as we are using it in a different manner.

Copyright (c) Marimer LLC