Ejemplo n.º 1
0
        private static void OnViewPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            View view = e.NewValue as View;
            ViewerApplicationControl viewer = d as ViewerApplicationControl;

            view.SelectionChanged -= viewer.view_SelectionChanged;
            view.SelectionChanged += viewer.view_SelectionChanged;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// BaseUriProperty property changed handler.
        /// </summary>
        /// <param name="d">ViewerApplicationControl that changed its BaseUri.</param>
        /// <param name="e">Event arguments.</param>
        private static void OnBaseUriPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ViewerApplicationControl source = d as ViewerApplicationControl;

            source.disposeExtensibilityObjects();
            source.DisposeView();
            SidePanelHelper.Reset();
            source.initializeViewerApplication(true);
        }
Ejemplo n.º 3
0
        private static void OnViewerApplicationPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ViewerApplicationControl ctrl = (ViewerApplicationControl)d;

            if (e.OldValue != null)
            {
                ((ViewerApplication)e.OldValue).PropertyChanged -= ctrl.ViewerApplication_PropertyChanged;
            }

            if (e.NewValue != null)
            {
                ((ViewerApplication)e.NewValue).PropertyChanged += ctrl.ViewerApplication_PropertyChanged;
            }
        }
Ejemplo n.º 4
0
        public void SyncExtensionsInUse(IEnumerable <string> usedXaps)
        {
            ESRI.ArcGIS.Mapping.Controls.ViewerApplicationControl va = ESRI.ArcGIS.Mapping.Controls.ViewerApplicationControl.Instance;
            List <string> extensions = new List <string>();

            foreach (string containerXap in usedXaps)
            {
                string url = string.Format("Extensions/{0}.xap", containerXap);
                if (!extensions.Contains(url))
                {
                    extensions.Add(url);
                }
            }

            va.ViewerApplication.Extensions = extensions;
        }
Ejemplo n.º 5
0
        public ObservableCollection <string> GetXapsInUse(out string behaviorsXml)
        {
            ESRI.ArcGIS.Mapping.Controls.ViewerApplicationControl va = ESRI.ArcGIS.Mapping.Controls.ViewerApplicationControl.Instance;
            ObservableCollection <string> usedXaps   = new ObservableCollection <string>();
            IEnumerable <string>          assemblies = va.GetAllAssembliesNamesInUse(out behaviorsXml);

            if (assemblies != null)
            {
                foreach (string assembly in assemblies)
                {
                    string containerXap = getXapNameForAssembly(assembly);
                    if (string.IsNullOrEmpty(containerXap))
                    {
                        continue;
                    }
                    usedXaps.Add(containerXap);
                }
            }

            return(usedXaps);
        }
Ejemplo n.º 6
0
        private void StartupAfterGettingResources(object sender, StartupEventArgs e)
        {
            string baseUrl = getBaseUri(e);
            MainPage mainPage = null;

            ViewerApplicationControl viewerControl = new ViewerApplicationControl() {
                     BaseUri = new Uri(baseUrl, UriKind.Absolute) };
            this.RootVisual = mainPage = new MainPage() { Content = viewerControl };
            viewerControl.ViewInitialized += (o, args) => 
                { viewerControl.View.ApplicationColorSet.SyncDesignHostBrushes = true; };

            RTLHelper helper = Application.Current.Resources["RTLHelper"] as RTLHelper;
            Debug.Assert(helper != null);
            if (helper != null)
                mainPage.FlowDirection = helper.FlowDirection;

            WebClientFactory.Initialize();
            ImageUrlResolver.RegisterImageUrlResolver(new UrlResolver(baseUrl));
        }
Ejemplo n.º 7
0
 static void SetInstance(ViewerApplicationControl instance)
 {
     _instance = instance;
 }
 static void SetInstance(ViewerApplicationControl instance)
 {
     _instance = instance;
 }
 private void ViewerApplicationControl_ViewInitialized(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     e.View.WindowManager.DesignTimeWindowStyle = Application.Current.Resources["BuilderWindowStyle"] as Style;
 }
 void ViewDisposed(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     if (e != null && e.View != null)
         e.View.SelectedLayerChanged -= SelectedLayer_Changed;
 }
 void ViewerApplicationControl_ViewInitialized(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     if (e.View != null)
     {
         e.View.ProxyUrlChanged += View_ProxyUrlChanged;
         View_ProxyUrlChanged(null, EventArgs.Empty);
     }
 }
 void ViewerApplicationControl_ViewDisposed(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     if (e.View != null)
         e.View.ProxyUrlChanged -= View_ProxyUrlChanged;
 }