silverlight

Silverlight 动态配置WebService

℡╲_俬逩灬. 提交于 2019-12-25 13:13:25
在 silverlight 中对 service(web service,wcf) 添加引用后,会产生一个 config 文件 : ServiceReferences.ClientConfig. 如下所示: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_Wcf_GetData" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address=" http://localhost:1522/CH10/Wcf_GetData.svc " binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Wcf_GetData" contract="WcfGetDataProxy.Wcf_GetData" name="BasicHttpBinding_Wcf_GetData" /> </client> </system

how can I bind Bing Pushpins from multiple models?

穿精又带淫゛_ 提交于 2019-12-25 12:44:17
问题 I have the requirement in my WP7 application to display pushpins on a bing map from multiple data sources and I am not sure of the best way to do this. So for example it would be something like this, I receive from a web service a list of people, a list of buildings, a list of POIs etc. I would need to display these individually in their own views but also display them on a map with different images for each type. I am trying to use a MVVM approach so have a class for a Person, class for a

Printing text in Silverlight that measures larger than page

半城伤御伤魂 提交于 2019-12-25 12:13:47
问题 I have a silverlight application that allows people to enter into a notes field which can be printed, the code used to do this is: PrintDocument pd = new PrintDocument(); Viewbox box = new Viewbox(); TextBlock txt = new TextBlock(); txt.TextWrapping = TextWrapping.Wrap; Paragraph pg = new Paragraph(); Run run = new Run(); pg = (Paragraph)rtText.Blocks[0]; run = (Run)pg.Inlines[0]; txt.Text = run.Text; pd.PrintPage += (s, pe) => { double grdHeight = pe.PrintableArea.Height - (pe.PageMargins

MediaElement Set position in Pause mode

六眼飞鱼酱① 提交于 2019-12-25 12:07:34
问题 I use this method to seek new position in my MediaElement : TimeSpan t = TimeSpan.FromSeconds(newSecond); System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { mediaElement1.Position = TimeSpan.FromSeconds(newSecond); }); When the user play video and then pause it and seek to new position the video frame stay in the previous frame. And i want to know if it possible that when i seek to new position and the video is in pause mode so the frame will move to the new position and won't

MediaElement Set position in Pause mode

前提是你 提交于 2019-12-25 12:06:12
问题 I use this method to seek new position in my MediaElement : TimeSpan t = TimeSpan.FromSeconds(newSecond); System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { mediaElement1.Position = TimeSpan.FromSeconds(newSecond); }); When the user play video and then pause it and seek to new position the video frame stay in the previous frame. And i want to know if it possible that when i seek to new position and the video is in pause mode so the frame will move to the new position and won't

MVVM Light - using ViewModelLocator - properties hit multiple times

怎甘沉沦 提交于 2019-12-25 11:55:01
问题 I'm making use of the MVVM Light ViewModelLocator. I have a class called GlobalViewModelLocator which is hooked up in the resources in the App.Xaml. This class has a static property called Main which returns an instance of the MainViewModel. Then in the MainView.Xaml, I set the datacontext of the usercontrol to bind to the path of this MainViewModel. This works fine - I put a breakpoint on the MainViewModel constructor and it is being hit once. However, all the properties in the ViewModel

Serving Silverlight apps from the webserver

六月ゝ 毕业季﹏ 提交于 2019-12-25 11:47:34
问题 I am building my own web server and want to serve from it a Silverlight application. Is there anything else I have to do besides setting the mime type and pushing the application through the wire? It probably makes no difference, but the web-server is in C# (the micro-edition). 回答1: No, silverlight is all run on the client, so unless you want to do some webservices or whatever, you needn't do anything other than set the mime-type. It is really just like a separate file that you serve to the

How to use XML as a database in windows phone 7 application?

≯℡__Kan透↙ 提交于 2019-12-25 09:47:10
问题 I am developing window phone 7 application. I am new to the window phone 7 application. I am using xml as a database for my current application. I am using the following link to use the XML as a database. http://rongchaua.net/blog/windows-phone-7-simple-database-example/ I have six tables (for e.g. table_A, table_B, table_C, table_D, table_E, table_F) for my current application. So should I create the six classes (for e.g. class_A, class_B, class_C, class_D, class_E, class_F) for my current

Existing silverlight app to WP7

前提是你 提交于 2019-12-25 09:27:36
问题 How to customize the existing silverlight appliction, to be able to run on windows phone 7? What are all the issues or API's or resolution problems will occur during the Migration? Thanks in Advance 回答1: This is a good place to start. Class Library Support for Windows Phone Differences Between Silverlight on Windows and Windows Phone Features Supported in Silverlight for Windows Phone Also, migrating your code across to the Windows Phone Application project template can be a less bumpy road

Silverlight run DispatchTimer only once

痴心易碎 提交于 2019-12-25 08:58:06
问题 I'm trying to figure out a way in Silverlight / C# to make a DispatchTimer run only once. I have a user form and when submitted I want to display a message for 10 seconds and then disappear and kill the DispatchTimer thread. I know how to make a DispatchTimer that repeats: clock.Interval = TimeSpan.FromSeconds(10); clock.Tick += clockTick; clock.Start(); But I want that thread to end as soon as it completes. 回答1: This should work for you: DispatcherTimer clock = new DispatcherTimer(); clock