Merge pull request #194 from irihitech/issues/192
Fix Multi ComboBox issues.
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
InnerLeftContent="Left"
|
||||
InnerRightContent="Right"
|
||||
Classes="ClearButton"
|
||||
ItemsSource="{Binding Items}" />
|
||||
ItemsSource="{Binding Items}" >
|
||||
</u:MultiComboBox>
|
||||
<ListBox ItemsSource="{Binding #combo.SelectedItems}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<u:MultiComboBoxSelectedItemList
|
||||
VerticalAlignment="Center"
|
||||
ItemTemplate="{TemplateBinding SelectedItemTemplate}"
|
||||
ItemsSource="{TemplateBinding SelectedItems}"
|
||||
RemoveCommand="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Remove}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
|
||||
@@ -121,11 +121,12 @@
|
||||
Data="{DynamicResource ClosableTagCloseIconGlyph}"
|
||||
DockPanel.Dock="Right"
|
||||
Foreground="{TemplateBinding Foreground}" />
|
||||
<TextBlock
|
||||
<ContentPresenter
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
FontSize="12"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{TemplateBinding Content}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
@@ -79,6 +79,15 @@ public class MultiComboBox: SelectingItemsControl, IInnerContentControl
|
||||
get => GetValue(InnerRightContentProperty);
|
||||
set => SetValue(InnerRightContentProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IDataTemplate?> SelectedItemTemplateProperty = AvaloniaProperty.Register<MultiComboBox, IDataTemplate?>(
|
||||
nameof(SelectedItemTemplate));
|
||||
|
||||
public IDataTemplate? SelectedItemTemplate
|
||||
{
|
||||
get => GetValue(SelectedItemTemplateProperty);
|
||||
set => SetValue(SelectedItemTemplateProperty, value);
|
||||
}
|
||||
|
||||
static MultiComboBox()
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ public class MultiComboBoxItem: ContentControl
|
||||
e.InitialPressMouseButton is MouseButton.Left or MouseButton.Right)
|
||||
{
|
||||
var point = e.GetCurrentPoint(this);
|
||||
if (new Rect(Bounds.Size).ContainsExclusive(point.Position))
|
||||
if (new Rect(Bounds.Size).ContainsExclusive(point.Position) && e.Pointer.Type == PointerType.Touch)
|
||||
{
|
||||
this.IsSelected = !this.IsSelected;
|
||||
e.Handled = true;
|
||||
|
||||
Reference in New Issue
Block a user