Esempio n. 1
0
        /// <summary>
        /// Default construction - Consume the passed in CIMView. Call the base constructor to wire up the CIMView.
        /// </summary>
        /// <param name="view"></param>
        public LayersPaneViewModel(CIMView view)
            : base(view)
        {
            _path = view.ViewXML;

            //register
            LayersPaneUtils.PaneCreated(this);

            //get the active map
            MapView activeView = MapView.Active;

            //get all the layers in the active map
            _allMapLayers = activeView.Map.GetLayersAsFlattenedList().OfType <FeatureLayer>().ToList();
            //set the selected layer to be the first one from the list
            if (_allMapLayers.Count > 0)
            {
                _selectedLayer = _allMapLayers[0];
            }

            ListOfRows = new List <DynamicDataRow>();
            //Enable collection mods in the background
            BindingOperations.EnableCollectionSynchronization(ListOfRows, _theLock);
            //set up the command for the query
            QueryRowsCommand = new RelayCommand(new Action <object>(async(qry) => await QueryRows(qry)), CanQueryRows);
        }
Esempio n. 2
0
        /// <summary>
        /// Default construction - Consume the passed in CIMView. Call the base constructor to wire up the CIMView.
        /// </summary>
        /// <param name="view"></param>
        public LayersPaneViewModel(CIMView view)
            : base(view)
        {
            _path = view.ViewXML;

            //register 
            LayersPaneUtils.PaneCreated(this);

            //get the active map
            MapView activeView = MapView.Active;
            //get all the layers in the active map
            _allMapLayers = activeView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().ToList();
            //set the selected layer to be the first one from the list
            if (_allMapLayers.Count > 0)
                _selectedLayer = _allMapLayers[0];

            //set up the command for the query
            QueryRowsCommand = new RelayCommand(new Action<object>(async (qry) => await QueryRows(qry)), CanQueryRows);
        }
Esempio n. 3
0
 protected override void OnClick()
 {
     //LayersPaneViewModel.Create();
     LayersPaneUtils.OpenPaneView(LayersPaneViewModel.ViewPaneID);
 }