Export (0) Print
Expand All

JournalEntry Class

Represents an entry in either back or forward navigation history.

Namespace:  System.Windows.Navigation
Assembly:  PresentationFramework (in PresentationFramework.dll)

'Declaration
<SerializableAttribute> _
Public Class JournalEntry _
	Inherits DependencyObject _
	Implements ISerializable

The JournalEntry type exposes the following members.

  NameDescription
Protected methodJournalEntryInfrastructure. Initializes a new instance of the JournalEntry class.
Top

  NameDescription
Public propertyCustomContentStateGets or sets the CustomContentState object that is associated with this journal entry.
Public propertyDependencyObjectTypeGets the DependencyObjectType that wraps the CLR type of this instance.  (Inherited from DependencyObject.)
Public propertyDispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public propertyIsSealedGets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.)
Public propertyNameGets or sets the name of the journal entry.
Public propertySourceGets or sets the URI of the content that was navigated to.
Top

  NameDescription
Public attached propertyKeepAliveGets or sets a value that indicates whether the content of a journal entry is either retained or re-created when navigated to in navigation history.
Top

  NameDescription
Public methodCheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public methodClearValue(DependencyProperty)Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)
Public methodClearValue(DependencyPropertyKey)Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)
Public methodCoerceValueCoerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Inherited from DependencyObject.)
Public methodEqualsDetermines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeGets a hash code for this DependencyObject. (Inherited from DependencyObject.)
Public methodStatic memberGetKeepAliveReturns the KeepAlive attached property of the journal entry for the specified element.
Public methodGetLocalValueEnumeratorCreates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)
Public methodStatic memberGetNameGets the Name attached property of the journal entry for the specified element.
Public methodGetObjectDataCalled when this object is serialized.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.)
Public methodInvalidatePropertyRe-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnPropertyChangedInvoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data. (Inherited from DependencyObject.)
Public methodReadLocalValueReturns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Public methodSetCurrentValueSets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Public methodStatic memberSetKeepAliveSets the KeepAlive attached property of the specified element.
Public methodStatic memberSetNameSets the Name attached property of the specified element.
Public methodSetValue(DependencyProperty, Object)Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Public methodSetValue(DependencyPropertyKey, Object)Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)
Protected methodShouldSerializePropertyReturns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (Inherited from DependencyObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodVerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top

  NameDescription
Public fieldStatic memberKeepAlivePropertyIdentifies the KeepAlive attached property.
Public fieldStatic memberNamePropertyIdentifies the Name attached property.
Top

Windows Presentation Foundation (WPF) implements a navigation history service that stores one entry for each piece of content that has been previously navigated to, just like navigation history in Microsoft Internet Explorer. Navigation history comprises two stacks, one that remembers back navigation history, and one that remembers forward navigation history.

An entry for the current item is added to back navigation history when a forward navigation occurs. This occurs in the following situations:

Likewise, an entry for the current item is added to forward navigation history before a back navigation occurs, which happens when:

Each entry in back and forward navigation history is an instance of the JournalEntry class.

Each JournalEntry object encapsulates information about a particular navigation, including a name for the entry (Name), whether the entry is kept alive (KeepAlive) and the uniform resource identifier (URI) for the content that is navigated to (Source).

You can retrieve all the JournalEntry objects in back navigation history by enumerating the NavigationWindow.BackStack or Frame.BackStack properties. For forward navigation history, you can retrieve all the JournalEntry objects by enumerating the NavigationWindow.ForwardStack or Frame.ForwardStack properties.

If you need to remove the most recent JournalEntry object from back navigation history, to prevent navigation to it, for example, you can call the RemoveBackEntry method (NavigationService.RemoveBackEntry, NavigationWindow.RemoveBackEntry, Frame.RemoveBackEntry), which removes the JournalEntry object and returns a reference to it.

You cannot add JournalEntry objects to navigation history, however, because you can neither instantiate nor derive from JournalEntry, and because no type implements a member to do so. However, you can add custom CustomContentState objects to back navigation history by calling the AddBackEntry method (AddBackEntry, AddBackEntry, AddBackEntry); NavigationService adds the CustomContentState object to an internally-created JournalEntry object, which is then added to the back navigation history.

The following example shows how to retrieve the most recent JournalEntry object from the back navigation stack to get the Name and Source property values.

Private Sub removeJournalEntryButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' If there are journal entries on the back navigation stack
    If Me.NavigationService.CanGoBack Then
        ' Remove and get the most recent entry on the back navigation stack
        Dim journalEntry As JournalEntry = Me.NavigationService.RemoveBackEntry()

        Dim name As String = journalEntry.Name
        Dim uri As String = journalEntry.Source.OriginalString
        MessageBox.Show(name & " [" & uri & "] removed from back navigation.")
    End If
End Sub

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft