Closed daawaan4U closed 4 years ago
I mean yeah, I'm referring to the Actions from this framework. It's just that the examples are done in xaml. Does the framework provide a way to do it in code?
I'm binding the Command property above in a style for an ItemsControl inside a CustomControl.
. . .
<Style TargetType="{x:Type ItemsControl}">
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<local:Item Command="{Binding Command}" Icon="{Binding Icon}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
. . .
Since the {s:Action MethodName}
doesn't work in Styles, I'm finding a way if Stylet's action can work in code-behind. Something similar to my first comment.
Ah right. You'll have to write your own ICommand implementation. They're pretty straightforward.
On 24 April 2020 03:25:06 BST, DaaWaan notifications@github.com wrote:
I'm binding the Command property above in a style for an ItemsControl inside a CustomControl.
. . .
. . .
Since the
{s:Action MethodName}
doesn't work in Styles, I'm finding a way if Stylet's action can work in code-behind. Something similar to my first comment.-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/canton7/Stylet/issues/124#issuecomment-618766081
I have a ViewModel that has an
ICommand
property and would like to initialize the binding of that command property to a method using Actions in the ViewModel.Something like: