using HMI.Base;
using HMI.UI;
using Panuon.WPF.UI;
using Plugin.SeqEditor.Util;
using Plugin.SeqEditor.ViewModel;
using System.Windows;
using System.Windows.Data;
using System.Windows.Input;
namespace Plugin.SeqEditor;
///
/// Interaction logic for UserControl1.xaml
///
public partial class SeqEditor : PluginControl
{
public SeqEditor()
{
InitializeComponent();
CbFilter.ItemsSource = (IEnumerable)
new MultiComboBoxDataConverter().Convert(FilterTypeData.ItemSource,
null,null,null
);
}
public override void InitFinish()
{
this.DataContext = new SeqEditorViewModel(this, log);
}
public void BackgroundAction(Action action, string message)
{
new MaskWindow((WindowX)Window.GetWindow(this),
(win) =>
{
action?.Invoke();
}
).Info(message);
}
///
/// Ê÷Êý¾Ýչʾ¹ýÂË
///
///
///
private void CollectionViewSource_Filter(object sender, FilterEventArgs e)
{
if (e.Item is TreeItemData data)
{
e.Accepted = data.IsVisible;
}
}
//
/// Ê÷Õ¹¿ª/¹Ø±Õʼþ
///
///
///
private void treeDataGrid_ExpandedChange(object sender, bool e)
{
//CollectionViewSource cvs = this.Resources["TreeGridFilter"] as CollectionViewSource;
//cvs?.View.Refresh();
}
private void treeDataGrid_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
e.Handled = false;
}
}