Пример #1
0
 public void ShowLayer(UiMode layer)
 {
     if (!_uiModeModel.IsLayerVisible(layer))
     {
         _uiModeModel.ShowLayer(layer);
     }
 }
Пример #2
0
        /// <summary>
        /// Initializes Action with specific parameters defining  Name, tree structure etc.
        /// Subscribes to events
        /// </summary>
        /// <param name="param"></param>
        public override void Initialize(ActionInitializeParams param)
        {
            Debug.Assert(param is LayerActionInitializeParams, "In Overlays ActionInitializeParams should be of type LayerActionInitializeParams");
            Layer = ((LayerActionInitializeParams)param).Layer;

            base.Initialize(param);

            _uiModeService.CanShowHideLayerChanged += (_, ea) =>
            {
                if (ea.Layer == Layer)
                {
                    CanShowHideLayer = ea.CanShowHide;
                }
            };
            _uiModeService.LayerVisiblityChanged += (___, ea) =>
            {
                if (Layer != UiMode.None)
                {
                    IsActive = _uiModeService.IsLayerVisible(Layer);
                }
            };

            //Set initial state
            CanShowHideLayer = _uiModeService.CanShowHideLayer(Layer);
        }