silverlight-3.0

Case sensitive UriMapper issue in Silverlight 3

寵の児 提交于 2019-12-06 06:13:19
In Navigation API of Silverlight 3 the UriMapper class is case sensitive. For the following uri mapping <nav:Frame Source="/Home"> <nav:Frame.UriMapper> <uriMapper:UriMapper> <uriMapper:UriMapping Uri="" MappedUri="/Views/HomePage.xaml"/> <uriMapper:UriMapping Uri="/entity/{code}" MappedUri="/Views/EntityEditorPage.xaml?code={code}"/> <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}Page.xaml"/> </uriMapper:UriMapper> </nav:Frame.UriMapper> </nav:Frame> the "/entity/123" is correctly mapping to "/Views/EntityEditorPage.xaml?code=123" but "/Entity/123" will fail with the "

How to call javascript function on a Silverlight 3 object?

南楼画角 提交于 2019-12-06 04:43:29
I have the following Silverlight control defined: <object id="objImageViewer" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="500px"> <param name="source" value="../ClientBin/SomeImageViewer.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <param name="windowless" value="true" /> <param name="initParams" value=" Username=<%= ImageViewerUsername %>, Editable=<%= ImageViewerEditable ? "1" : "0" %>,

How can I combine some UserControls in SilverLight?

吃可爱长大的小学妹 提交于 2019-12-06 04:32:27
Maybe it is a simple question, but I can’t find the answer. I have three User controls that are different only with colour. There is code one of them: <UserControl x:Class="SilverlightApplication14.NodePicture" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SilverlightApplication14"> <UserControl.Resources> <local:NodeViewModel x:Key="Children" /> </UserControl.Resources> <Grid x:Name="LayoutRootNodePicture" Height="100" Width="100" HorizontalAlignment="Center" DataContext="{Binding Source=

Take Screenshot of current user control or any GUI in Silverlight 3

百般思念 提交于 2019-12-06 03:58:01
问题 I would like to ask if it is possible to take screenshot of current user control programmatically and save as a file in silverlight 3. I found some ways to save as an image file for a Canvas in silverlight 3, but how about user control or childwindow ? Thanks, 回答1: Writable Bitmap will let you do it. See the samples and examples. 回答2: Not sure about silverlight 3, but in 4 it's done like this: public static byte[] CreatePngImage(this UIElement element) { WriteableBitmap screenshot = new

How to debug serialization error in tombstoned WP7 app

*爱你&永不变心* 提交于 2019-12-06 02:42:55
I am handling the current state of my WP7 app in the OnNavigatedFrom and To events so that if the app is tombstoned OR they navigate to a different page it saves the state to the inbuilt PhoneApplicationService state. I have a simple ViewModel which I dump to the state to make life easier. When navigate to a different page within my app, the state is stored fine and restores fine (ie. I assume it is serializing at this point). However, when I tombstone the app (i.e. Start button) I am getting an unhandled error with serialization and the stacktrace is not giving me any clues as to why it is

Is there anyway to change title of OpenFileDialog in Silverlight 3?

雨燕双飞 提交于 2019-12-06 01:21:00
I'm using OpenFileDialog in a Silverlight 3 application (sample code below). OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = false; dialog.Filter = "XML Schemas (*.xsd)|*.xsd"; dialog.ShowDialog(); It was a surprise to me that there's no such property like 'Title' to define Title of the dialog. So I wonder if there's a workaround allowing to set custom title for this dialog. Thanks in advance. No there is no work around (in SL4 either). Microsoft seem to have taken the approach (one that I think is quite sensible) of keeping APIs to this sort of sensitve thing (it allows

Silverlight: Find all controls of type in layout

家住魔仙堡 提交于 2019-12-05 23:31:41
问题 I'm looking for a reliable method to build a list of controls of <Type> contained in a specific <Panel> derived control - this includes those that are direct children, and those which are children of children and so on. The most obvious way was to just do it recursively: Add to list any children of this control of <Type>, then repeat function for any child of this control which is a <Panel> or descendant. However I'm concerned that this won't find all controls in the tree - any ContentControl

Bind ObservableCollection to a DataGrid after assigning new value

我与影子孤独终老i 提交于 2019-12-05 22:51:43
It seems to be a simple problem, but I can't get it to work. I have a UserControl with the following property: public ObservableCollection<HL7Message> source {get; set;} And the following Binding: <data:DataGrid x:Name="dgMessages" Grid.Row="2" AutoGenerateColumns="True" ItemsSource="{Binding source}" ></data:DataGrid> from a parent UserControl I set the value upon a button click: messagesGrid.source = src; //messagesGrid is the name of the UserCntrol above I'm expecting my DataGrid to be updated, but it's not. Can you please point at what I'm doing wrong? Auto-properties sadly do not support

How can I handle an event when pressed Start button (Windows Phone)

荒凉一梦 提交于 2019-12-05 18:10:31
How can I make an event when pressed on Start button (windows Phone) ? UPDATED If it is not possible, so how can I understand that user have pressed START button ? The Start and Search buttons themselves are reserved and do not generate events to third party applications. Having said that, two events will be generated when the user pushes the start button: A navigation event with NavigationMode being Forward and IsNavigationInitiator being false A PhoneApplicationService.Deactivated event However you cannot cancel the navigation using either of these events and they can occur for other reasons

Silverlight Loading Reference Data On Demand from a 'dumb' server

南楼画角 提交于 2019-12-05 17:39:42
I have a text file with a list of 300,000 words and the frequency with wich they occur. Each line is in the format Word:FequencyOfOccurence. I want this information to be accessible from within the C# code. I can't hard code the list since it is too long, and I'm not sure how to go about accessing it from a file on the server. Ideally I'd ideally like the information to be downloaded only if it's used (To save on bandwidth) but this is not a high priority as the file is not too big and internet speeds are always increasing. It doesn't need to be useable for binding. The information does not