Csharp - DevCorner

Browse by Tags

All Tags » Csharp (RSS)

DevAcademy 4

DevAcademy 4 is coming at March 22, at Airport City near Lod (local event). Come and see me presenting new features of Silverlight 4! At this session I’ll new line of business (LOB) related features of Silverlight 4, improved out of browser model, native automation and much more. Great time and many cool samples involved.   My session is: What’s new in Silverlight 4   Other sessions list (draft) is here . Registration is open! Register here . Hope to see you there! Alex

Silverlight 4 Tutorial @SDP

My Silverlight 4 Tutorial day at SDP is over. I’d like to thank all participants!!!   As promised, here is source of application I’ve build during the session. Additional samples here and here . Labs could be found here .   See you at Silverlight 4 session tomorrow :) Alex

Silverlight 4: New features overview (Part 5) – DataBinding improvements

Silverlight 4 introduces improvements in DataBinding. between the improvements are IDataErrorInfo support, ability to bind to DataObjects, StringFormat, TargetNullValue, FallbackValue support and many others. This post will show how to use StringFormat, TargetNullValue and FallbackValue while databinding. For show the new features I’ve created sample application –> it will display values bounded to number of DependencyProperties defined in code behind. In code behind I’ve created number of Dependency...

Silverlight 4 Quick Tip: Styling application

Silverlight 4 supports default styles. Default styles are styles with TargetType, but without x:Key property set. Those styles will be applied to all controls from corresponding type. The sample of default (also sometime called anonymous) style: < Style TargetType ="Button"> < Setter Property ="Margin" Value ="5"/> < Setter Property ="Width" Value ="100"/> < Setter Property ="Height" Value ="25"/> < Setter...

Silverlight 4: New features overview (Part 4) – Out-of-browser applications: even more features

In addition to previous features, Silverlight 4 adds some more nice improvements to Out-of-Browser model. Now it allows to control Top/Left position of the out-of-browser window, bring it to the foreground (if not active), check if the window is topmost and define it’s Width/Height. All those features being exposed by MainWindow object of Application: Additional feature is Notification Window. It is a notification area that is displayed in the system area, at the bottom right part of the screen....

Silverlight 4: New features overview (Part 3) – Elevated Out-of-browser applications

Silverlight 4 enhances the out-of-browser feature introduced in previous version of the technology. Silverlight 3 added a feature to use application in Out-of-browser mode – install application shortcut to desktop or start menu, and launch it within application launcher (instead of the browser). Along with it, the application still was sandboxed application, with the same set of restrictions, like in browser. Silverlight 4 extends this feature and allows to relax some of the sandbox restrictions...

Silverlight 4: New features overview (Part 2) – Printing Support

In previous part (here) I’ve created sample application which uses Webcam and captures the image. In this post I’ll show how to print received image (and any part of the UI) to a printer. In Silverlight 4 we got new class, called PrintDocument which is a part of “System.Windows.Printing” namespace. This class provides a number of events, which helps to control the printing job: StartPrint – occurs right after printer selection dialog successfully returns, prior the first page print PrintPage – occurs...

Silverlight 4: New features overview (Part 1) – Webcam/Mic Support

This post starts a series of post about new features in Silverlight 4 Beta released at PDC 09. Today I’ll show how to use Webcam/Mic support feature in the new version. In order to use the Webcam/Mic the user should has valid drivers installed. To see which from installed drivers could be used open Silverlight Configuration and select 4th tab: This tab also allows to select default webcam/mic to use with Silverlight applications. Webcam/Mic controlled by CaptureSource class. This class allows to...

Silverlight 4: What’s New?

Today Microsoft announced new version of Silverlight, and released the Beta version of Silverlight 4. Here is the summary of new features in this version: Better Out of Browser Applications Elevated Privileges Support Cross Domain Networking Access Full file path from Open/SaveFileDialog No User-Initiation Requirement for Full Screen, Open/SaveFileDialogs COM interop HTML Hosting Support Media Enhancements WMS Multicast Support Mp4 Playback Protected by PlayReady DRM Offline DRM Output Protection...

PDC09 Day 1 – Dynamics in C# 4

Switched to the Dynamics in C# 4 session. This session hall is not full at all… I’d rather say it is pretty empty… Probably this session is for real technology geeks like me :)   Did you know, that you cold create your own dynamic object by deriving from DynamicObject base class? class Program { static void Main( string [] args) { dynamic d = new myDynamic (); Console .WriteLine(d++); } } class myDynamic : DynamicObject { public override bool TryUnaryOperation( UnaryOperationBinder binder, out...

Silverlight Tip: Enumerating embedded resources

Today I’ve got a “Call for Help” from one of Silverlight MVPs – Bill Reiss . The mail said: “I would like to enumerate all items that were marked as Content or Resource in the main XAP file. If I can’t do both I’d settle for one. Any sample code for this would be greatly appreciated. Bill”   I decided to help with embedded resources, because I did something like this in WPF. I’ve created sample application, which will display a list of resources in list box – from here it is very easy to use...

Silverlight Quick Tip: ChildWindow Title Customization

Today I discovered nice feature of ChildWindow control in Silverlight 3. I was at client’s location and been asked about the ChildWindow title customization with an icon. I had to admit, that I never tried to put something different than text and immediately looked at the type of Title property. For my surprise I found that the property is an “object”, and assumed that it could behave as a ContentPresenter/ContentControl. After 5 minutes I had the client’s request solved: My code is very simple:...

WPF Quick Tip: How to get WPF Window client area size

This time my quick tip will be not about the Silverlight, but about WPF. When you have WPF window, the runtime size of it could be discovered by ActualWidth/ActualHeight properties. In most cases this is enough. But what about the case, when you need to perform some mathematical calculations based on the real size of client area? What is this client area? Well, the second question is really easy one – the client area is the area available to user defined UI (controls, panes, etc.): At the screenshot...

Silverlight Quick Tip: Dynamically Updating Class Fields/Properties

In previous post ( here ) I blogged about displaying values of class/control in runtime and displaying them in Visual Studio - like property window. Today I’ll show how to push them back to the class instance. In previous post I’ve stored values in “ObservableCollection<FieldsPropertiesData>” for easy databinding and connected this ListBox control. In order to get user input I’ve created TwoWay databinding in DataTemplate – here is updated data template: < Style TargetType ="local:FiledPropertyData">...

Silverlight Quick Tip: Dynamically Displaying Class Fields/Properties

In one of my projects I had to create something like Visual Studio property window, for data set of different controls/data classes. Those controls/classes are still under development and I needed the way to display/change values of those properties dynamically without even knowing what is inside. For the simple case, let’s assume the following class which holds the data: public class SampleData { public SampleData() { BooleanProperty = false ; } public string StringProperty { get ; set ; } public...
More Posts Next page »