[]
        
(Showing Draft Content)

C1.WPF.Binding.C1StaticResource

C1StaticResource Class

A StaticResource that supports a path specification.

Inheritance
C1StaticResource
Namespace: C1.WPF.Binding
Assembly: C1.WPF.Binding.4.6.2.dll
Syntax
public class C1StaticResource : MarkupExtension
Remarks
<p>The <b>C1StaticResource</b> 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.

<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.

Constructors

Name Description
C1StaticResource()

Initializes a new instance of a C1StaticResource.

C1StaticResource(string)

Initializes a new instance of a C1StaticResource.

Properties

Name Description
Key

Key that identifies the resource.

Path

Expression that defines the data to extract from the resource.

Methods

Name Description
ProvideValue(IServiceProvider)

Returns an object that is provided as the value of this markup extension.