[]
A StaticResource that supports a path specification.
public class C1StaticResource : MarkupExtension
<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.
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.
Name | Description |
---|---|
C1StaticResource() | Initializes a new instance of a C1StaticResource. |
C1StaticResource(string) | Initializes a new instance of a C1StaticResource. |
Name | Description |
---|---|
Key | Key that identifies the resource. |
Path | Expression that defines the data to extract from the resource. |
Name | Description |
---|---|
ProvideValue(IServiceProvider) | Returns an object that is provided as the value of this markup extension. |