silverlight

Setting a custom property within a WPF/Silverlight page

This sounds like it should be simple. I have a Page declared in XAML in the normal way (i.e. with "Add new item...") and it has a custom property. I'd like to set that property in the XAML associated with the page. Trying to do this the same way that I'd set any other property doesn't work, for reasons I understand but don't know how to...

Production error

Hi, I keep getting an error in my production environment but not in my development. The error is pretty severe, it occurs at different times and simply loops a display message that says something like "Submitoperation failed, please inspect each Entity.ValidationError in EntitiesInError", until there are so many popupwindows that the a...

Silverlight 4: how to highlight control on mouse over

My aim is to get fine control "animation" when it is mouse-over-ed. For example, I have a "map" of controls (game map that represent different type of terrain), each of them is an image with trees/rocks/hills on the green grass or water (lake or see) image of blue/cyan color. When user point any image with mouse it should get shiny: eith...

MouseOver state for Border element

I have a Border element on my page that contains some TextBlock elements contained in a grid, e.g. (simplified): <Border Style="{StaticResource borderStyle}"> <Grid Background="Transparent"> <Grid.RowDefinitions> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnD...

Silverlight binary / faster serialization

We currently use Silverlight 4 with WCF services and try to read large arrays of users objects from service. In our code it takes about 0.5 (and less) seconds to generate 700 objects, arranged by hierarchy (a lot of loops). And it takes about 4-5 seconds for Silverlight/WCF to communicate that data - on localhost. I've measured timings...

Windows Phone 7 close application

Is there any possibility to programatically close Silverlight application on Windows Phone 7? ...

Has a Cloth Simulation ever been done in WPF or Silverlight?

I'm trying to find out if any sample Cloth simulation exists with code in WPF or Silverlight. So far this is what I've found: It's been done in DirectX and then used as an ImageBrush in WPF, but I mean without a DirectX and without a C++ dependency. It's been done in Flash and even Javascript so it's definitely possible performance wi...

Silverlight - Update client when DB changes

I am using Silverlight 3.0 and WCF Data Services 1.0 (Astoria) and Entity Framework 1.0. I have an entity that is an exact replica of a database table. Within that table, some fields/columns are updated after certain other columns are updated from the Client form (SL), i.e. like a computed column. Upon saving from the client, everyt...

How to detect a browser refresh from Silverlight 4?

My Silverlight 4 application keeps in contact with a server side through a wcf service. Whenever the user refreshes, navigates away or terminates the browser I should do some cleanup towards the server side. I can not use the Application Exit event; my wcf client is dead before it eventually gets called. I can not use the (new in SL4) F...

Silverlight displays solution name as title of page until application loads

I have a Silverlight 4 application and I cleverly name my apps by whatever color strikes me as appropriate to the project I am building. | It works for me. | My problem is that when I launch the application the solution/project name displays in the title/tab until the home page loads and then whatever I have set as my page title in my re...

Unit test a class that has Imported values by MEF

Hi, I have a a class called "ViewFactory" and this class should deliver the right view right now it has only one method (and it will grow) which I want to write a unit test against. the class looks like this... public class ViewFactory { [ImportMany(AllowRecomposition=true)] IEnumerable<ExportFactory<DependencyObject, I...

Setting FontSize below 6 in Silverlight

Whenever I set a TextBox's FontSize dependency property to a value less than 6.0, whether in XAML or in code, an ArgumentException is thrown. Is there any way to work around this arbitrary limit? ...

Serialization/Deserialization of Parameters - WCF Service Call doesn't work

I have a simple WCF service method: [OperationContract] public SetupGameResult SetupGame(long player1Id, long player2Id, long myPlayerId) { if(player1Id == 0 || player2Id == 0 || myPlayerId == 0) { throw new ArgumentException(); } ... // other code } I call this Service just in one ...

How to: Silverlight 4 business appliacation Form athentication with stand alone database

I am working on a silverlight 4 business application. for the form based authentication I created a user database with all the user, role and profile tables on SQL Express. In my VS2010 ASP.NET configuration I can see and manage my users and roles by adding, removing or modifying them. So, I assume my app.config connectionstrings set...

How can I tell which Silverlight Popup (or ChildWindow) is topmost?

I am trying to hit test in Silverlight applications to find the elements under the mouse cursor. Normally VisualTreeHelper.FindElementsInHostCoordinates works for this. If there is a Popup open I need to pass in the popup to the hit testing method. If there are multiple popups open, I need to determine the correct (topmost) popup to pas...

Troubleshooting XamlParseExceptions in Expression Blend 4

What is the best way to troubleshoot XamlParseExceptions in Blend? I'm using Blend 4 RTM, with a SL4 project, and I get totally stumped when I get the "Red Screen of Death": "An Exception was thrown. XamlParseException: [Line: 0 Position: 0]..." Is there a list of techniques that help? The error message is completely opaque and useles...

Silverlight 4: How to reference class from another assembly

In XAML-file of the SquadView page (VfmElitaSilverlightClientView.Pages.SquadView) I am using custom value converter. XAML-file is in "VfmElitaSilverlightClientView" namespace. Separate folder was created for converter and it is in "VfmElitaSilverlightClientView.Converter" namespace (in the same assembly). To use converter following code...

Animating background color of border in Silverlight, State precedence in VisualStateGroups

This is a silverlight/XAML question. Not sure what I'm doing wrong, this seems to throw an error: <ColorAnimation Storyboard.TargetName="btnRemoveBorder" Storyboard.TargetProperty="Background" To="#FFDEBA29" Duration="0" /> 2nd question is... rather confused with the Selected and Focused states. Can one state take precedence ove...

Bullets and Numbering in Silverlight

I'm looking for some comprehensive library for Silverlight on bullets/numbering. I've found a few, like Vector Light's RTB control, but most are lacking extended features of bullets/numbering that word processing programs have, like having the First Line Indent of a great value than the Hanging Indent (e.g. first line indent is 1 inch an...

How to center image in MultiScaleImage

Found the function which position the image(s) in the multiscaleimage... but I'm not sure how to get the actual image width (for single or multiple) and change the _msi.ViewportOrigin x param based on that. There are 2 lines which affect the image position... one is _msi.ViewportOrigin = new Point(0, 0); and the other is: //if (lay...