Esempio n. 1
0
        public PhotoGallery()
        {
            InitializeComponent();
            CitiesViewModel viewModel = ViewModelSource.Create(() => new CitiesViewModel(map));

            LayoutRoot.DataContext = viewModel;
            placePointer.Content   = viewModel;
        }
Esempio n. 2
0
        public PhotoGallery()
        {
            this.InitializeComponent();
            CitiesViewModel viewModel = new CitiesViewModel(map, Resources["citySmallIconTemplate"] as DataTemplate);

            DataContext = viewModel;
            map.Layers[0].ViewportChanged += TileLayer_ViewportChanged;
            //MapCustomElement placePointerLayer = (MapCustomElement)((VectorItemsLayer)map.Layers[2]).Items[0];
            //placePointerLayer.Content = ViewModel;
            //BindingOperations.SetBinding(placePointerLayer, MapCustomElement.LocationProperty,
            //    new Binding() { Path = new PropertyPath("Content.SelectedPlace.Location"), Source = placePointerLayer });
        }