silverlight-4.0

Multiple page printing in Silverlight 4 using Custom Printing Template (a User Control)

Hello everyone, I need some help on printing multiple pages with custom printing template. The printing template (a Silverlight User Control) consists of two Text-block's (Title and Content which displays and later prints the respective text). The problem I am having is its only able to print 1 page, how can I extend it to print multipl...

How to bind a Dependency Property to anything in the XAML

(Using Silverlight 4.0 and VS 2010) So I have created a property called Rank in my C# file. How do I now tie that to a control in the UserControl xaml file? My code: (TopicListItem.xaml.cs) #region Rank (DependencyProperty) /// <summary> /// Rank /// </summary> public int Rank { get { return (int)Get...

Silverlight scale transition during MouseOver event

Hello, I want a very basic transition when my custom User Control transitions between the Normal and MouseOver state. Very basic. If you visit the following website it shows this behaviour when you move your mouse over one the listed games. http://www.mashooo.com/SilverlightGames.aspx#Games What is the best way to achieve this? I ga...

Silverlight 4, SetBinding not working.

I want to bind the contents of a HyperlinkButton to a resource programmatically, it't not working. This is the code I have so far: HyperlinkButton Link1 = new HyperlinkButton(); Link1.Style = Application.Current.Resources["LinkStyle"] as Style; Link1.NavigateUri = new Uri("/Home", UriKind.Relative); Link1...

Concatenate styles in SL 4 / WPF?

Hello, How can I use several styles on a control? For example, I have a style that defines the size and margins for buttons, and several styles that define different color schemes. I would like to use the sizing style and a colors style on one control. Any hints are appreciated... Thanks. ...

Not getting DragEnter/Over, Drop events in silverlight 4 app

I'm dragging UserControl objects from one Canvas to another with the intention of dropping there. When mousing over the destination, the dragged object actually goes under it. I get no DragEnter, DragOver or DragLeave events. If I drop the object there, I get no Drop event. My root object is a border, then a grid. The grid covers th...

Adding resources into Silverlight application

I am trying to add resource dictionary into my silverlight-4 aplication (suggested in "Applying a View to a ViewModel" chapter of the http://msdn.microsoft.com/en-us/magazine/dd419663.aspx article). The 1st problem: I don't see any resource in my MainPage. Am I correctly understand that I need to add resource dictionary manually into Si...

Posting to Twitter from Silverlight 4 app

I wrote a method to post to Twitter using webclient. Everything works fine when calling the method from a console app. I migrated the method to Silverlight 4. Here is where the fun begins. After cleaning up the code, switching to an asynchronous method call, and getting rid of the red squiggled underlines, the code now runs inside my SL...

Validation in Silverlight 4

Hello, I want to know how to apply Validations on fields in SL4. I went thorugh the sample code given for Datagrid with Master-Details and DataForm implementation on http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html It has validations applied on all fields but no code is written. I want to apply suc...

silverlight4 tools for visual studio 2010 fails with the following error... HELP!

Hi, I am trying to migrate my silverlight applications from version 3 to version 4. I've been running into this problem. when i try to install silverlight4 tools for visual studio 2010 Visual Studio 2010 or Visual Web Developer Express 2010 or Visual Phone Developer Express 2010 that matches the language version of Silverlight Tools...

How do I perform hit test in TreeView for TreeViewItem?

I have a System.Windows.Controls.TreeView in my project, and when the user right click in it, I'm displaying a context menu. Since the context menu is built dynamically, I need to know the System.Windows.Controls.TreeViewItem that the mouse is hovering over. How do I do this? ...

How to save edits from ChildWindow in Silverlight 4

In my Master detail scenario I' have a datagrid binded to DomainDataSource as Master and and when the user clicks on a row, I opened up the ChildWindow where the user can make the edits to curently selected record. I'm not using the DataForm. My Question is How can I save the edits made by user from ChildWindow? Do I need to get the han...

Wherein lies the danger of obtaining file times in Silverlight?

Before uploading a file I need to salt the name with some additional information to increase the chance of the filename being unique (stateless-ly). Invoking FileInfo.LastWriteTime-get throws a SecurityException saying the process needs elevated priviledges. I can see to some extent that there exists certain historical information about...

How to show XAML inside a Tab Control in Silverlight 4

Basically what I am asking here is how to display a XAML page within a tab control that is part of another XAML page. Or, for that matter, if this is even possible. I want to be able to click a button on page1 and be able to view the page2 from within a tab control that is on page1. Would this be something to be handled within a Fra...

VisualStateGroup Triggering Animation in Another VisualStateGroup

There's something fundamental about VisualStateGroups that I'm not understanding. Everything I've read has led me to believe that they are orthogonal. That is, a state change in one group won't affect other groups. Indeed, they would be rather pointless if this were not the case. However, in an attempt to understand some odd behavior I ...

Programmatically setting a silverlight multi-select list box

Is it possible to programatically set the values of a silverlight list box when the selection mode is "multiple"? The "SelectedItems" property is not settable, and "SelectedIndex" only works when the selection mode is "single". ...

Programmatically reference items rendered by ItemsControl from code behind

I have a Silverlight user control that contains an ItemsControl that renders a StackPanel containing another user control for each item in the data source, the XAML is as follows: <Grid x:Name="LayoutRoot"> <ItemsControl ItemsSource="{Binding}" x:Name="ValuesItemSource"> <ItemsControl.ItemsPanel> <ItemsPanelTempl...

Reversing an animation in Silverlight on button press or any other event

Hi, How would I reverse a double animation in Silverlight on an event? For example, lets say I have an ellipse as a path and I am moving a shape along this path in an infinite loop. If I press a button, I want to reverse the direction of the spin (clockwise <-> counterclockwise). To be more specific, I am using the PathListBox object t...

Lookup Edit Column for DataGrid in Silverlight/Wpf?

Hi In windows app and also any data-Grid's Component, released for windows app, kind of column exist. That "Column-type" use for tables have relation(foreign_key) with another table and load one column from master table (have primary_key) Instead of itself (foreign_key)! So I want do same thing for data-grid in the silver-light and wpf.....

Problem displaying new image resource in Silverlight 4 app

Hi, I have a Silverlight application that I am working on. I have a few different custom button styles that use a ContentTemplate to display an Image as a Button, such as: <Style x:Key="CancelButtonStyle" TargetType="Button"> <Setter Property="Cursor" Value="Hand"/> <Setter Property="Template"> <Setter.Value> ...