CommandBindingCollection 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示 CommandBinding 物件的集合。
public ref class CommandBindingCollection sealed : System::Collections::IList
public sealed class CommandBindingCollection : System.Collections.IList
type CommandBindingCollection = class
interface IList
interface ICollection
interface IEnumerable
type CommandBindingCollection = class
interface ICollection
interface IEnumerable
interface IList
Public NotInheritable Class CommandBindingCollection
Implements IList
- 繼承
-
CommandBindingCollection
- 實作
下列範例會建立 , CommandBinding 並將其新增至 CommandBindingCollection 的 Window。
<Window x:Class="SDKSamples.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="clr-namespace:SDKSamples"
Height="600" Width="800"
>
<Window.CommandBindings>
<CommandBinding Command="{x:Static custom:Window1.CustomRoutedCommand}"
Executed="ExecutedCustomCommand"
CanExecute="CanExecuteCustomCommand" />
</Window.CommandBindings>
CommandBinding customCommandBinding = new CommandBinding(
CustomRoutedCommand, ExecutedCustomCommand, CanExecuteCustomCommand);
// attach CommandBinding to root window
this.CommandBindings.Add(customCommandBinding);
Dim customCommandBinding As New CommandBinding(CustomRoutedCommand, AddressOf ExecutedCustomCommand, AddressOf CanExecuteCustomCommand)
' attach CommandBinding to root window
Me.CommandBindings.Add(customCommandBinding)
衍生自 UIElement 的所有物件都有 CommandBindingCollection 具名
Command |
初始化 CommandBindingCollection 類別的新執行個體。 |
Command |
使用指定之 CommandBindingCollection 中的項目,初始化 IList 類別的新執行個體。 |
Count |
取得這個 CommandBinding 中 CommandBindingCollection 項目的數目。 |
Is |
取得值,指出這個 CommandBindingCollection 是否有固定的大小。 |
Is |
取得值,指出這個 CommandBindingCollection 是否為唯讀。 |
Is |
取得值,指出對這個 CommandBindingCollection 的存取是否已同步處理 (安全執行緒)。 |
Item[Int32] |
取得或設定在指定索引處的 CommandBinding。 |
Sync |
取得可用以同步存取 CommandBindingCollection 的物件。 |
Add(Command |
將指定的 CommandBinding 加入至這個 CommandBindingCollection。 |
Add |
將指定 ICollection 的項目加入至這個 CommandBindingCollection 的結尾。 |
Clear() |
將所有項目從這個 CommandBindingCollection 移除。 |
Contains(Command |
判斷指定的 CommandBinding 是否在這個 CommandBindingCollection 中。 |
Copy |
將 CommandBindingCollection 中的所有項目複製到指定的一維陣列,從目標陣列的指定索引開始。 |
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
Get |
取得可逐一查看這個 CommandBindingCollection 的列舉程式。 |
Get |
做為預設雜湊函式。 (繼承來源 Object) |
Get |
取得目前執行個體的 Type。 (繼承來源 Object) |
Index |
在這個 CommandBinding 中搜尋指定之 CommandBindingCollection 的第一個項目。 |
Insert(Int32, Command |
將指定之 CommandBinding 插入位於指定索引的這個 CommandBindingCollection。 |
Memberwise |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
Remove(Command |
從這個 CommandBinding 移除指定之 CommandBindingCollection 的第一個項目。 |
Remove |
從這個 CommandBinding 的指定索引處移除指定的 CommandBindingCollection。 |
To |
傳回代表目前物件的字串。 (繼承來源 Object) |
ICollection. |
如需這個成員的說明,請參閱 CopyTo(Array, Int32)。 |
IList. |
如需這個成員的說明,請參閱 Add(Object)。 |
IList. |
如需這個成員的說明,請參閱 Contains(Object)。 |
IList. |
如需這個成員的說明,請參閱 IndexOf(Object)。 |
IList. |
如需這個成員的說明,請參閱 Insert(Int32, Object)。 |
IList. |
如需這個成員的說明,請參閱 Item[Int32]。 |
IList. |
如需這個成員的說明,請參閱 Remove(Object)。 |
Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
Of |
根據指定的型別來篩選 IEnumerable 的項目。 |
As |
啟用查詢的平行化作業。 |
As |
將 IEnumerable 轉換成 IQueryable。 |
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |