2012-07-02 60 views
2

我有使用模板選擇一個選項卡式控制,正確的模板被選擇包含web瀏覽器組件,使用鍵盤(向上/向下箭頭)的應用程序的其餘部分之間的KeyBoardFocus toggels時和網頁。「鬼」 ContentControl中偷焦點

使用snoop我可以通過將包含ContentControl的Focusable屬性設置爲false來獲得WebBrowser控件的行爲,但是我找不到以何種方式/如何以編程方式設置ContentControl屬性!

從窺探一個片段:

 

    PART_SelectedContentHost is from the Theme (Focusable == False) 
    ContentControl (Focusable == **True**) [Where does this come from? It's "Content" is a ViewModel] 
    ContentPresenter (Focusable == False) [Where does this come from?] 
    WebPageView (My created component, Focusable == False) 
    ... (Focusable == False) 
    wbContent (Focusable == True) 

我在PART_SelectedContentHost的ContentPresenter,但沒有運氣使用有針對性的樣式資源嘗試。

任何任何想法?

謝謝

回答

1

嘗試派生自選項卡控件。重寫OnApplyTemplate方法,並找到名稱ContentControl中。一旦發現改變其財產。

相關問題