New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EventArgs as CommandParameter on InvokeCommandAction #126
Comments
By default, that's exactly what will be passed to the command! Just make sure you don't set the |
Oops! |
No problem! Please do close this issue if this solves the problem! 😄 |
what if I need sender and args? |
@HppZ the |
OK, got you, thanks. |
maybe you can add this feature. |
Hi @pedrolamas , my question is:
|
@manupstairs Binding to Source property of WebView using ElementName |
Thanks @HppZ for you quickly reply. In fact I tried, it can works if I write |
@manupstairs you can just create and pass a custom converter that will take the event args and return the uri from it! Should look something like this: <WebView local:WebViewEx.Uri="{Binding LoginUri, Mode=OneTime}">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="LoadCompleted">
<Core:InvokeCommandAction Command="{Binding LoginCommand}" InputConverter="{StaticResource MyCustomConverter}"/>
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</WebView> |
Very Cool! Thanks Pedrolamas! |
Hi, sorry to reopen this issue. Thanks |
@bromoapp all you need is a class that implements public class MyCustomConverter : Windows.UI.Xaml.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
//implement your conversion operation here
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
//you can leave this one like this as it's not required for this case
throw new NotImplementedException();
}
} |
I want to bind <NavigationView IsSettingsVisible="True">
<i:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="ItemInvoked">
<core:EventTriggerBehavior.Actions>
<core:InvokeCommandAction Command="{Binding MenuNavigated}"
CommandParameter="{Binding <InvokeItem>.Tag}" />
</core:EventTriggerBehavior.Actions>
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
<NavigationView.MenuItems>
<NavigationViewItem Icon="Contact" Content="Contacts" Tag="contacts"/>
</NavigationView.MenuItems>
</NavigationView> How can I achieve that? |
@weitzhandler please don't reply to closed issues with new/different context of the issue itself. As what you wrote is more of a question than an issue, I also recomment that you use StackOverflow, tagging the question with the Having said that, what you want should be possible by just adding a name to the control (like |
@pedrolamas tx for your reply Anyway, I switched from using a command to a |
Hi,
Is it possible to use event arguments as parameter for commands when using InvokeCommandAction?!
Actually I'm using ItemClick event with behaviors on a ListView & ItemClickEventArgs is the only way to know which item clicked.
Maybe It's good to notice for a reason I can't use SelectedItem, because It's null when you set SelectionMode="None" & also that I'm developing UWP app in C#.
Thanks
The text was updated successfully, but these errors were encountered: