DCSIMG
C#,.NET 3.5 - Alex Golesh's Blog About Silverlight Development

Browse by Tags

All Tags » C# » .NET 3.5 (RSS)

Thoughts about application packaging, Resources, MVVM and others

I thought a lot before decided to write this post… First - I’d like to thanks Ariel Ben Horesh for “inspiring” me to write this post and for dedicating so much time to write his post! After reading his post I thought a lot and my thoughts about the post are the follows: 1. First, I thought about the applications and the way to provide user with best experience while loading those applications… The users shouldn’t wait minutes for application to download… While authoring large Silverlight applications...

Silverlight 4 @WDC

Thanks for all participants at WDC monthly meeting! I really enjoyed to present Silverlight 4 before such nice audience! I really enjoyed the Q&A session ah the end of the meeting. If you have more questions – keep them coming! As promised, I’m posting the links for demos and presentation for your convince. Presentation slides are here . You could see them online (guess what – pure Silverlight presentation) at my home page: http://www.devcorner.info/   Demo #1 – Webcam, Printing, Install...

Silverlight 4 Available

Silverlight 4 finally here!!! It works with Visual Studio 2010 RTM ! All downloads you need to start developing great line of business applications: Silverlight 4 Tools for Visual Studio 2010 Blend 4 RC here Silverlight 4 Toolkit (April 2010)   For those who are in Windows Phone 7 development : Do not install this build ! If you need to develop for Windows Phone 7 stay with Silverlight 4 RC build and Visual Studio 2010 RC. The update for Windows Phone 7 tools is not ready yet and will be available...

Silverlight at Windows Phone 7

Microsoft announced today, that new Windows Phone 7 Series will support Silverlight as one of 2 development frameworks. Second development framework will be XNA (will blog about it later). So, what’s new for Silverlight developers there? First, we have familiar tools: Windows Phone applications with Silverlight will be developed either with Visual Studio 2010, either with new “express” version called Visual Studio 2010 Express for Windows Phone. This “express” version will enable development with...

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: How to get localized resources from RESX file in code behind

It looks like I’m using too much resources and localizing too much applications lately :) This time I’ll show how to use localized resources from the RESX files. Here I already explained how to create the RESX files for Silverlight (by the way the article is relevant also for Visual Studio 2010 Beta 2 & Silverlight 3), and how to use those resources from XAML. In some cases, though, it is needed to use those resources from code behind. In my scenario I had to create value converter, which converts...

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...

Silverlight Quick Tip: Resources in RESX files – Image Resources for Localization

This post was actually born in the middle of previous post :) I had to find the way to use images as a RESX resources – this actually was second question of the person who asked me about forcing the rebinding . Before starting, some theory about RESX usage in Silverlight. Silverlight support usage of RESX files and localization via “SupportedCultures” attribute in CSPROJ file. The attribute itself even exists in project created with Silverlight 3 Tools, but for some reason there is no interface to...

Silverlight Quick Tip: How to force re-binding

Today I’ll show how to do “dirty trick” to force re-binding and as a result UI value updating. First of all – the reasonable question – “Why force rebinding? Why not use INotifyPropertyChanged mechanism?” This was my questions also, but the person who asked the question had his reasons: he is using resources (Resx) to localize the application and bind the UI to those resources. Also UI gives user an ability to change the language (and code behind does it by changing CurrentThread.CurrentUICulture...

Silverlight 3 Quick Tip: Analytics

Silverlight 3 has new feature which should help us to understand how good our application performs. This feature is Analytics class. It Has 2 read-only properties AverageProcessLoad – average CPU used by this process across all the cores AverageProcessorLoad – average CPU usage across all cores In addition it has GpuCollection collection with objects of GpuInformation type. Each one of GpuInformation object provides information about: DeviceId – device ID of the GPU VendorId – vendor ID of the GPU...

Silverlight 3 Quick Tip: Animation Easing and VSM

New version of VSM in Silverlight 3 got new interesting addition – ability to use Easing Function for visual state transition animation. To use it, set the property “GeneratedEasingFunction” to desired VisuaStateTransition element and provide it with class instance with implements IEasingFunction. From XAML: < vsm : VisualTransition GeneratedDuration ="00:00:10"                                ...

Silverlight 3 Quick Tip: Native Mouse Wheel Support

Silverlight 3 supports the mouse wheel events natively. To use this handy feature just subscribe to “MouseWheel” of UIElement. The reported values will be like follows: Positive for forward scroll Negative for backward scroll   Enjoy, Alex
More Posts Next page »