silverlight-4.0

How to create custom composite control derived from the FrameworkElement

Can you give me an example how to create custom composite control (in Silverlight 4) which derives directly from the FrameworkElement. Here is a mockup: public sealed class CompositeImage : FrameworkElement { private readonly List<Image> images; public CompositeImage() { images = new List<Image>(); images.Ad...

Silverlight DataGrid makes the first selection when ItemsSource is Set, how can turn this off?

Hi Guys, I am using Silverlight 4 DataGrid with DataPager. When the DataGrid's ItemsSource is set, it selects the first row in the list. PagedCollectionView _list = new PagedCollectionView(myDataCollection); _dataPager.Source = _list; _dataGrid.ItemsSource = _list; The problem is that I have _dataGrid.SelectionChanged event, which ...

SMTP Error: Failure Sending Email

I've downloaded a sample application sending email silverlight application here via gmail. But I cant make it work. Its error is "Failure sending mail." {"Failure sending mail."} [System.Net.Mail.SmtpException]: {"Failure sending mail."} Data: {System.Collections.ListDictionaryInternal} HelpLink: null InnerEx...

Silverlight 4 and Newtwok Tracing

I want to use Network Tracing with Silverlight, however, I am not quite sure how to enable it. The MSDN documentation explains that some configurations should be added to the web/app config file. Unfortunately, Silevrlight apps do not use config files, at least the latter are not available in the list shown when add new item is pressed o...

Silverlight MVVM and ViewModel Lifecycle

I'm working on a Silverlight 4/RIA services app, and I'm wondering when ViewModels are unloaded on the client. Specifically, I need to know if additional clean-up is necessary when a user logs out (I don't want another user to log in before the app is unloaded in the browser and potentially have access to data they shouldn't). My und...

How to set a TypeConverter on an attached dependency property in Silverlight ?

Hi, My goal is to be able to write this in XAML: <Grid> <Rectangle Fill="AliceBlue" myCore:MyTimePanel.BeginningDate="03/03/2010" /> </Grid> Problem : Silverlight XAML can't parse a DateTime from a string. So at runtime I have the XamlParseException "can't create a DateTime from that string". When I use a...

Silverlight Combobox loses visual value, but keeps selected value when the page it's on is hidden and reshown

I'm using a Silverlight 4.0 project that utilizes MVVM and we have a combobox that resides on a view and has its values and selected value bound to an observable collection of Organizations and a SelectedOrganization respectively (both values exist on the viewmodel). With our project the page that this control is on can be hidden or sho...

Silverlight 4 and RIA services

I am using Silverlight 4 and RIA services. I have a class called Request and it contains properties some of which are objects. The objects of the main class are not being created in the metadata class on the Silverlight client. I have already included the [Include] attribute over the objects on the server side. What am I doing wrong? ...

How to bind KeyUp/down to a button Click event?

Suppose I have usercontrol with textbox, combobox, button,... inside this control. Button1 is bound to a ICommand in view model. My request is: when user hit Enter key in any field, like any textbox, combobox, it will fire Button1 Click event, so that ICommand will be called. How to implement this? ...

How to fire a button Click event in code behind in user control?

is it possible to fire a button Click event in code behind in user control? ...

RIA services - is filtering done at the server or client?

Lets say I have some code like: ExampleDomainContext ctx = new ExampleDomainContext(); var query = from p in ctx.GetPeopleQuery() where p.Id > 2 select p; ctx.Load<Person>(query).Completed += (s, e) => { // do some stuff }; This is being done on the client, and the GetPeopleQuery() call from the RIA servi...

Silverlight scrolling text & max width issue

I am trying to scroll text across the screen which is working well. Update: I'm still stuck with problem and can now demonstrate it on my live app: Go to http://www.pokerdiy.com/poker-blinds-timer.aspx and leave it non-fullscreen. Click on the "Timer" tab at the top. Then click on "Start Tourney". At the top, a scrolling message wil...

MainWindow.Closing event not always raised in Silverlight 4 OOB app

I've made a rather complex Silverlight 4 out-of-browser application. One of my main view models adds an event handler to the Application.Current.MainWindow.Closing event. This works fine when the application is initially run. It is able to cancel the close operation. However, sometimes after performing operations like showing and closin...

How are the XAP files structured?

Questions: Are XAP files self-contained? Do they link in all DLLs I have referenced in the project? If I need to distribute my app, is all I have to do is hand someone the XAP file? ...

silverlight app realtime update design

I have a winform app, which takes live image from an ip camera, and detect vehicle license plate number from the image. Now i want to make a silverlight app which can connect to my winform app or some kind of service app, and the silverlight app gets updated whenever a new license plate number is detected, what service/architect should i...

NAudio on Silverlight

Is it possible to use the NAudio on a silverlight application? I just can't add the dll to my project... I'd like to build a little audio mixer. I already searched on google but i can't find a way to do that... someone has some hints for it??? ...

Issue Hosting Silverlight Application on IIS 7.5

Hi, I have an ASP.NET web application (.NET 4.0) that has a few pages, one page with a silverlight application in it. When I debug locally, the silverlight app works fine. When I deploy to my web server (Windows Server 2008 R2, IIS 7.5), the silverlight app will not display. I get an exception in Application_Error saying the following...

Windows phone 7 Logon Screen

What is the best way to make password/logon screen? Iread somewhere that it is better to use a popup control. If so where exactly do I need to create it, in App.xaml? ...

How to trigger an animation when row is added to Silverlight DataGrid

I am displaying a list of recently processed items in a Silverlight DataGrid. I really want to add a highlighting animation for newly added rows so that users would immediately notice that something did happen in the application. How can I trigger my Sotryboard so it is played when new item is added to the ObservableCollection backing t...

MEF. How to clean up the default container?

I'm trying to implement Logout operation in my Silverlight client. During Login operation, MEF initializes DefaultContainer with instances of the [Export]-ed singleton classes, which contain user-specific information (like password). Is there a way, to re-initialize/reset/drop MEF infrastructure/DefaultContainer like it was never initi...