Esempio n. 1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     i++;
     SceneVM scene = new SceneVM();
     scene.SelectedMapVM = new ViewModel.Map.MapVM();
     scene.SelectedMapVM.LayerCollection.Add(new SingleTileLayer() { TileImageURI = AppDomain.CurrentDomain.BaseDirectory + @"map.PNG", MaximumResolution = 10, MinimumResolution = 0.1 });
     TabPanelVM vm = new TabPanelVM() { Title = "警卫任务" + i.ToString(), Content = scene };
     _mainWindowVM.TabPanelManagerVM.DefaultTabControlVM.TabPanelVMs.Add(vm);
     _mainWindowVM.TabPanelManagerVM.DefaultTabControlVM.SelectedTabPanelVM = vm;
 }
        public Visual GetContentView(TabPanelVM tabPanel)
        {
            if(tabPanel.ContentType== TabPanelContentType.Scene)
            {
                SceneView sv= new SceneView();
                sv.DataContext = tabPanel.Content;
                return sv;
            }

            return null;
        }
Esempio n. 3
0
 private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
 {
     SceneVM scene = new SceneVM();
     scene.SelectedMapVM = new ViewModel.Map.MapVM();
     scene.SelectedMapVM.LayerCollection.Add(new SingleTileLayer() { TileImageURI = AppDomain.CurrentDomain.BaseDirectory + @"map.PNG", MaximumResolution = 10, MinimumResolution = 0.1 });
     TabPanelVM vm = new TabPanelVM() { Title = "总指挥屏", Content = scene };
     //scene.SelectedMapVM.LayerCollection.Add(new ArcGISTiledMapServiceLayer() { Url = @"http://169.254.80.80:7080/PBS/rest/services/MyPBSService1/MapServer" });
     //TabPanelVM vm = new TabPanelVM() { Title = "总指挥屏", Content = scene };
     vm.CanClose = false;
     _mainWindowVM.TabPanelManagerVM.DefaultTabControlVM.TabPanelVMs.Add(vm);
     _mainWindowVM.TabPanelManagerVM.DefaultTabControlVM.SelectedTabPanelVM = vm;
 }