silverlight

Is Silverlight's CollectionViewSource thread-safe?

I am trying to figure this out, given the following code, does the Refresh() need to occur on the UI thread? It seems to work, and I am wondering if the CollectionViewSource is actually a thread-aware / safe object? It definately has properties and methods to support calling on the correct thread, just not sure if that is left up to th...

How can I make a deep copy of an ObservableCollection<T> in Silverlight 4?

I want to make a deep copy of an ObservableCollection in Silverlight 4 in order to detect changes in the items in the list. Since ICloneable isn't available in SL how can I do this? OR - is there a better way to check for changes in the items in the collection? ...

WCF & Silverlight: How to go about without interfaces?

Hi All, Let me try to explain my challenge. I'm building a Silverlight app which will be using a WCF service. The WCF service returns a list of users and roles (and lots more but trying to keep it simple). In the SL app I need to fill several comboboxes with lists of users and roles. Usually I would use an interface to specify the ke...

Calling 3 web services async, and waiting for them to complete

In my silverlight page, when the user clicks on a button; the app, calls 3 web services async. It has to either wait for these 3 async calls to be completed or has to be notified when these calls are completed. After these 3 calls are completed, the results will be written to a text file (It is a out-of-browser app with elevated trust). ...

Silverlight UI element's 1-time binding to nested non-dependency property fails

I want a 1-time databind between a checkbox (IsChecked propety) in a childWindow and a nested member variable in it's DataContext object, such that only the initial IsChecked property is set by the member variable. The member variable (binding source) is not INotifyPropertyChanged or marked as a DependencyProperty- but I think that is ok...

Is there a XAML style snippet site?

Are there any decent resources for XAML style snippets? I've not seen too much love on some of the other snippet sites for xaml. Styling might be easier with Blend....but I don't have blend. ...

MVVM-light + RIA Services best practices

I would like to start a collection of MVVM-light (w/ RIA Services) Best Practices. There are a number of items I have found to be helpful best practices or best approaches, but would like to hear from others using the MVVM-light toolkit and see what they have found as well. Please post your best practices as answers to this question....

Saving webcam Snapshot silverlight to jpeg

Hi, Ive a Question (im really new in silverlight). Using "saveFileDlg.SafeFileName.ToString();" i can get the name of image file test.jpeg, but how i can get the full path "c:\images\test.jpeg" OR how i can put in the source code an static path as "c:\images\". I aprecciate very much your help, coz im developing an access control appl...

Exposing properties to Intellisense in Silverlight

Hey SO, so I've got a custom control in Silverlight. Doesn't really matter what it is but its a big composite thing with a treeview, a slider, and some other junk. Now in the control we have an instance variable which is called defaultTemplate. It is of type DataTemplate. Basically its the template that the TreeViewItem's use as their h...

Cast an Object to a generic class when the generic type isn't known

In a Silverlight project, I've got the following class defined. public class ThemeResource<T> { public string Name { get; set; } public string Description { get; set; } public Type Type { get { return typeof(T); } } public string TypeName { get { return Type.FullName; } } public T Resource { get { return (T)Applicati...

Windows Phone 7 App Quits when I attempt to deserialize JSON

I'm developing my first windows phone 7 app, and I've hit a snag. basically it's just reading a json string of events and binding that to a list (using the list app starting point) public void Load() { // form the URI UriBuilder uri = new UriBuilder("http://mysite.com/events.json"); WebClient proxy = new WebClient(); ...

Collection declared in XAML hangs Silverlight

I have been playing around with declaring objects in XAML. I have these classes in my Silverlight assembly: public class TextItem { public string TheValue { get; set; } } public class TextItemCollection { public ObservableCollection<TextItem> TextItems { get; set; } } Then, I have this in my XAML: <UserControl.Resources> ...

Trouble validating data in Silverlight 4 RIA services

Hello, I have a Silverlight 4 RIA services project that I'm working on and I'm unable to validate a Child Windows text input. I have a text box such as this one: <TextBox Height="23" Name="txtSummary" Width="Auto" Grid.Row="2" Grid.Column="4" Text="{Binding DocumentView.Summary, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidati...

How can you turn on word wrapping for all tool tips in Silverlight 4?

In my Silverlight 4 application I have some long tooltips. By default these tooltips appear one one very long line. For example: <TextBox Text="Test1" ToolTipService.ToolTip="One tasdg asdg as da sdg asdg asdg asdg asd gas dg a sdg a sdg a sd a sd g asdasdgasdg sadgasdgasdg asdg asdg asd as a sd g a sdg ...

Use right click context menu paste in silverlight (4.0) from clipboard to active control

I have a grid with a bunch of textboxes for input. I wanted to implement Paste functionality. To do this for one textbox I wrapping it in a grid, adding a contextmenu with Paste item, and in the click event I set that textbox's text to the Clipboard.GetText(). But then I thought perhaps the context menu should be in the larger grid co...

Why should I use a DataForm?

I'm on a Silverlight 4 + MVVM project using ASMX for services. I'm finding the DataForm to be cumbersome. IEditableObject, bindings, etc seem to be a pain. I've done some forms in my application without the DataForm and they've worked out really well. So I guess my real question is, what does the dataform give me that hand bombing a ...

Which is the best FREE DNN Chat Module

Because the official dnn chat module is very outdated ...

Reloading the same page passing another parameters

Hello. I'm developing a Windows Phone application. I have defined this on App.xaml: <nav:UriMapping Uri="/Destinations" MappedUri="/Views/Tourism/Common.xaml?Type=1"/> <nav:UriMapping Uri="/Points" MappedUri="/Views/Tourism/Common.xaml?Type=2"/> When the user is on Points, and I do the following: NavigationService.Navigate(new Uri(...

How do I have a method or property on the model in the server also get generated in the client?

I've got an application set up with RIA Services, Entity Framework 4, and Silverlight 4. It is set up in the standard fashion prescribed on MSDN here: Walkthrough: Creating a RIA Services Solution I've written a new method (or property) against one of the entity objects which resides on the server; I would like this method (or property...

Adding a Merged Dictionary to a Merged Dictionary

I can't seem to be able to add a merged dictionary to a collection of merged dictionaries within XAML. Theme.xaml <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Mine;component/Themes/Palette.Blue.xaml"/> <ResourceDictionary Source="/Mine;component/Themes/Template.xaml"/> </ResourceDictionary.MergedDiction...