silverlight

Setting the preferences in SIlverlight PrintDocument

I'm using PrintDocument in Silverlight. I'm printing the Silverlight DataGrid in Silverlight page. When I'm printing it only half of the DataGrid is getting printed....so Can I set the preferences for PrintDocument anywhere. I would like to print it as a Landscape type. Thank you. ...

why can't i find process class in my System.Diagnostics silverlight project VS 2010

i wanna use process.getprocesses() but it doesn't seem to be in my diagnostics class, why?!!! ...

Implementing flick or smooth ( or kinetic ) scrolling in Silverlight?

I need something like ListBox scrolling in iPhone OS (iOS). How can you implement flick/smooth/kinetic scrolling in Silverlight? ...

How to set width to 100%

I have a silverlight stackpanel and i want to set its width to 100%. i'm adding the stackpanel dynamically (C#) ...

Silverlight 3 namespace missing in Silverlight 4

I am putting a silverlight 3 video to practice in silverlight 4 as my pc doesnt have SL 3. This however doesnt seem to work the same way for Silverlight4. 1.) I couldnt find the dataform control in the same namespace System.Windows.Controls as mentioned in the video, had to get it by drag-dropping from exp. blend 4. 2.) The dataform ...

References to Controls in ContentControl are null at the Parent (Page) Level

As a follow up to this question where it was suggested I use a ContentControl, I have run into a scenario when I use a custom made class that dervies from ContentControl on a page, any controls defined within that ContentControl are not accessible from the page. All member variables turn out null. For Instance, say the custom class I cr...

Can't bind ICommand in VM to button Command in xaml

I create a VM based on MVVM light toolkit. In VM, there is a simple ICommand(RelayCommand) private RelayCommand _myCommand = null; public RelayCommand MyCommand { get { if (_myCommand == null) //set break point here for debug { _myCommand = new RelayCommand(() => ...

Using the WPF WrapPanel to Wrap and Right Align Text - WPF Bug?

I am attempting to use the WrapPanel and two TextBlocks to append an asterisk (*) to the left side of some text, allow the text to wrap, and force the text to be right aligned. I have successfully done so by creating a WrapPanel with the FlowDirection set to RightToLeft and adding my text, followed by the asterisk. However, if the text...

Accessing resources during initialization of control

...

Using Silverlight with C#?

Hello, I would like to get into programming with C# and Silverlight. I have read up a lot on WPF and like it a lot (from my narrow viewpoint) Here is the question I have: if I understand WPF principles correctly, then I can seperate UI from logic. I also can seperate logic from animation in my app (using Silverlight for animation...

How to get the character index in a Silverlight TextBox in a click handler?

Specifically, what I'd like is to have a user right-click in a TextBox, figure out and save the index position within the text where the right-click occurred, and then later insert some text at that position once the user makes a choice from the context menu that pops up because of the right click. The tricky part is getting the index p...

Recursive function in Silverlight

I have the following function in my c# silverlight application to find the total sub nodes of a node in the tree //get total children private int getTotalChildren(int id) { int total=0; for (int i = 0; i < persons.Count;i++ ) { if (persons[i].Manager == id) { ...

Using attached properties to

hello all, Is there a way to bind an image into a button so that the users sees an image and then the text. In the past I have done this using templates within the xaml however this time I have built the button using styles defined within a resource dictionary. I did this mainly because I wanted to content presenter text to change color ...

Building a dynamic TabControl in Silverlight

I would like to build a TabControl in Silverlight which is driven by a collection of objects. I'll show the code below of a VERY basic setup that I'm trying to prototype. MainPage.xaml <UserControl x:Class="DataDrivenTabControl.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.micros...

Silverlight 4: XamlParseException when trying to bind with styles and resources

Hi Everyone I am using Silverlight 4 and I am trying to integrate one of the themes from the Silverlight 4 toolkit from April. My App.xaml reads as follows: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Themes/System.Windows.Controls.Theming.Exp...

How to add data validation to Silverlight 4 master-detail MVVM bound form?

Hi all, I have a Silverlight 4 application using a master/detail type UI arrangement. There is a Silverlight 4 datagrid control bound to an ObservableCollection<T> property of a custom ViewModel class I have created. Below the grid is a detail section that shows the individual detail information for each row of the grid. Each of the ...

Determining the Enter key is pressed in a TextBox in Win Phone 7

Consider a XAML TextBox in Win Phone 7. <TextBox x:Name="UserNumber" /> The goal here is that when the user presses the Enter button on the on-screen keyboard, that would kick off some logic to refresh the content on the screen. I'd like to have an event raised specifically for Enter. Is this possible? Is the event specific to...

In Silverlight, how can I make a new pane appear when a button is pushed?

On my main window, I have several different buttons and fields that are already working. They are basically a calculator that hides the calculations from the user. However, I would like to add a button that says "How does it work?" and which slides a new pane in from the side when pressed. I am doing this on the Windows Phone 7 emulato...

Visual Studio installer project include Silverlight?

I have a setup project with a few items to install (Out-of-Browser Silverlight apps). The requirement is to create an installer with zero .NET dependency, that will install Silverlight if it doesn't already exist. It also needs to run completely offline. There doesn't seem to be a merge module or bootstrapper for Silverlight, and if I...

Bind TextBlock in DataTemplate (resource) to Content of checked radio button

I have a TextBlock in resource data template: <DataTemplate x:Key="MyDataTemplate" ItemsSource="{Binding MySource}"> <TextBlock x:Name="MyText" Text="{Binding ???}" /> </DataTemplate> that I want to bind with Content of checked radio button: <RadioButton GroupName="MyGroup" Content="Code" /> <RadioButton GroupName="MyGroup" Conte...