silverlight

Silverlight toolkit. Treeview drag and drop functionality

Why drag and drop doesnot work with my code: <toolkitDrag:TreeViewDragDropTarget AllowDrop="true" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BindingValidationError="TreeViewDragDropTarget_BindingValidationError" ItemDroppedOnSource="TreeViewDragDropTarget_ItemDroppedOnSource" ItemDroppedOnTarget="TreeVi...

how to convert silverlight datgrid to pdf?

how to convert silverlight datgrid to pdf? ...

MVVM light datagrid loading from two relational database tables

How to Load DataGrid with two related tables using MVVM light, I am using .NET RIA and silverlight 4. for example if my data tables are: userInfo- userID, Name, AddressID Address - AddressID, StreetName, Zip how can i create datagrid that displays [Name, StreetName, ZIp] ...

Cannot cast anonymous return type from query to an entity type

I'm struggling with a (usually simple to deal with) problem. I have a database containing a "measurements" table. Each measurement has a timestamp (datetime), a value (decimal), a measurement type (foreign key to a lookup table) and belongs to a "capacity item" (a master table). I imported the SQL database in Entity Framework and creat...

DataGrid.LoadingRow event firing three times

I have a HyperLinkButton in every row of a datagrid in my silverlight app. I need to fire an event so I am adding a handler to the click event of the HyperLinkButton in the DataGrid.LoadingRow event. The problem is the event is firing three times (more accurately, the handler is being added three times. I tried removing the handler be...

Silverlight - Can't get ListBox to bind to my ObservableCollection

I'm trying to make a ListBox that updates to the contents of an ObservableCollection whenever anything in that collection changes, so this is the code I've written for that: xaml: <ListBox x:Name="UserListTest" Height="300" Width="200" ItemsSource="listOfUsers"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock T...

Inherit from visual statemanager

I have two user controls. One inside the other. I want to have a mouseover visual state in each. I want to change the visualstate to mouseover on the parent and also have it fire for the child. What is the best way to accomplish this? ...

sending a list from asp.net to Silverlight application

I have a list of object that is created in my asp.net website project, I need to send it to my silverlight application which is a part of the same solution. How can I do this? ...

Reverse highlight in silverlight

I have an items template and I want to highlight some text in a dark color. The problem is that the text starts out as black so I can't read it when it is highlighted. What is the best way to turn the text white or reverse highlight it when my mouse goes over the parent border (that is the highlight element) ...

Dispatcher.Invoke with anonymous delegate works in Silverlight but not WPF

In Silverlight 4 I have a custom service class which has an asynchronous Completed event. Inside the Completed event I take the returned data and invoke a populate method via something like this: private void service_Completed(object sender, CompletedEventArgs args) { Dispatcher.BeginInvoke(() => populateInbox(args.Jobs)); } priva...

Removing left and right border sides from listbox datatemplate

Currently I have specified borders for all datatemplated items in my horizontal listbox which is fine because I DO want borders for all individual listboxitems, but I would like to remove the left border from the first item and the right border from the last item. Is this even possible? Xaml: <ListBox.ItemTemplate> <DataTemplate> ...

Why doesn't this Silverlight 4 DependencyObject's DependencyProperty getting data bound?

I have no idea why data binding is not happening for certain objects in my Silverlight 4 application. Here's approximately what my XAML looks like: <sdk:DataGrid> <u:Command.ShortcutKeys> <u:ShortcutKeyCollection> <u:ShortcutKey Key="Delete" Command="{Binding Path=MyViewModelProperty}"/> </u:ShortcutKeyCollection> </u...

Multiple "sibling" controls, one-at-a-time visible, MVVM

I've got what I think is a fairly simple problem in Silverlight, and I'd like to solve it using MVVM principles, largely as a way of enhancing my own understanding. Let's say I have a simple LOB app that's designed to let me load up and edit a single Employee (just an example, for the sake of explanation). In my example, Employee is mad...

how to convert a databound zero double value to an empty string?

Hi Guys, I have this Payment object public class Payment { public Guid Id { get; set; } public double Amount { get; set; } } which is data bound to a TextBox <TextBox x:Name="_AmountTB" Text="{Binding Path=Amount, Mode=TwoWay}" /> I require that whenever the Amount is 0, then I don't show anything in the TextBox, how can...

Is it possible to get other collection than IEnumerable<T> when using LINQ: XML to object?

So I have this huge XML file that I am converting to an object by using LINQ. And currently I am doing: var resultStories = from story in resultXML.Descendants("story") select new NewsStory { ArticleFrequency = from tag in story.Descendants("tag") ...

How to determine which node was clicked. Silverlight treeview

How to determine on over which node click was performed? Treeview from silverlight toolkit. In MouseRightButtonUp i need to get node: private void treeView_MouseRightButtonUp(object sender, MouseButtonEventArgs e) ...

prevent screen capture

i am developing a video player i silverlight i wanna something to prevent recording or screen capturing i thought about hacking the windows APIs and stop my program from running if there was any of those capturing software asking the user to close it first but i donno how to do this is there another solution ??!!!! ...

How does Silverlight Background Worker update the UI thread without problems ?

Hi, I am using the Background worker thread in a Silverlight 4 application. In the ProgresssChanged event handler, I can make calls to the Silverlight UI, but how does this work ? Isn't the background worker thread that fires the ProgressChanged event on a different thread from the Silverlight UI thread ? If so, I thought updating th...

Silverlight 4 - binding between two datagrids, from blend 4

I have some issues with using databinding in silverlight 4 xaml pages, this is my problem: I have two data grids: <sdk:DataGrid x:Name="dgCodeCountry" Height="144" Margin="41,56,39,0" VerticalAlignment="Top" AutoGenerateColumns="False" ItemsSource="{Binding Collection}" > <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding=...

Best way of reusing UI objects/code across pages (Silverlight 4, C#)

Ive been staring at my code too long and need a kick in the right direction please. In my poker chip calculator I have multiple pages (currently only "Chip Calculator" is visible on that link). Each page has a menu at the top (the one on the top left below the nav tabs) which has actions local to that page (e.g. Load/Save chipset on the...