Loading...
Loading...
Compare original and translation side by side
ComboBoxAdvSyncfusion.Windows.Tools.Controls.ComboBoxAdvSyncfusion.Windows.Tools.ControlsSyncfusion.Shared.WPFhttp://schemas.syncfusion.com/wpfComboBoxAdvSyncfusion.Windows.Tools.Controls.ComboBoxAdvSyncfusion.Windows.Tools.ControlsSyncfusion.Shared.WPFhttp://schemas.syncfusion.com/wpf<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<Grid>
<syncfusion:ComboBoxAdv Height="30" Width="200"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<syncfusion:ComboBoxItemAdv Content="Denmark" />
<syncfusion:ComboBoxItemAdv Content="New Zealand" />
<syncfusion:ComboBoxItemAdv Content="Canada" />
<syncfusion:ComboBoxItemAdv Content="Russia" />
<syncfusion:ComboBoxItemAdv Content="Japan" />
</syncfusion:ComboBoxAdv>
</Grid>
</Window><Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<Grid>
<syncfusion:ComboBoxAdv Height="30" Width="200"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<syncfusion:ComboBoxItemAdv Content="Denmark" />
<syncfusion:ComboBoxItemAdv Content="New Zealand" />
<syncfusion:ComboBoxItemAdv Content="Canada" />
<syncfusion:ComboBoxItemAdv Content="Russia" />
<syncfusion:ComboBoxItemAdv Content="Japan" />
</syncfusion:ComboBoxAdv>
</Grid>
</Window>// Model
public class Country
{
public string Name { get; set; }
public string Code { get; set; }
}
// ViewModel
public class ViewModel : INotifyPropertyChanged
{
private ObservableCollection<Country> countries;
public ObservableCollection<Country> Countries
{
get { return countries; }
set { countries = value; OnPropertyChanged(nameof(Countries)); }
}
public ViewModel()
{
Countries = new ObservableCollection<Country>
{
new Country { Name = "Denmark", Code = "DK" },
new Country { Name = "New Zealand", Code = "NZ" },
new Country { Name = "Canada", Code = "CA" }
};
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name) =>
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}<Window.DataContext>
<local:ViewModel />
</Window.DataContext>
<syncfusion:ComboBoxAdv ItemsSource="{Binding Countries}"
DisplayMemberPath="Name"
Height="30" Width="200"/>// 模型
public class Country
{
public string Name { get; set; }
public string Code { get; set; }
}
// ViewModel
public class ViewModel : INotifyPropertyChanged
{
private ObservableCollection<Country> countries;
public ObservableCollection<Country> Countries
{
get { return countries; }
set { countries = value; OnPropertyChanged(nameof(Countries)); }
}
public ViewModel()
{
Countries = new ObservableCollection<Country>
{
new Country { Name = "Denmark", Code = "DK" },
new Country { Name = "New Zealand", Code = "NZ" },
new Country { Name = "Canada", Code = "CA" }
};
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name) =>
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}<Window.DataContext>
<local:ViewModel />
</Window.DataContext>
<syncfusion:ComboBoxAdv ItemsSource="{Binding Countries}"
DisplayMemberPath="Name"
Height="30" Width="200"/><syncfusion:ComboBoxAdv AllowMultiSelect="True"
IsEditable="True"
EnableToken="True"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="Auto" Width="300"/><syncfusion:ComboBoxAdv AllowMultiSelect="True"
IsEditable="True"
EnableToken="True"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="Auto" Width="300"/><syncfusion:ComboBoxAdv IsEditable="True"
AutoCompleteMode="Suggest"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="30" Width="200"/><syncfusion:ComboBoxAdv IsEditable="True"
AutoCompleteMode="Suggest"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="30" Width="200"/><syncfusion:ComboBoxAdv AllowMultiSelect="True"
DefaultText="Select items..."
SelectedValueDelimiter=" | "
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="30" Width="300"/><syncfusion:ComboBoxAdv AllowMultiSelect="True"
DefaultText="Select items..."
SelectedValueDelimiter=" | "
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="30" Width="300"/><syncfusion:ComboBoxAdv AllowMultiSelect="True"
AllowSelectAll="True"
EnableOKCancel="True"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="30" Width="250"/><syncfusion:ComboBoxAdv AllowMultiSelect="True"
AllowSelectAll="True"
EnableOKCancel="True"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
Height="30" Width="250"/>| Property | Type | Description |
|---|---|---|
| bool | Enables multiple item selection |
| bool | Allows text input and editing |
| bool | Displays selected items as tokens (multiselect) |
| AutoCompleModes | Suggest or None for autocomplete |
| string | Watermark text when no item selected |
| string | Separator between selected items |
| IEnumerable | Data collection for binding |
| string | Property path for item display |
| object | Currently selected item |
| ObservableCollection<object> | Collection of selected items (multiselect) |
| int | Index of selected item |
| bool | Shows OK/Cancel buttons in dropdown |
| bool | Adds "Select All" option |
| 属性 | 类型 | 描述 |
|---|---|---|
| bool | 启用多项选择功能 |
| bool | 允许文本输入与编辑 |
| bool | 选中项以令牌形式展示(多选场景) |
| AutoCompleModes | 自动完成模式:Suggest或None |
| string | 未选中项时的水印文本 |
| string | 选中项之间的分隔符 |
| IEnumerable | 用于绑定的数据源集合 |
| string | 项展示的属性路径 |
| object | 当前选中的项 |
| ObservableCollection<object> | 选中项集合(多选场景) |
| int | 选中项的索引 |
| bool | 下拉框中显示确定/取消按钮 |
| bool | 添加"全选"选项 |