2014-11-04 63 views
1

我的工作在Windows Store應用(Windows 8.1中),我使用這樣的搜索框:的XAML相互作用不能在Windows工作10

<SearchBox x:Name="SearchText" QueryText="{Binding QueryText, Mode=TwoWay}"> 
    <i:Interaction.Behaviors> 
     <core:EventTriggerBehavior EventName="QuerySubmitted"> 
      <core:InvokeCommandAction Command="{Binding SearchCommand}" /> 
     </core:EventTriggerBehavior> 
    </i:Interaction.Behaviors> 
</SearchBox> 

這是在Windows 8.1工作正常,但我只是測試Windows 10的預覽版本並發現SearchCommand未觸發。當我在後面的代碼中添加事件處理程序時,QuerySubmitted事件正確觸發,因此看起來綁定不起作用。有沒有人遇到同樣的問題?

+0

我不認爲這一切的XAML互動,因爲我已經發現別人(如Button.Click)的工作。然而,我遇到了與SearchBox.QuerySubmitted相同的問題,甚至試圖只是一個普通的事件連接到代碼隱藏不起作用。 – 2015-08-14 02:46:46

回答

0

試試這個:

<SearchBox> 
       <interactivity:Interaction.Triggers> 
        <interactivity:EventTrigger EventName="QueryChanged"> 
         <interactivity:InvokeCommandAction Command="{Binding TxtSearchCommand}"></interactivity:InvokeCommandAction> 
        </interactivity:EventTrigger> 
       </interactivity:Interaction.Triggers> 

      </SearchBox> 
相關問題