protected override async void OnInitialized(EventArgs e) { base.OnInitialized(e); if (WindowUtil.IsDesingMode()) { return; } await Task.Yield(); await _mapNotification.InitCompletion; _locatorBorder = LocatorAndBorder.Instance; _locatorBorder.OnMapRefreshed += OnRefreshed; activatingStatus = ActivatingStatus.Instance; _menuBarsInfo = MenuBarsBaseInfo.Instance; _menuBarsInfo.PropertyChanged += _menuBarsInfo_PropertyChanged; _statusBarInfo = StatusBarBaseInfomation.Instance; _statusBarInfo.PropertyChanged += _statusBarInfo_PropertyChanged; _mouseEventSource.MouseDown.Subscribe(downMouse); _mouseEventSource.MouseDoubleClick.Subscribe(doubleMouse); _mouseEventSource.MouseRightDown.Subscribe(rightMouse); _plottingInfomation = PlottingAreaSettingInfomation.Instance; _plottingInfomation.Locator = _locatorBorder.Locator; _plottingInfomation.PropertyChanged += _listPlottingArea_PropertyChanged; this.Children.Add(_plottingInfomation.Data); InputManager.Current.PreProcessInput += Current_PreProcessInput;//获取键盘输入事件 }
public RadarAreaClient() { InitializeComponent(); string path = System.IO.Directory.GetParent(System.Windows.Forms.Application.LocalUserAppDataPath).FullName; ConfigPath = System.IO.Path.Combine(path, "雷达区域数据库默认配置.xml"); this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; _radarAreas = PlottingAreaSettingInfomation.Instance; _radarsInfo = RadarsSettingInfo.Instance; _plottingAreaList = _radarAreas.Data.PlottingAreas; _radarAreas.PropertyChanged += _radarAreas_PropertyChanged; _radarsInfo.PropertyChanged += radarInfo_PropertyChanged; initListView(); radarAreasListView.ToolTip = "双击修改当前雷达区域名称," + Environment.NewLine + "右键菜单可进行居中显示等操作"; btSave.ToolTip = "将当前所有配置中雷达区域保存" + Environment.NewLine + "已关联雷达的区域上传至雷达服务器," + Environment.NewLine + "未关联区域保存至本地"; }
static PlottingAreaSettingInfomation() { Instance = new PlottingAreaSettingInfomation(); }