silverlight-4.0

Check internet connection in Silverlight

蹲街弑〆低调 提交于 2019-12-02 01:44:13
I'm writing a Silverlight 4 application and would like to check when opening the installed out of browser application, whether there is a valid internet connection (to then download some data from my website). What is the best way to do this? I realise that I could put a try catch around a WebRequest but that seems a bit hacky to me. EDIT : What I meant by valid internet connection is just connected to the internet You can just kill two birds with one stone with Application.CheckAndDownloadUpdateAsync . When you get a False on UpdateAvailable in handling Application

Errors when referencing Silverlight class library from WPF application

天涯浪子 提交于 2019-12-02 01:35:04
问题 I have a WPF application and a Silverlight application. They are both used to display a map and share some of the same functionality. I have created a Silverlight class library project in order to stay DRY. I'm referencing this from both Silverlight and WPF. It contains some utility methods that are useful in both projects. For example, I have this method: public static void CenterText(TextBlock name, Polygon poly) The silverlight project has no problem with this. However, I get the following

Silverlight: HTTP DELETE and PUT methods with RestSharp

一笑奈何 提交于 2019-12-01 23:48:16
I wanted to access an internal REST API from Silverlight, but it turns out that I am not allowed to use POST or DELETE as the HTTP method for my request. Doing so always resulted in a SecurityException . What is the recommended way to use REST apis with Silverlight? SecurityException probably means the API doesn't have the proper clientaccesspolicy.xml file in place. Here's an example of a very lenient one that allows all HTTP methods and headers. We have used this successfully for our API (which is popular, though I don't know how much traffic we get from Silverlight). <?xml version="1.0"

Include files from Team build output folder into XAP

一曲冷凌霜 提交于 2019-12-01 23:35:00
问题 I'm trying to do Continuous Integration using TFS 2010 for a Windows Phone 7.1 project. There are 2 resource projects (Win32 Project for localisation) and the main Windows phone project. I have copied the project output of above 2 projects to a folder in the main WP project (inside 'MUI' folder) , and also marked the files as 'content' in build action. All works well when building and running the WP7 project from Visual Studio 2010. But when I try to build the projects using TFS 2010 build

Include files from Team build output folder into XAP

大城市里の小女人 提交于 2019-12-01 21:38:58
I'm trying to do Continuous Integration using TFS 2010 for a Windows Phone 7.1 project. There are 2 resource projects ( Win32 Project for localisation ) and the main Windows phone project. I have copied the project output of above 2 projects to a folder in the main WP project (inside 'MUI' folder) , and also marked the files as 'content' in build action. All works well when building and running the WP7 project from Visual Studio 2010. But when I try to build the projects using TFS 2010 build system , the build fails with the following error "Xap packaging failed. Object reference not set to an

Getting UI virtualization working with ItemsControl in Silverlight

一世执手 提交于 2019-12-01 17:21:22
I'm trying to create a scrolling list of fairly large textblocks. I want there to be a vertical scrollbar to show them all, and if they overflow a certain size I want them to display an ellipsis. I actually have all this working pretty good. I have the following Silverlight XAML: <Grid x:Name="LayoutRoot" MaxWidth="500" MinWidth="100" MaxHeight="500" MinHeight="100"> <Grid.DataContext> <app:MainPageViewModel/> </Grid.DataContext> <ScrollViewer> <ItemsControl ItemsSource="{Binding TextItems}" Margin="0,20,0,20"> <ItemsControl.ItemTemplate><DataTemplate> <Border MaxHeight="175" Margin="0,0,0,18"

Silverlight: how to handle standard assemblies

本小妞迷上赌 提交于 2019-12-01 14:13:56
A usual Silverlight task: to make the size of xap-file smaller. There are a lot of hot-to-do manuals that explain how to make your application modular. But I didn't find anyone that explains how to make "modular" standard libraries. The biggest part of my xap-file (1.7Mb, when overall size is 1.8Mb) is occupied by standard assemblies: among them System.Windows.Controls.dll - 370Kb, System.Windows.Controls.Data.dll - 464Kb, etc... Could you please tell (or give a reference to manual) how to move these assemblies out of xap file? I could use prism/unity and load them dynamically, but in this

How can I get Outlook 2003 data in Silverlight 4 application

一曲冷凌霜 提交于 2019-12-01 13:47:28
Is it possible to use Automation for Outlook 2003 with Silverlight 4? Or maybe there are some different way to use Outlook 2003 MAPI in Silverlight application? I'm using Silverlight 4 and I'm trying interact with Outlook in this way: dynamic outlook = AutomationFactory.GetObject("Outlook.Application"); For Outlook 2007/2010 all works fine. But when I try use any field of dynamic instance (for example outlook.Session) from Outlook 2003 then I've get NotSupportedException. It's only Outlook 2003 problem. I found article http://msdn.microsoft.com/en-us/library/aa159619%28office.11%29.aspx but it

How can I get Outlook 2003 data in Silverlight 4 application

断了今生、忘了曾经 提交于 2019-12-01 13:31:52
问题 Is it possible to use Automation for Outlook 2003 with Silverlight 4? Or maybe there are some different way to use Outlook 2003 MAPI in Silverlight application? I'm using Silverlight 4 and I'm trying interact with Outlook in this way: dynamic outlook = AutomationFactory.GetObject("Outlook.Application"); For Outlook 2007/2010 all works fine. But when I try use any field of dynamic instance (for example outlook.Session) from Outlook 2003 then I've get NotSupportedException. It's only Outlook

Change Background of WP7 Application if Theme is altered

别说谁变了你拦得住时间么 提交于 2019-12-01 12:24:40
I need to change the Background Image of my Application if user changes theme from "Light" to "Dark" or vice-vesa in code behind. I hope these should be done in Page Loded event quetzalcoatl @TimDams pointed you to one of the nice ways to detect what-theme-is-now-set, but I didn't notice there any information how to detect a change to the theme during the application runtime. The user could start your app, then bump forward to the menu, change the theme, and get back to your app. While you may think that your app will be tombstoned and then restarted and renavigated to your page with full