Open FoggyFinder opened 5 years ago
To retrieve the data that was passed via command parameter one have to use additional steps.
For example:
<fsxaml:EventToCommand Command="{Binding DataContext.SomeMsg, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" CommandParameter="{Binding SomeProp}" />
<@ vm.SomeMsg @> |> Bind.cmdParam (unbox<obj*bool> >> fst >> string >> Messages.SomeMsg)
because getParameter function looks like:
getParameter
let getParameter (param : obj) = match self.CommandParameter, self.PassEventArgsToCommand with | (null, true) -> self.EventArgsConverter.Convert (param :?> EventArgs) self.EventArgsConverterParameter | param -> param :> obj
maybe it will be better to not include self.PassEventArgsToCommand in the second case? like
self.PassEventArgsToCommand
let getParameter (param : obj) = match self.CommandParameter, self.PassEventArgsToCommand with | (null, true) -> self.EventArgsConverter.Convert (param :?> EventArgs) self.EventArgsConverterParameter | p, _ -> p
Then it will be consist with docs:
The paramter passed to the ICommand. If this is set, the EventArgs are ignored
To retrieve the data that was passed via command parameter one have to use additional steps.
For example:
because
getParameter
function looks like:maybe it will be better to not include
self.PassEventArgsToCommand
in the second case? likeThen it will be consist with docs: