ComponentOne Binding Expressions for WPF and Silverlight
C1.Silverlight.Binding Namespace / C1StaticResource Class
Members Example

In This Topic
    C1StaticResource Class
    In This Topic
    A StaticResource that supports a path specification.
    Object Model
    C1StaticResource Class
    Syntax
    'Declaration
     
    
    Public Class C1StaticResource 
       Inherits System.Windows.Markup.MarkupExtension
    public class C1StaticResource : System.Windows.Markup.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.

    Example
    The XAML below uses the C1StaticResource class to bind a grid column using a value converter that is implemented in a ViewModel object. 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.
    <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>
    Inheritance Hierarchy

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

    See Also