Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how to write event to command Programatically

$
0
0

hi all,

      how to write Event to Command programmatically in .CS file.

in xaml file i can write like this..

  <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDoubleClick" >
                    <cmd:EventToCommand Command="{Binding DoubleClickCommand}" 
                                                        PassEventArgsToCommand="True"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>

but i am creating a button through programmatically 

i.e 

Button b=new Button();

how can i assign Event to Command Behaviour for this button which was created through Programmatically



sharathkumar11


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>