Hi there,
So I created a small app to test the use of custom content states. The app works but then upon further reading I became more confused. MS says you need to call AddBackEntry but nowhere did I do that.
From what I can tell it looks as though when I click the back button windows just knows to call the GetContentState() method which is defined like this
And I guess since it now has the CustomJournalEntry it can then go ahead and call Replay when you click the forward button? I think... Here is the code for my custom journal entry...Code:public System.Windows.Navigation.CustomContentState GetContentState() { return new CustomJournalEntry(FirstNameTextBox.Text, ReplayCallback); }
and the code for my replay method (the delegate)Code:[Serializable()] public class CustomJournalEntry : CustomContentState { string userInfo; public string UserInformation { get { return userInfo; } set { userInfo = value; } } public override string JournalEntryName { get { return "Current User Info: " + userInfo; } } public delegate void ReplayDelegate(CustomJournalEntry c); private ReplayDelegate replayDelegate; public override void Replay(NavigationService navigationService, NavigationMode mode) { this.replayDelegate(this); } public CustomJournalEntry(string userInfoIn, ReplayDelegate replay) { userInfo = userInfoIn; replayDelegate = replay; } }
Anyway - if someone could calrify that would be great - like I said it works - I just ended up confused when I read MS's description of creating custom journal entries...Code:private void ReplayCallback(CustomJournalEntry c) { FirstNameTextBox.Text = c.UserInformation; }
Thanks!




Reply With Quote