コード例 #1
0
 public SecureServicesLayerConfig()
 {
     DefaultStyleKey = typeof(SecureServicesLayerConfig);
     SecureServicesLayerConfigViewModel viewModel = new SecureServicesLayerConfigViewModel();
     this.DataContext = viewModel;
     System.Windows.Data.Binding binding = new System.Windows.Data.Binding();
     binding.Source = viewModel;
     binding.Path = new PropertyPath("IsEnabled");
     binding.Mode = System.Windows.Data.BindingMode.TwoWay;
     SetBinding(IsEnabledProperty, binding);
 }
コード例 #2
0
        public SecureServicesLayerConfig()
        {
            DefaultStyleKey = typeof(SecureServicesLayerConfig);
            SecureServicesLayerConfigViewModel viewModel = new SecureServicesLayerConfigViewModel();

            this.DataContext = viewModel;
            System.Windows.Data.Binding binding = new System.Windows.Data.Binding();
            binding.Source = viewModel;
            binding.Path   = new PropertyPath("IsEnabled");
            binding.Mode   = System.Windows.Data.BindingMode.TwoWay;
            SetBinding(IsEnabledProperty, binding);
        }
        static void OnProxyUseChange(DependencyObject o, DependencyPropertyChangedEventArgs args)
        {
            SecureServicesLayerConfigViewModel vm = o as SecureServicesLayerConfigViewModel;

            ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetUsesProxy(vm.layer, vm.UsesProxy);
            if (vm.UsesProxy)
            {
                if (vm.layer != null && ViewerApplicationControl.Instance != null && ViewerApplicationControl.Instance.ViewerApplication != null)
                {
                    SecureServicesHelper.SetProxyUrl(vm.layer, SecureServicesHelper.GetProxyUrl());
                }
            }
            else
            {
                SecureServicesHelper.SetProxyUrl(vm.layer, null);
            }
        }