コード例 #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;
        }
コード例 #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);
        }
コード例 #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;
            }
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #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));
        }
コード例 #7
0
 static void SetInstance(ViewerApplicationControl instance)
 {
     _instance = instance;
 }
コード例 #8
0
 static void SetInstance(ViewerApplicationControl instance)
 {
     _instance = instance;
 }
コード例 #9
0
 private void ViewerApplicationControl_ViewInitialized(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     e.View.WindowManager.DesignTimeWindowStyle = Application.Current.Resources["BuilderWindowStyle"] as Style;
 }
コード例 #10
0
 void ViewDisposed(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     if (e != null && e.View != null)
         e.View.SelectedLayerChanged -= SelectedLayer_Changed;
 }
コード例 #11
0
 void ViewerApplicationControl_ViewInitialized(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     if (e.View != null)
     {
         e.View.ProxyUrlChanged += View_ProxyUrlChanged;
         View_ProxyUrlChanged(null, EventArgs.Empty);
     }
 }
コード例 #12
0
 void ViewerApplicationControl_ViewDisposed(object sender, ViewerApplicationControl.ViewEventArgs e)
 {
     if (e.View != null)
         e.View.ProxyUrlChanged -= View_ProxyUrlChanged;
 }