C#C
C#3y ago
Indeed

❔ WPF multiple data contexts

Hi!
In my wpf app i need to have view-specific commands but i am already using my separate ViewModel (MVVM) as a data context? How can I achieve it wanting a button do something view-specific but also something on the model?

<Button>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
            <i:InvokeCommandAction Command="{Binding ViewModelCommand}" />
            <i:InvokeCommandAction Command="{Binding ViewCommand}" /> //
        </i:EventTrigger>
    </i:Interaction.Triggers>
</Button>
Was this page helpful?