WPF EventToCommand

@果酱  November 18, 2024
<Window ...
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform"
        ...>
...
    <TabControl>
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="SelectionChanged">
                <cmd:EventToCommand Command="{Binding TabSelectionChangedCommand}"
                                    PassEventArgsToCommand="True" />
            </i:EventTrigger>
        </i:Interaction.Triggers>

        <TabItem>...</TabItem>
        <TabItem>...</TabItem>
    </TabControl>
...
</Window>

---ref---
Use a Command with TabItem


添加新评论

  1. 哈哈哈,写的太好了https://www.lawjida.com/

    Reply
  2. 文章中的实用建议和操作指南,让读者受益匪浅,值得珍藏。

    Reply
  3. 文章紧扣主题,观点鲜明,展现出深刻的思考维度。

    Reply
  4. 多语种文献的引用彰显学术包容性。

    Reply
  5. 主题紧扣时代脉搏,具有现实意义。

    Reply
  6. 论点鲜明,论据链环环相扣,论证有力。

    Reply
  7. 文章中的实用建议和操作指南,让读者受益匪浅,值得珍藏。

    Reply
  8. 内容的丰富性和深度让人仿佛置身于知识的海洋,受益匪浅。

    Reply