A StaticResource that supports a path specification.

Namespace:  C1.Silverlight.Binding
Assembly:  C1.Silverlight.Binding.5 (in C1.Silverlight.Binding.5.dll)

Syntax

C#
public class C1StaticResource : MarkupExtension
Visual Basic
Public Class C1StaticResource _
	Inherits MarkupExtension

Remarks

The C1StaticResource class is similar to a regular StaticResource markup, but supports a path specification instead of simple objects.

Paths are specified using the same expression syntax used in the C1Binding class. This allows you to use object members as resources.

Examples

The XAML below uses the C1StaticResource class to bind a grid column using a value converter that is implemented in a ViewModel object.
Copy CodeC#
<c1:C1FlexGrid
  ItemsSource="{Binding Source={StaticResource _model}, Path=People}"
  AutoGenerateColumns="False" >
  <c1:C1FlexGrid.Columns>
    <c1:Column 
      Binding="{Binding JobID, 
        Mode=TwoWay, 
        Converter={c1:C1StaticResource Key=_model,Path=JobsConverter}}" />
  </c1:C1FlexGrid.Columns>
</c1:C1FlexGrid>
The XAML snippet above assigns the _model.JobsConverter object to the Converter property of the binding. This cannot be done using a nested binding because the Binding class is not a dependency object.

Inheritance Hierarchy

System..::..Object
  System.Windows.Markup..::..MarkupExtension
    C1.Silverlight.Binding..::..C1StaticResource

See Also