-2
我想重置組合框以清空它, 我有一個示例正確,但另一個是錯誤的。如何在WPF中重置組合框
兩個組合框結合到枚舉列表:
枚舉商標:
公共枚舉IdentificationDeviceBrand:整數 { FMC = 1, DMM = 2, HTC = 3 }
枚舉類型:
public enum IdentificationTypes : int { TerminalEntryGate = 1, TerminalExitGate = 2, LoadingAreaEntryGate = 3, LoadingAreaExitGate = 4, IslandEntryGate = 5, IslandExitGate = 6
}
我製成組合框的復位:
對於Type是OK
XAML組合框品牌:
<ComboBox Name="comboBrand"
Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}"
ItemsSource="{Binding BrandEnum}" SelectedItem="{Binding SelectedBrand, NotifyOnValidationError=True, TargetNullValue=''}"
SelectedValuePath="id" />
請發佈您的XAML標記,並在提問時包含您的問題的可複製樣本:https://stackoverflow.com/help/mcve – mm8