[英]How can a button inside of a DataTemplate register and listen to a loaded event of the button in the code behind, but can't access the datacontext?
[英]How to access button under DataTemplate via code behind?
我有這個代碼,我需要以某種方式訪問Button
並調用它的Command
。
怎么做?
謝謝!
<DataTemplate>
<Grid>
<Button Command="someexternalcontrol:ContentControl1.RotateCommand" Content="Flip" Visibility="Visible" Height="5" Width="5" />
</Grid>
</DataTemplate>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.