inputbinding

    0熱度

    1回答

    我想通過實現我自己版本的衆所周知的計算器示例來掌握使用MEF框架。用戶界面在WPF中。 構圖之後,Viewmodel擁有一個ObservableCollection(Of IOperation),它由視圖中的'列表框'Buttons表示。每個Button上的文本是作爲Symbol的屬性在IOperation中定義的Char。通過將ListBox的SelectedItem綁定到ViewModel中的

    1熱度

    1回答

    我有Windows窗體窗口與選項卡控件和它的選項卡主機之一ElementHost與ContentControl作爲子元素。此控件具有輸入綁定的集合,這些綁定僅在任何子元素具有輸入焦點時才起作用,但如果焦點丟失,則不再起作用。在這種情況下,可以在更高層次上定義這些輸入綁定嗎?

    1熱度

    1回答

    我想將Button的Keybindings綁定到我的Window的Keybindings。 我的窗口(Name="Mainwindow)輸入綁定: <Window.InputBindings> <KeyBinding Key="Return" Command="{Binding KeyPressed}" CommandParameter="Next"/> </Window.InputB

    19熱度

    4回答

    以下情況。我有一個用五個鍵綁定的用戶控件。當文本框的焦點時,用戶控件的按鍵綁定停止觸發。 有沒有辦法解決這個問題? <UserControl.InputBindings> <KeyBinding Key="PageDown" Modifiers="Control" Command="{Binding NextCommand}"></KeyBinding> <KeyBinding

    0熱度

    1回答

    我與F6工作作爲一種快捷方式,以激活編輯模式,像這樣的意向,InputBinding: <Window.InputBindings> <KeyBinding Gesture="F6" Command="{Binding Path=ActivateEdit}"/> </Window.InputBindings> 按鈕本身看起來是這樣的: <ToggleButton Height="2

    0熱度

    1回答

    我有一個TreeView,定義如下: <TreeView ItemsSource="{Binding Folders, UpdateSourceTrigger=PropertyChanged}" x:Name="tree"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Fold

    3熱度

    1回答

    我有一個非常簡單的應用程序,我嘗試將鍵盤快捷鍵綁定到綁定到菜單項的WPF命令。應用程序本身只包含一個Menu和WebBrowser控件。 當我在WebBrowser之內時,鍵盤快捷鍵不會被路由到WPF菜單。例如,在Web瀏覽器中關注時鍵入「Ctrl + O」會顯示IE打開頁面。此外,在這個應用程序中,除非我的菜單集中(通過鍵入Alt),輸入綁定不會觸發。例如,我不能通過單擊標題欄來關注WPF窗口,

    1熱度

    1回答

    如何在數據網格上左鍵單擊只在選中某行時啓用? 這裏有一個例子: <DataGrid> <DataGrid.InputBindings> <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding LeftClickCommand}"/> </DataGrid.InputBindings> </Dat

    4熱度

    1回答

    我希望在整個應用程序範圍內提供一些鍵盤快捷鍵,而不管當前焦點在哪裏。 目前我在主窗口的XAML中定義了<Window.InputBindings>。 一切都很好,但... 功能區被封裝爲單獨的UserControl,並且所有快捷鍵自然與該功能區中的按鈕相關。 因此,我不太喜歡有2個應用程序邏輯處理相同的功能在2個類中傳播的氣味。 理想情況下,我想將KeyBindings定義爲<Window.Inp

    1熱度

    1回答

    到ItemsControl的我有一個項目控制具有畫布上的項目,當我按下刪除我想刪除從畫布一個項目: <ItemsControl.InputBindings> <KeyBinding Command="{Binding DeleteItemCommand}" Key="Delete"/> </ItemsControl.InputBindings> 然而,在方法DeleteItemCo