Example #1
0
        public TableWidget()
        {
            this.Resources.MergedDictionaries.Add(SharedDictionaryManager.SharedStyleDictionary);
            this.Resources.MergedDictionaries.Add(SharedDictionaryManager.SharedDataTemplateDictionary);

            InitializeComponent();

            DataGridViewModel = new TableViewModel(null);
            DataContext       = DataGridViewModel;

            Caption = "Table";
        }
Example #2
0
        public AlertWidget()
        {
            this.Resources.MergedDictionaries.Add(SharedDictionaryManager.SharedStyleDictionary);
            this.Resources.MergedDictionaries.Add(SharedDictionaryManager.SharedDataTemplateDictionary);

            InitializeComponent();

            DataGridViewModel = new AlertViewModel(null);
            DataContext       = DataGridViewModel;

            Caption    = "Alerts";
            Properties = new Dictionary <string, string>();

            // init the widget's data members from the VM
            DataGridViewModel.GetProperties(Properties);
        }
Example #3
0
        private async Task <bool> SetEditMode(bool bEditMode)
        {
            if (InEditMode == bEditMode)
            {
                return(true);
            }

            InEditMode = bEditMode;
            _edits.Clear();
            CutStop = null;

            // the routes layer
            FeatureLayer routesFeatureLayer = FindFeatureLayer(_routesDataSource);

            if (routesFeatureLayer == null)
            {
                return(false);
            }

            if (InEditMode)
            {
                // switch to use custom layers

                // routes
                _customLayerRoutes = await BaseDataGridViewModel.CreateCustomLayer(routesFeatureLayer, _routesDataSource);

                _map.Layers.Add(_customLayerRoutes);

                // temp commented out - keep showing the original feature layer until a calculating a route
                routesFeatureLayer.Visible = false;
                _customLayerRoutes.Visible = true;

                // stops
                _customLayerStops = CreateCustomLayer();
                _map.Layers.Add(_customLayerStops);
                _featureLayer.Visible     = false;
                _customLayerStops.Visible = true;

                // web socket
                OpenWebSocket();
            }
            else
            {
                // switch to use the feature service layers

                // routes
                routesFeatureLayer.Visible = true;
                _map.Layers.Remove(_customLayerRoutes);
                _customLayerRoutes = null;

                // stops
                _featureLayer.Visible = true;
                _map.Layers.Remove(_customLayerStops);
                _customLayerStops = null;

                // web socket
                CloseWebSocket();
            }

            return(true);
        }