Ejemplo n.º 1
0
        protected override async void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            if (WindowUtil.IsDesingMode())
            {
                return;
            }
            await System.Threading.Tasks.Task.Yield();

            await _mapNotification.InitCompletion;

            _locator = LocatorAndBorder.Instance;
            _radars  = new RadarsCanvas(_locator);
            this.AddChild(_radars);
            _locator.OnMapRefreshed += _locator_OnMapRefreshed;
            _mouseEventSource.MouseDown.Subscribe(onMouseDown);

            activatingStatus              = ActivatingStatus.Instance;
            _menuBarInfo                  = MenuBarsBaseInfo.Instance;
            _menuBarInfo.PropertyChanged += _menuBarInfo_PropertyChanged;
            _winformWindow                = (System.Windows.Interop.HwndSource.FromDependencyObject(this) as System.Windows.Interop.HwndSource);
            _radars.InitHwndSourse(_winformWindow);
            _locator_OnMapRefreshed();
        }
Ejemplo n.º 2
0
        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;//获取键盘输入事件
        }
Ejemplo n.º 3
0
        void SeaMap_Loaded(object sender, RoutedEventArgs e)
        {
            if (WindowUtil.IsDesingMode())
            {
                return;
            }

            if (this.RenderSize.Width == 0 || this.RenderSize.Height == 0)
            {
                return;
            }

            this.Focus();
            if (_render.InitCompletion.IsCompleted)
            {
                return;
            }
            var defaultData = DefaultConfigInfo.Instance.Default;

            Locator.Locate(defaultData.Scale, new MapPoint(defaultData.Lon, defaultData.Lat));

            _locatorAndBorder = LocatorAndBorder.Instance;
            _locatorAndBorder.InitLocator(Locator);
            Locator.OnMapRefreshed += Locator_OnMapRefreshed;
        }
Ejemplo n.º 4
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            if (WindowUtil.IsDesingMode())
            {
                return;
            }
            _statusBar = StatusBarBaseInfomation.Instance;

            this.MouseDown += (_s, _e) => this.Focus();
            _render         = new MapRender(this, this.Resources["seaMapBrush"] as ImageBrush);
            _seaMapInfo     = new Parts.SeaMapInfo(this);
            MenuBarsBaseInfo.Instance.PropertyChanged += menuBar_PropertyChanged;
        }
Ejemplo n.º 5
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (WindowUtil.IsDesingMode())
            {
                return;
            }

            foreach (var part in _mapParts)
            {
                part.Init();
            }
            _mouseEventSource.MouseDown.Subscribe(downMouse);
            _mouseEventSource.MouseMove.Subscribe(moveMouse);
            _mouseEventSource.MouseUp.Subscribe(upMouse);
        }
Ejemplo n.º 6
0
        protected override async void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            if (WindowUtil.IsDesingMode())
            {
                return;
            }
            await Task.Yield();

            await _mapNotification.InitCompletion;

            _locatorBorder = LocatorAndBorder.Instance;
            _track         = new TracksDraws(_locatorBorder.Locator);
            this.Children.Add(_track);
            _mouseEventSource.MouseDown.Subscribe(downMouse);
            _mouseEventSource.MouseDoubleClick.Subscribe(doubleMouse);
            _mouseEventSource.MouseRightDown.Subscribe(rightMouse);
            this.ClipToBounds = true;
        }
Ejemplo n.º 7
0
        protected override async void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            if (WindowUtil.IsDesingMode())
            {
                return;
            }

            await Task.Yield();

            await _mapNotification.InitCompletion;

            _locator = LocatorAndBorder.Instance;
            _locator.OnMapRefreshed        += updateLocation;
            _menuBarsInfo                   = MenuBarsBaseInfo.Instance;
            _menuBarsInfo.PropertyChanged  += _menuBarsInfo_PropertyChanged;
            _statusBarInfo                  = StatusBarBaseInfomation.Instance;
            _statusBarInfo.PropertyChanged += _statusBarInfo_PropertyChanged;
            _mouseEventSource.MouseDown.Subscribe(downMouse);
            _mouseEventSource.MouseDoubleClick.Subscribe(doubleMouse);
        }