Skip to content

Commit

Permalink
Fix issue( #102
Browse files Browse the repository at this point in the history
  • Loading branch information
yanjinhuagood committed Jul 17, 2024
1 parent c308669 commit 01f6def
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
Expand Down Expand Up @@ -58,7 +59,7 @@ public class MultiSelectionSearchComboBox : Control

public static readonly DependencyProperty SelectAllContentProperty =
DependencyProperty.Register("SelectAllContent", typeof(object), typeof(MultiSelectionSearchComboBox),
new PropertyMetadata("全选"));
new PropertyMetadata(LanguageManager.Instance["SelectAll"]));

public static readonly DependencyProperty IsSelectAllActiveProperty =
DependencyProperty.Register("IsSelectAllActive", typeof(bool), typeof(MultiSelectionSearchComboBox),
Expand Down Expand Up @@ -190,6 +191,7 @@ public event RoutedEventHandler Closed
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
LanguageManager.Instance.PropertyChanged += Instance_PropertyChanged;
selectedList = new List<object>();
selectedSearchList = new List<object>();
selectedItems = new List<object>();
Expand Down Expand Up @@ -232,6 +234,10 @@ public override void OnApplyTemplate()
}
}

private void Instance_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
SelectAllContent = LanguageManager.Instance["SelectAll"];
}

private void _listBoxSearch_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
Expand Down Expand Up @@ -380,8 +386,8 @@ private void _listBoxSearch_SelectionChanged(object sender, SelectionChangedEven
if (e.AddedItems.Count > 0)
{
foreach (var item in e.AddedItems)
if (!selectedSearchList.Contains(item))
selectedSearchList.Add(item);
if (!_listBox.SelectedItems.Contains(item))
_listBox.SelectedItems.Add(item);
Combination();
SelectionChecked(_listBoxSearch);
}
Expand Down

0 comments on commit 01f6def

Please sign in to comment.