silverlight

Detect via javascript whether Silverlight is installed

旧时模样 提交于 2019-12-17 20:19:10
问题 Is there a javascript function I can use to detect whether a specific silverlight version is installed in the current browser? I'm particularly interested in the Silverlight 2 Beta 2 version. I don't want to use the default method of having an image behind the silverlight control which is just shown if the Silverlight plugin doesn't load. Edit: From link provided in accepted answer: Include Silverlight.js (from Silverlight SDK) Silverlight.isInstalled("2.0"); 回答1: Include Silverlight.js (from

how to create Multiple user control that pointing single code behind file in silverlight 4

北战南征 提交于 2019-12-17 19:55:00
问题 I am creating a application, in which i have 2 user control, is it possible that, we have 2 xaml user control page and having 1 code behind xaml.cs file? 回答1: Start off by creating three files, first the "code-behind" .cs file is created as a simple class:- public class MyCommonUserControl : UserControl { } Note it has no InitializeComponent call. Now create a new UserControl then modify its xaml to look like this:- <local:MyCommonUserControl x:Class="YourApp.FirstMyCommonUserControl " xmlns=

Set Style for all elements inside ContentPresenter

左心房为你撑大大i 提交于 2019-12-17 18:58:31
问题 I overrided the template of wpf expander. The header has ContentPresenter <ContentPresenter x:Name="HeaderContent" Grid.Column="1" Margin="0,0,4,0" HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True" SnapsToDevicePixels="True" > <ContentPresenter.Resources> <Style BasedOn="{StaticResource Expanderheader-Naming}" TargetType="{x:Type TextBlock}" /> </ContentPresenter.Resources> </ContentPresenter> Where I tried to add my style for all TextBlocks inside. My style

Why change from WPF to Silverlight 4?

拈花ヽ惹草 提交于 2019-12-17 18:49:00
问题 I'm working on an application we made WPF instead of Silverlight as we wanted a full blown desktop application with the whole unique feeling and advantages that gives. However, with the announcement of Silverlight 4 I hear there is a buzz about Silverlight mostly being the preferred choice also for desktop applications. So; why should I consider moving my WPF application to Silverlight 4 - given that I still want a desktop application? 回答1: Keep in mind that Silverlight 4 is currently in Beta

Getting started with Silverlight development

谁都会走 提交于 2019-12-17 18:11:04
问题 How does one start development in Silverlight? Does one need a new IDE? or Visual studio will support? 回答1: Yes there is tooling support for Visual Studio. It is still in Beta though. Get Started Building Silverlight 2 Applications 1) Install Visual Studio 2008 then Install Silverlight Tools Beta 2 for Visual Studio 2008 This add-on to Visual Studio 2008 allows you to use .NET to create Silverlight 2 Beta 2 Web sites. The Silverlight 2 Beta 2 Runtime and the Silverlight 2 Beta 2 SDK are

Format Date/Time in XAML in Silverlight

被刻印的时光 ゝ 提交于 2019-12-17 17:42:20
问题 I have a Silverlight 4 application. I have a C# DateTime object that I'm binding to my UI. I want this DateTime to be in the format of dd/mm/yyyy time (TimeZone). For instance, today would be displayed as 04/07/2011 at 01:13 p.m. (EST) Is there a way to do this XAML ? Or do I need to build a converter? 回答1: <TextBlock Text="{Binding Date, StringFormat='{}{0:MM/dd/yyyy a\\t h:mm tt}'}" /> will return you 04/07/2011 at 1:28 PM (-04) 回答2: You can use StringFormat in Silverlight 4 to provide a

How can I render text on a WriteableBitmap on a background thread, in Windows Phone 7?

試著忘記壹切 提交于 2019-12-17 17:41:33
问题 I am trying to render text on a bitmap in a Windows Phone 7 application. Code that looks more or less like the following would work fine when it's running on the main thread: public ImageSource RenderText(string text, double x, double y) { var canvas = new Canvas(); var textBlock = new TextBlock { Text = text }; canvas.Children.Add(textBloxk); Canvas.SetLeft(textBlock, x); Canvas.SetTop(textBlock, y); var bitmap = new WriteableBitmap(400, 400); bitmap.Render(canvas, null); bitmap.Invalidate()

How can I render text on a WriteableBitmap on a background thread, in Windows Phone 7?

两盒软妹~` 提交于 2019-12-17 17:41:11
问题 I am trying to render text on a bitmap in a Windows Phone 7 application. Code that looks more or less like the following would work fine when it's running on the main thread: public ImageSource RenderText(string text, double x, double y) { var canvas = new Canvas(); var textBlock = new TextBlock { Text = text }; canvas.Children.Add(textBloxk); Canvas.SetLeft(textBlock, x); Canvas.SetTop(textBlock, y); var bitmap = new WriteableBitmap(400, 400); bitmap.Render(canvas, null); bitmap.Invalidate()

Silverlight WCF Proxy async only?

ぃ、小莉子 提交于 2019-12-17 16:57:18
问题 Why do the Silerlight-generated WCF proxy class(es) offer only async calls? There are cases where I don't really need the async pattern (for example in a BackgroundWorker) EDIT : Sometimes I need to process the results of two WCF calls. It would have been much simpler if I could have waited (the business of the app allows that) for both calls to end and then process.. but noooo.... async! :P 回答1: There's actually a technical reason you can't do sync calls, at least from the 'main' browser

How to make context menu work for windows phone?

女生的网名这么多〃 提交于 2019-12-17 16:53:23
问题 I am using ContextMenu from Windows Phone Control toolkit. Wondering how do I know which list item in the list is pressed? It seems I can know which context menu is selected but I have no way to know which list item is operated on. Please help. Thanks! <DataTemplate x:Key="ListItemTemplate"> <StackPanel Grid.Column="1" VerticalAlignment="Top"> <TextBlock Tag="{Binding Index}" Text="{Binding SName}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" /> <toolkit