silverlight

How to disable mouse wheel scroll in listbox in silverlight 4?

I am not able to disable default behavior of mouse wheel scrolling in listbox control of silverlight 4 and apply my custom scrolling animation to listbox on mousewheel event. When I added my animation to mouse wheel event of listbox, first list box items get scrolled according to mouse wheel movement and then my custom animation to scrol...

How can you prevent Silverlight Client Http request from caching respones?

I am using a HttpWebRequest created from WebRequestCreator.ClientHttp.Create() to fetch data from a webservice. And everything seemed to be working fine until I found out the calls where being cached. I was pretty sure that the ClientHttp did not include caching, but after a bit of searching I found this little note: Client HTTP Pro...

Error Binding ContentControl to Image from Resource Dictionary

<Grid x:Name="ContentGrid"> <Grid.Resources> <Image x:Key="art" Source="art.png" Stretch="None" /> </Grid.Resources> <ContentControl Content="{Binding MyImg}" /> </Grid> public Image MyImg { get { return (Image)GetValue(MyImgProperty); } set { SetValue(MyImgProperty, value); } } public static readonly Dependenc...

Apply a style to TextBlocks within a ContentPresenter in Silverlight

If I have the following style defined: <UserControl.Resources> <Style TargetType="TextBlock" x:Key="ProblemStyle"> <Setter Property="FontSize" Value="40"/> <Setter Property="FontWeight" Value="Bold"/> </Style> </UserControl.Resources> Then when I have a ContentPresenter data bound to a string, in WPF I can get ...

Consuming Ruby on Rails SOAP services in Silverlight 4

Hello, I don't know how it is possible but services provided by Rails are different consumed in WPF and Silverlight. When I seek for ****.com/api/wsdl/ (it is Rails SOAP service) WPF generates all the methods, events etc. When I seek for the same URI in Silverlight I have only: [System.CodeDom.Compiler.GeneratedCodeAttribute("System....

Web Deploy Packages fail on build server

I am using the following MSBuild command form the command prompt: MSBuild.exe /nologo "Server.Website.csproj" /T:Package on a web application (ASP.NET 4 MVC) that relies on a project reference to a Silverlight project. When building, I get the following error: "C:\Builds\2\Development\Main Branch Nightly\Sources\Components\Server.W...

Add entity from child window causes Entity cannot be attached error....why?

I've got an order details form in Silverlight that has a listbox of order payments. The order payments are bound to their own domain datasource outside of the surrounding order. I have a button that pops up a ChildWindow control to add new order payments. An order payment has an amount and a payment method associated with it. The f...

Two-way bind a combobox to a simple string array.

I have a simple class that provides state codes like this: public class StateProvider { static string[] _codes = new string[] { "AL", "AK", ... }; public string[] GetAll() { return _codes; } } My model class that supports the view looks a little like this: public class ProjectM...

Is there a way to call Navigate from within the ViewModel?

I have a Silverlight 4 project which displays a chart and some buttons to allow the user to change the chart's date range. The date range can also be passed in via a query string parameter - something like http://myserver/MySilverlightPage/#?DateRange=OneMonth - and when the user clicks a button I'd like to update the Url as well. I u...

Silverlight strange bug with bitmap images and WebClient

I have strange bug with showing image in silverlight. The problem to show list of images that configured in xml file and this xml downloaded from server by WebClient type. WebClient client = new WebClient(); client.AllowReadStreamBuffering = true; client.OpenReadAsync(new Uri(path, UriKind.Relative), new GalleryU...

How do I load a treeview From RIA

I have a TreeView I want to populate it from RIA Entity Queries. Is this possible I have 4 Tiers. Each Table has ID Description ParentID x1 pdq x2 pdq x3 pdq y1 ABC x1 y2 ABd x1 y3 add x2 y4 ade x3 I want the data to be able to have this format. How do...

Can David Poll's CollectionPrinter handle grouping in a datagrid?

I've been working with David Poll's CollectionPrinter Control and have successfully printed reports which use a DataGrid to display the collection. Without using grouping in the datagrid it paginates the document normally. However, as soon as I activate grouping following his instructions in one of the first comments from the link above,...

Silverlight - How to navigate from a User Control to a normal page?

If I do this inside a User Control: NavigationService.Navigate(new Uri("/Alliance.xaml", UriKind.Relative)); it says this error: An object reference is required for the non-static field, method, or property 'System.Windows.Navigation.NavigationService.Navigate(System.Uri)' Thank you ...

Automating a Silverlight 4 OOB Application from Native Windows App

We are considering to offer our users an improved Windows integration while still not requiring full-trust by running a small native utility application on the same machine that would need to be able to communicate with the Silverlight 4 Application running OOB. Prefererably this communication would take place using the Local Connection...

Silverlight Application Hosting Requirements

Hi there, I want to build a silverlight web application that could installed on a user's computer. So any hosting requirements would be subject to whatever configuration the user has. What are there requirements to host a silverlight application? I need the same question answered for Flash and WPF. Can any OS be used? Is it required...

How to do simple hover button using 2 images in Silverlight

Preferably without using backend code? I'm looking for the cleanest solution for doing a fade in fade out hover button using 2 images. Here is what I have so far Edit: I got this to partially work.. problem is now that the mouseout seems abrupt whereas the mouseover seems fine, what am I doing wrong? <VisualStateGroup x:Name="CommonSt...

Silverlight ListBox with ObservableCollection<T> and dynamic filter

Lets say I have this class: public class MyData { public bool IsActive{get;set;} public String Data1 {get;set;} public String Data2 {get;set;} } and an ObservableCollection<MyData> data = new ObservableCollection<MyData>; ListBox.ItemsSource = data; Adding items to the ObservableCollectionworks as expected; however, I w...

using IsolatedStorageFile with Silverlight 4

Hey all, I am looking at writing a silverlight app that I plan to use OOB setting to enable use on both PC and mac. I have been doing a little investagation on the isolationstoragefile and what I understand is it will work for both pc and mac without a problem.....Is that correct? The application I am building is going to be a busines...

MVVM best practice around view logic in Silverlight

I am trying to get into MVVM and away from the code behind approach in Silverlight, and I want to know the best practices around how to invoke view logic. I have a very basic page where I have bound a listbox to a collection of domain objects, this is all using MVVM, so when I recieve my data back from the services, I want to fire off a...

silverlight 4 closeable tabs in TabControl

I have close button in the header of each tab of TabControl. Tabs are created dynamically in code and a datatemplate (in which the close button was defined) is applied. Now I want close-buttons to be visible only when tab is active. Is it possible to bind button's visibility property to tabitem's activeness (probably IsSelected property)...