silverlight-4.0

Silverlight 4, subclassing WebClient

百般思念 提交于 2019-12-04 10:22:30
Following an advice, I saw at several web pages (for example Using CookieContainer with WebClient class ), I subclassed WebClient class to use a cookie with it: public class MyWebClient : System.Net.WebClient { } Now, when I initialize MyWebClient: MyWebClient wc = new MyWebClient(); it throws TypeLoadException. My OS is Windows 7 (japanese), so error message is not in english; I see it is related to security rules. What might be the problem? Stephen McDaniel WebClient's constructor is marked with the SecuritySafeCritical attribute. And it looks like that is what is causing the security

Why does Silverlight 4 Tools only give partial intellisense?

我的梦境 提交于 2019-12-04 08:34:05
I finally got Silverlight 4 Toolkit installed , referenced and working after the difficulty of finding the right namespace described in this question . But intellisense doesn't work fully: after I type " tk: ", it doesn't pop up the various controls I have available, but if I type a control name out, e.g. DockPanel , then it works, as shown below. It will even give me intellisense after I type tk:DropPanel, which is odd. How can I get intellisense to work in all cases for the Silverlight 4 Toolkit? I can imagine I need another namespace, but this site says that this reference: is now all you

Change culture of Silverlight application

梦想的初衷 提交于 2019-12-04 08:02:38
I am working on a Silverlight app at the moment. I have a few datagrids/textblocks where I use standard binding to show values, some of which are dates. e.g. <sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Path=MyCollection}"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding Path=Name, Mode=OneWay}" Header="Agent"/> <sdk:DataGridTextColumn Binding="{Binding Path=UpdateTime, Mode=OneWay}" Header="Update Time"/> </sdk:DataGrid.Columns> </sdk:DataGrid> <TextBlock Text="{Binding Path=LastUpdatedTime}"/> This binds fine but the dates are always

Isolated storage location for windows phone 7?

梦想的初衷 提交于 2019-12-04 07:56:30
I'm building a windows phone 7 application using silverlight 4. I store my data in Isolated storage as outlined here . The program runs with no errors. My question is where I can see the file I have saved? Is it possible to find the file in the windows phone 7 emulator? The "Mango" SDK ships with the ISETool that can take and restore snapshots of an application's isolated storage to/from a local directory: # Copy data from IS to directory ISETool.exe ts xd <PRODUCT-ID> "C:\TempDirectory\IsolatedStore" # Copy data from IS to directory ISETool.exe rs xd <PRODUCT-ID> "C:\TempDirectory

How to display TIFF (in form of Byte[]) on Silverlight Image control

天涯浪子 提交于 2019-12-04 07:55:13
I created a window service to put all of my TIFF files into database and stored them as Byte[] . Now I want to be able to display them through Silverlight Image control So i use the Converter during binding XAML in order to convert the Byte[] to Bitmap because the Image.Source only accept eitheir URI (I don't have the file stored on server so can't use this method) or Bitmap . BitmapImage bmi = new BitmapImage(); if (value != null) { ImageGallery imageGallery = value as ImageGallery; byte[] imageContent = imageGallery.ImageContent; string imageType = imageGallery.ImageType; using (MemoryStream

Silverlight 4 + MVVM + KeyDown event

你离开我真会死。 提交于 2019-12-04 07:39:41
I'm trying to build a sample game in Silverlight 4 using the MVVM design pattern to broaden my knowledge. I'm using Laurent Bugnion's MvvmLight toolkit as well (found here: http://mvvmlight.codeplex.com/ ). All I want to do right now is move a shape around within a Canvas by pressing specific keys. My solution contains a Player.xaml (just a rectangle; this will be moved around) and MainPage.xaml (the Canvas and an instance of the Player control). To my understanding, Silverlight doesn't support tunneling routed events, only bubbling. My big problem is that Player.xaml never recognizes the

Evenly Spaced Dashes with StrokeDashArray

别说谁变了你拦得住时间么 提交于 2019-12-04 07:03:07
I'm trying to create a poker chip like the one here: http://www.casinowholesalers.com/shop/product_info.php?cPath=57&products_id=379 using Expression Blend 4 for a WP7.1 Silverlight 4 app. I'm trying to create the six white "boxes" on the edge of the chip (ignoring for now the dice images and inner dashed line). The way I did it was two create two ellipses, one with no stroke, the other is the exact same size but with a stroke of 24, a color of White, and the StrokeDashArray to 1.8 (that's not "1 8", it's actually 1.8 with no second value). It looks pretty close to evenly sized and spaced (but

Silverlight ValidatesOnException default message localization

风流意气都作罢 提交于 2019-12-04 05:26:31
In my silverlight 4 MVVM application, i can switch languages during runtime : public void SetLanguage(string language) { var culture = new CultureInfo(language); Thread.CurrentThread.CurrentUICulture = culture; Thread.CurrentThread.CurrentCulture = culture; // ... } For the inputs, i just added "ValidatesOnException=true" in case of conversion problems and it does the job. But the default exception message is in the culture of my OS and not in the manually chosen one. In this thread on exception message localization the idea is to change CurrentCulture and CurrentUICulture, which i did. So i'm

Silverlight 5 Backward Compatibility

放肆的年华 提交于 2019-12-04 04:48:42
I have a Silverlight application developed with version 4.0. I tried running it with Silverlight 5 client and everything seems to be fine up to now. But I am wondering; if my users installs Silverlight 5 for client, is it sure my application will still work well? Do I have to run all my Test Cases again? If anyone notices something that has been broke between versions, please list it here! :) Thanks There's little evidence around the internet at the moment, other than that published by Microsoft, which can be found here and here , which states, to summarise: Several changes have been made to

Silverlight - DataGrid in Scrollviewer, Column.Width=“*” makes datagrid take several screen-widths

孤街浪徒 提交于 2019-12-04 03:58:30
问题 When I have the following setup, the last column having a width of * causes the datagrid to create huge horizontal scrollbars (extends grid to several widths of the screen). I'm not really sure why this is, but I really need a way to avoid that. I don't want to have to "simulate" column's with * lengths. edit: Apparently I'm not the only one who noticed this. http://connect.microsoft.com/VisualStudio/feedback/details/559644/silverlight-4-datagrid-star-column-width Xaml: <ScrollViewer Padding=