I have a greed view column:
public class SortableGridViewColumn : GridViewColumn
{
public string SortPropertyName
{
get { return (string)GetValue(SortPropertyNameProperty); }
set { SetValue(SortPropertyNameProperty, value); }
}
public static readonly DependencyProperty SortPropertyNameProperty =
DependencyProperty.Register("SortPropertyName", typeof(string),
typeof(SortableGridViewColumn), new UIPropertyMetadata(""));
}
And a GridViewColumnHeader template
<GridView.ColumnHeaderContainerStyle>
<Style TargetType="GridViewColumnHeader">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
<Border cal:Message.Attach="[Event MouseLeftButtonDown]
= [Action Sort($source.TemplatedParent)]">
<ContentPresenter Margin="2,2,2,2" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style></GridView.ColumnHeaderContainerStyle>
Instead of $source.TemplatedParent
I'd like to somehow pass SortPropertyName as a parameter.
Anyone knows how?
Thanks for any help and sorry if I'm not asking properly - this is my first question here.