Class
NamedDestinationsCollection

Registry of named destinations used as navigation targets across the document for links and actions.

Definition

Namespace:Telerik.Windows.Documents.Fixed.Model.Collections

Assembly:Telerik.Windows.Documents.Fixed.dll

Syntax:

cs-api-definition
public sealed class NamedDestinationsCollection : IEnumerable

Inheritance: objectNamedDestinationsCollection

Implements: IEnumerable

Constructors

NamedDestinationsCollection(IDestinationContainer)

Create a named-destinations registry so links and actions can target pages or views by name.

Declaration

cs-api-definition
public NamedDestinationsCollection(IDestinationContainer parent)

Parameters

parent

IDestinationContainer

The parent.

Properties

Count

Number of named destinations contained in the collection.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

Names

Collection of all destination names in this collection.

Declaration

cs-api-definition
public IEnumerable<string> Names { get; }

Property Value

IEnumerable<string>

this[string]

Get the named destination associated with the specified name.

Declaration

cs-api-definition
public NamedDestination this[string name] { get; }

Parameters

name

string

The name of the named destination to retrieve.

Property Value

NamedDestination

The named destination with the specified name.

Exceptions

KeyNotFoundException

Thrown when no named destination with the specified name exists in the collection.

Methods

Add(string, Destination)

Add a new named destination with the specified name and destination target.

Declaration

cs-api-definition
public NamedDestination Add(string name, Destination destination)

Parameters

name

string

The unique name to assign to the named destination.

destination

Destination

The destination target that defines where to navigate when this named destination is used.

Returns

NamedDestination

The newly created named destination instance.

Exceptions

ArgumentNullException

Thrown when the name or destination parameter is null.

ArgumentException

Thrown when an element with the same name already exists in the collection.

Add(string, GoToAction)

Add a new named destination with the specified name and go-to action.

Declaration

cs-api-definition
public NamedDestination Add(string name, GoToAction goToAction)

Parameters

name

string

The unique name to assign to the named destination.

goToAction

GoToAction

The go-to action that defines the navigation behavior for this named destination.

Returns

NamedDestination

The newly created named destination instance.

Exceptions

ArgumentNullException

Thrown when the name or goToAction parameter is null.

ArgumentException

Thrown when an element with the same name already exists in the collection.

Clear()

Remove all named destinations from the collection.

Declaration

cs-api-definition
public void Clear()

ContainsName(string)

Determine whether a named destination with the specified name exists.

Declaration

cs-api-definition
public bool ContainsName(string name)

Parameters

name

string

The name to search for in the collection.

Returns

bool

True if a named destination with the specified name exists; otherwise, false.

Exceptions

ArgumentNullException

Thrown when the name parameter is null.

GetEnumerator()

Return an enumerator that iterates through the collection of named destinations.

Declaration

cs-api-definition
public IEnumerator<NamedDestination> GetEnumerator()

Returns

IEnumerator<NamedDestination>

An enumerator for the collection.

Remove(string)

Remove the named destination with the specified name and clean up its parent associations.

Declaration

cs-api-definition
public bool Remove(string name)

Parameters

name

string

The name of the named destination to remove.

Returns

bool

True if the named destination was successfully found and removed; otherwise, false.

Exceptions

ArgumentException

Thrown when the name parameter is null.

Rename(string, string)

Change the name of an existing named destination in the collection.

Declaration

cs-api-definition
public void Rename(string oldName, string newName)

Parameters

oldName

string

The current name of the named destination to rename.

newName

string

The new name to assign to the named destination.

TryGetValue(string, out NamedDestination)

Try to retrieve the named destination associated with the specified name.

Declaration

cs-api-definition
public bool TryGetValue(string name, out NamedDestination value)

Parameters

name

string

The name of the destination to retrieve.

value

NamedDestination

When this method returns, contains the named destination associated with the specified name if found; otherwise, null.

Returns

bool

True if a named destination with the specified name was found; otherwise, false.

Exceptions

ArgumentException

Thrown when the name parameter is null.