silverlight-2.0

Silverlight Logging framework and/or best practices

梦想的初衷 提交于 2019-11-27 19:04:17
Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like enterprise library logging or log4net ? I'm interesting in something that can perform tracing client side and also log messages to the server. So far the only project I have found is Clog on CodeProject . Has anyone used this? What were your thoughts on it? I am about to delve into something similar myself for a product we've written. I'm considering using PostSharp for Silverlight to add client-side logging as an aspect. I have used the NLog project with

How to create a numeric textbox in Silverlight?

守給你的承諾、 提交于 2019-11-27 16:10:52
问题 As the title says really. I've had a look at inheriting from TextBox, but the only sensible override was "OnKeyDown", but that just gives me a key from the Key enum (with no way to use Char.IsNumeric()). 回答1: Take a look at NumericUpDown in the Toolkit http://codeplex.com/Silverlight and maybe you can use that or look at the source to implement your own numeric textbox. 回答2: I took Nidhal's suggested answer and edited it a bit to handle the shift case for the characters above the digits (ie.

How to correctly inherit from a usercontrol defined in XAML in Silverlight

戏子无情 提交于 2019-11-27 15:52:27
问题 If I have a usercontrol (in Silverlight) that I've written, that uses XAML to define it's appearance, how can I make a customised version of it? i.e. I have MyControl.xaml & MyControl.xaml.cs What do I need to do if I want a "SpecialisedControl" child class? I assume I just make a new code file, then inherit from MyControl. But what if I want to change the appearance of the base class - then what do I do? 回答1: I wrote this thinking you were talking about WPF, rather than Silverlight, but

Is there any difference in x:name and name for controls in xaml file?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 15:39:45
I am new in Silverlight. When I add some control to my xaml file with Visual Studio it set controls name with Name property, but there is also x:Name. Is there any difference and when to use each of them? Thanks. In Brief Yes there is a difference. The bottom line is that x:Name can be used on object elements that do not have Name properties of their own. A longer explanation You can only use Name on an element that represents an object that actually does have a Name property. For example anything that derives from FrameworkElement . The x:Name attribute may be placed on any element that

How does Silverlight Image Clipping work?

廉价感情. 提交于 2019-11-27 07:19:46
问题 I've got a very large image which I'd like to use for sprite techniques (à la css image sprites). I've got the code below: <Image x:Name="testImage" Width="24" Height="12" Source="../Resources/Images/sprites.png"> <Image.Clip> <RectangleGeometry Rect="258,10632,24,12" /> </Image.Clip> </Image> This clips the source image to 24x12 at the relative position of 258, 10632 in the source image. The problem is that I want the cropped image to show at 0,0 in the testImage whereas it shows it at 258,

Is there any difference in x:name and name for controls in xaml file?

我只是一个虾纸丫 提交于 2019-11-27 04:07:25
问题 I am new in Silverlight. When I add some control to my xaml file with Visual Studio it set controls name with Name property, but there is also x:Name. Is there any difference and when to use each of them? Thanks. 回答1: In Brief Yes there is a difference. The bottom line is that x:Name can be used on object elements that do not have Name properties of their own. A longer explanation You can only use Name on an element that represents an object that actually does have a Name property. For

How can I use non-Silverlight assemblies in a Silverlight app?

拥有回忆 提交于 2019-11-27 02:50:59
问题 I'm working an project (pure hobby, "Sharping my skills") which has one unified back-end and multiple front-ends (ASP.NET MVC 1.0/JQuery and Silverlight 2). When I try to add reference to my business layer assembly in the Silverlight 2 project (VS2008); It gets rejected, because it's not a Silverlight assembly. Is their a way to include and reference a non-Silverlight assembly in a Silverlight app? 回答1: No there is not. Silverlight runs on a completely different CLR which is incompatible with

Convert WPF Application to SilverLight

纵然是瞬间 提交于 2019-11-27 01:21:28
问题 Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort? 回答1: Not really. I have found some articles regarding the multi-targeting option for WPF and Silverlight at the same time. At this moment, if you are not using PRISM, it is quite a challenge to target both of them, fortunately achievable. What do you need to have in mind is that Silverlight uses a smaller (thus more limited) library than WPF. In response to the comments: Actually, there is

Silverlight Logging framework and/or best practices

时间秒杀一切 提交于 2019-11-26 19:43:54
问题 Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like enterprise library logging or log4net? I'm interesting in something that can perform tracing client side and also log messages to the server. So far the only project I have found is Clog on CodeProject. Has anyone used this? What were your thoughts on it? 回答1: I am about to delve into something similar myself for a product we've written. I'm considering

programmatically add column & rows to WPF Datagrid

↘锁芯ラ 提交于 2019-11-26 05:53:12
问题 I\'m new to WPF. I just want to know how should we add columns and rows programmatically to a DataGrid in WPF. The way we used to do it in windows forms. create table columns and rows, and bind it to DataGrid. I believe WPF DataGrid is bit different the one used in ASP.net and Windows form (correct me if I am wrong). I have No. of rows and columns which I need to draw in DataGrid so that user can edit the data in the cells. 回答1: To programatically add a row: DataGrid.Items.Add(new DataItem())