silverlight

ArcGIS API for Silverlight 学习笔记(2)

孤者浪人 提交于 2019-12-28 04:57:39
这里主要讲解展示不同的服务地图 先看一个实例:   新建一个Silverlight项目,在MainPage.xaml文件中,引入 ESRI.ArcGIS.Client 命名空间和 ESRI.ArcGIS.Client 所在的程序集 ESRI.ArcGIS.Client,并指定 该命名空间的名字为 esri,当然你也可以用自己的别名,比如myGIS。   接着写Map控件,并指定Map中的地图服务,一个简单的服务地图完成了,代码如下: 代码 < UserControl x:Class ="ArcGISTiledLayer.MainPage" xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:esri ="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" > < Grid x:Name ="LayoutRoot" > < esri:Map x:Name ="MyMap" > < esri:ArcGISTiledMapServiceLayer ID ="MyLayer" Url ="http://server

Windows Phone 7 close application

戏子无情 提交于 2019-12-27 12:06:52
问题 Is there any possibility to programatically close Silverlight application on Windows Phone 7? 回答1: If you write an XNA Game, you will have access to an explicit Exit() method. If you are writing traditional Silverlight project, then NO , there is no way to programatically close your app. See also Peter Torr's Blog entry on Exiting Silverlight Apps in Windows Phone 7. There he also mentions the option of throwing an unhandled exception, which IMO is a terrible programing style. An option you

Learning Resources

你说的曾经没有我的故事 提交于 2019-12-27 10:04:35
Web Development – ASP.NET / ASP.NET AJAX Community Sites/ Learning Centers · www.asp.net · www.asp.net/ajax Software and Download Centers · Visual Web Developer Express 2008 Beta 2 – Web Edition http://msdn2.microsoft.com/hi-in/express/future/bb421473.aspx · Visual Web Developer Express 2005 http://download.microsoft.com/download/7/7/3/7737290f-98e8-45bf-9075-85cc6ae34bf1/vs80sp1-kb926751-x86-intl.exe · .NET Framework 3.5 Beta 2 http://www.microsoft.com/downloads/details.aspx?familyid=d2f74873-c796-4e60-91c8-f0ef809b09ee · .NET Framework 3.0 http://www.microsoft.com/downloads/details.aspx

Silverlight 访问WCF服务

做~自己de王妃 提交于 2019-12-26 00:32:48
网络上设置Silverlight动态访问WCF服务,大多是抛开ServiceReferences.ClientConfig文件,完全以代码方式实现对WCF的动态访问。但这种做法存在实现复杂和局限性。在实际使用的过程中,出于 安全 等原因,很多时候需要通过自定义绑定,设置很多内容。通过 VS中的向导生成Silverlight对WCF的访问,能够自动识别这些内容,并自动生成 ServiceReferences.ClientConfig文件,简单地实现对服务的访问,但手动通过代码实现这些绑定,显然难度比VS向导方式大了很多,而且一旦服务的绑定等发生变化,Silverlight端代码的修改也非常麻烦。 我们知道,WCF服务是通过ABC三种要素进行设置的,VS向导能自动生成ABC三种要素。程序部署到服务器上,唯一变化的就是A——地址。因此,通过一定的方式,依托自动生成的 配置 文件,只是动态地修改 A,显然是最简单的方式。 程序在开发环境和部署到服务器上时,主要会面临两种情况: 1、Silverlight始终以一个固定的服务器地址访问WCF服务,例如,其中一个服务的地址是http://myServices.com/MyService.svc。 2、服务器提供公网和局域网两种访问方式,WCF服务和承载Silverlight的Web程序在同一个站点上,两者可能在同一个Web程序中

ArcGIS API for Silverlight 使用GeometryService求解线与面的交点(一)

梦想的初衷 提交于 2019-12-25 18:24:24
最近在做项目的时候遇到一个问题,大致情况如下: 已知河流的面要素,需要根据用户输入的矩形以及设定的步长对河流进行网格划分,并得到网格与两边河岸的交点。 查了查资料,发现原生的ArcGIS API for Silverlight并没有提供实现该功能的借口,但是GeometryService提供了一个类似的功能:Intersect. Intersect:其相交的情况有如下三种: 这里需要注意的时最后一个:线与线相交,从几何的角度来说,最后得到的结果应该是一个点,然而在GeometryService中,最后得到的结果是PolyLine,即是线,而且该线的Extent属性为null,也就是说线段长度为0.因此如果你想通过Intersect来求解两条线的交点实不可取的。那么这里的用处是什么呢?就是可以用来判断交点的个数。 从上图来看我们的情况是属于第二种:即面与线相交。 但是我们发现,这里得到的是相交的线,而我们要的是点,这个该怎么解决呢? 其实我们再一想,就可以发现,既然我们能够得到相交的线,那么我们是不是可以得到线的两个端点呢?如果可以得到两个端点是不是我们的问题就解决了呢? 答案只对了一半,因为我们再仔细一想,又会发现一个问题就是虽然我们可以得到两个端点,但是有的端点并不是网格与河流面要素的交点,例如下图所示: 上图表示对河流进行划分的网格 如果按照上面的思路我们将得到如下的结果:

in Silverlight DataGrid, CheckBox's DataContext sometimes null when Checked/Unchecked

六眼飞鱼酱① 提交于 2019-12-25 18:19:24
问题 I have a DataGrid. One of the columns is a template with a CheckBox in it. When the Checked or Unchecked events trigger, (it happens with both) the CheckBox's DataContext is sometimes null, which causes my code to error. It seems to be null most often if the mouse is moving while you press and release the button quickly (it's intermittent). I listened for changes to the DataContext of the CheckBox by making views:ListenCheckBox (extends CheckBox) and attaching a binding, and it's never set to

Communication between excel and silverlight

谁说胖子不能爱 提交于 2019-12-25 18:15:28
问题 I am developing an application where i need to get data from excel to my silverlight oob application and after manuplation send it back to excel. I am able to do this using with com automation factory classes. But the problem is we have already developed some logics for grabing data from wcf and odbc so we want to track changes by WCF service. The requirement is: if i changes data into excel that will be reflected into silverlight and if I change data into silverlight that need to be

How to add reference of c++ dll (build with pure MSIL option) in silverlight application

倖福魔咒の 提交于 2019-12-25 16:54:56
问题 I have tried adding reference after converting it to .sl.dll, it gets added but my application shows blank page instead of the contents. How can I use the cpp code in silverlight? Also can we use unmanaged code via the managed one similar to WPF? Please note I am already using 2.0.5.0 version of system.dll. 回答1: An application needs full trust in order to make use of unsafe code. Even a trusted Silverlight application does not run with full trust, but a somewhat more relaxed set of

RaiseCanExecuteChanged event

女生的网名这么多〃 提交于 2019-12-25 16:04:27
问题 I am at the stage in a project where I need to get control of enabling / disabling some hyperlinks based on various business rules. I noticed all topics on RaiseCanExecuteChanged event refer to MVVM light. Does this mean that I have to use MVVM light or is there a way to access this event using standard MVVM. If so, how? Thanks 回答1: ICommands have an event that command watchers subscribe to. When this event fires, it is the responsibility of the watchers (Button, etc) to call CanExecute in

WP7 ListPicker Set SelectedItem Problem

夙愿已清 提交于 2019-12-25 14:13:46
问题 I have a list picker propagated by two strings from an XML file, one a name and one a value. XmlReader xml = XmlReader.Create("file.xml"); XDocument _doc = XDocument.Load(xml); var stringNames = from query in _doc.Descendants("string") select new CustomValue { StringName = (string)query.Attribute("name"), StringValue = (string)query.Attribute("value"), }; Listpicker.ItemsSource = stringNames; public class CustomValue { public string StringName { get; set; } public string StringValue { get;