feat: add selected item template. make sure mouse click works.
This commit is contained in:
@@ -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