You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 lines
1020 B

using ECMonitor.Page.Name;
using Prism.Regions;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
namespace ECMonitor.Page.SystemSet
{
public partial class Main : UserControl
{
public Main(IRegionManager regionManager)
{
InitializeComponent();
_ = regionManager.RegisterViewWithRegion(RegionsName.SystemSetCenter, typeof(ManageNvr));
InitPage();
}
#region Init
private void InitPage()
{
}
#endregion Init
#region Event
private void ListBoxItem_Selected(object sender, RoutedEventArgs e)
{
ListBoxItem item = (ListBoxItem)sender;
Button button = (Button)item.Content;
//模拟按钮点击
MethodInfo method = button.GetType().GetMethod("OnClick", BindingFlags.NonPublic | BindingFlags.Instance);
_ = (method?.Invoke(button, null));
//模拟按钮点击
//IInvokeProvider invokeProv = new ButtonAutomationPeer(button).GetPattern(PatternInterface.Invoke) as IInvokeProvider;
//invokeProv?.Invoke();
}
#endregion Event
}
}