Infosys Microsoft Alliance and Solutions blog

Main

September 11, 2013

Dispatcher in WPF: Under the hood

I was skimming through some of my blogs that I had shared internally with my team and came across this one WPF Dispatcher. While as part of our work, we don't actively focus on WPF anymore, but I thought the concepts I explained here will still be very relevant for those who are still working with WPF.

Continue reading "Dispatcher in WPF: Under the hood" »

July 20, 2010

WPF - Disabled look for Button

If you check online forums, one of the issues that has caused possibly most grievances is the styling of the WPF button control. You set some property values for things like foreground color and background color and when you run the application things don't always work out. Either the button will show some default animation when having focus or will not use the specified background when is in disabled state.

Recently a colleague was styling a Button control and had a need for custom disabled look and we landed in the same problem. We had set a background color, but when disabled the button will default to the light gray color. Trying various options didn't work out. Interestingly the properties like Foreground or Opacity worked fine. The designer in us said that we can always create a custom style, but the developer in us wanted to know why this doesn't work.

Continue reading "WPF - Disabled look for Button" »

March 4, 2010

Size of a .net object

While trying to debug a service call, where we suspected a buffer overrun situation, we wanted to find out the size of the object being returned by the service call. However finding size of a .net object is not trivial and if you thought you could do a sizeof(object), then you are wrong. This will only return the size of the object based on the size of each field in object that itself is based on the type of the field. This doesn't returns the size of the object in memory with data loaded into it.

Continue reading "Size of a .net object" »

July 5, 2009

Getting File Audit Rules List

Earlier today a friend was trying to invoke GetAuditRules API on a file using c# code, but it was always returning a count of 0 inspite of having set a specific audit rule on the file via windows explorer. The surprising part was that GetAccessRules API was working and the code was running locally so it had full security rights as well.

Continue reading "Getting File Audit Rules List" »

June 11, 2009

WPF - Performing Conditional Validation

When we look at conditional validation needs in WPF, the typical option that people talk about is the usage of UpdateSourceTrigger property in binding expression. There are many examples that one can find on setting this to explicit and managing the validation or things like setting this to PropertyChange when validating textbox input without having to focus out of it.

However there can be scenarios where you can't use explicit since you want the normal two way binding behavior, but have a need to validate based on value of some other control. I had a similar scenario the other day where we had a combo box with yes/no options and the validation had to happen only if a value of "yes" was selected in the combo box.

Continue reading "WPF - Performing Conditional Validation" »

February 11, 2009

Multiple AppDomains and Loader Optimizations

In my earlier blog Working with Application Domains in WPF, I had touched upon the usage of LoaderOptimization attribute. In recent days I have been playing around with WinDBG and hence thought to see how this attribute really affected to loading of assemblies and memory consumption of the application.

Continue reading "Multiple AppDomains and Loader Optimizations" »

January 21, 2009

Comparing Objects for Equality

What do we do when we want to do something which we haven’t done before? Basic instinct of a developer says that Google and this is what I did. And what was i trying? Write a unit test case to compare two objects for equality. By equality here, I mean similarity of data present int he objects.The objects I had to compare had sub-objects, properties as lists and the usual primitive data type properties. Unfortunately .Net doesn't have any API which compares object for equality.

Continue reading "Comparing Objects for Equality" »

November 17, 2008

Handling Thread Exceptions

The other day someone asked "What is the best way to handle exceptions in a thread method and communicate back to the main thread?" The reason for the question is this - If you raise exceptions from a thread function (which is not the main thread) and if this is unhandled in the thread method itself, it causes an unhandled exception to be raised in the AppDomain and the application terminates.

Continue reading "Handling Thread Exceptions" »

September 22, 2008

Hiding from Debugger

When writing trivial get/set type properties, I have seen many developers still struggle during debugging since if they do a step into (typically F11), they end up going into the getter and setter methods as well.

Debugger related attributes have been available since early times, but somehow people seem unaware. Typically one can use DebuggerHidden or DebuggerStepThrough attributes, as shown in the following code snippet.

Continue reading "Hiding from Debugger" »

August 22, 2008

Reflector needs registration

There will be probably very few out there who haven't heard about Reflector and don't use it. Earlier today I noticed this blog that mentioned Red gate acquiring Reflector. I proceed to the mentioned site. I noticed that the latest version if 5.1.3 and I had 5.1.1. so I clicked the "Download your free copy now!" button.

Interestingly the tool may still be free, but laying your hands on it isn't that easy anymore. You are now required to register to download. This is a bit of a damper. I will eventually register and download the latest, but having to register to get the freely available tool earlier !! I don't like it.

July 10, 2008

WPF - Text clips on some Vista machines

I love mysteries. So when a project team approached me the other day with an issue with their WPF application, I immediately jumped into it. The issue they were facing was really mysterious. Their WPF application was working and looking fine on all their Vista machines, but when shared with Client, it started to have problems. Text in some controls was clipping.

After trying on multiple machines locally, they found 1 Vista machine where the problem was reproduced. The mystery was that all these machines were using same resolution (1024x768), same dpi (96) and same theme, but text would clip on that 1 machine and work fine on all others. They were about to write this off claiming some issue with Vista.

Continue reading "WPF - Text clips on some Vista machines" »

June 9, 2008

WPF - Bound property updates before Target property

Recently while answering a query on WPF forum, I found an interesting behavior. In case you have two way binding set on a property, the property to which you bind too, updates before the property to which the bound value is assigned. Check out discussion and a sample on this here.

This seems to similar to another behavior with ComboBox that i had described here.

June 5, 2008

WPF ComboBox SelectionChangedEvent

 When programming with the Combobox and handling its SelectionChangedEvent, you need to be a bit careful. The general expectation will be that when this event fires, the various properties like SelectionBoxItem or Text will give the new value, but that isn't the case.

The SelectedIndex does points to the newly selected item index, but the values of properties like SelectionBoxItem or Text still point to the old values and the new one selection hasn't really been updated. It is only after the event handler code that you write has completed execution that these properties update.

Continue reading "WPF ComboBox SelectionChangedEvent" »

May 13, 2008

WPF Label or TextBlock

Pre WPF days just had a Label control and hence there wasn't really a choice. Now in WPF you have Label and a new TextBlock control. I have been wondering on usually which one to use in the application when i hit upon this interesting comparison between the two by Josh. There is one additional difference mentioned in comments down below on that blog that talk about auto inversion of colors for TextBlock if it is part of say a ListItem. However to me it looked more like setting the Foreground to white, since when i tried with styling the item selection color to something else, the TextBlock still showed white color.

Honestly I am now left more confused. TextBlock is light weight and hence good from app performance perspective, but Label gives the access key functionality, something that people prefer to have in their applications. It will be really good to have this functionality extended to TextBlock.

What is it that you use in your applications and why? Comments welcome. 

April 28, 2008

WPF ObjectDataProvider vs Direct Object Use

When using object instances in XAML, there are two ways to use them. One is to directly create them as resources, assign and key and use where ever required and other is to embed them inside of ObjectDataProvider and then use.

I have worked with both ways and was curious to know the differences between the two and benefit of using one approach over another. I can across this old blog by Beatriz that explain this very well. Along same lines, here is some discussion on XmlDataProvider as well.

April 17, 2008

WPF makes Designers and Developers friends again

I have been playing around with WPF for a while and have been blogging about some of the technical aspects on it. However today I will like to touch upon another important aspect of WPF and that is designer-developer connect.

Having worked on Windows Programming using C++, MFC etc for a decade and working with the various controls, it is a real pleasure to see the capabilities now available to WPF developers. It is true to a large extent that with WPF and XAML and the tools like Expression Blend, designers and developers can work lot more closely than ever before. The working closely is more towards the ability for designers to style the UI for the WPF application and the developers to write the code for it.

Continue reading "WPF makes Designers and Developers friends again" »

April 11, 2008

WPF Data Binding

WPF data binding a very effective way to bind .net CLR objects to WPF UI controls and ensure appropriate updates (by proper use of binding mode and property change notifications). However it can become a bit tricky if not used properly. I recently found these interesting 10 points about WPF data binding. I am sure you would find them helpful as well.

April 10, 2008

WPF - Passing string to ConverterParameter

There are enough online sources that talk about how to buid and use custom Converters in WPF and also how to pass parameters to these converters. However for some reason, all these examples tend to either use a single integer or a single word string. So recently when I had a need for passing a sentence as parameter, I was confused.

Fortunately the simple trick of using single quotes inside of double quotes to provide strings worked in this case as well. Following are two ways you can pass a string that has multiple words to a converter.

Continue reading "WPF - Passing string to ConverterParameter" »

April 4, 2008

WPF - Binding to Image Control

Overtime, I have used different approaches to binding pictures to Image control in a WPF application. I have seen various questions on the WPF forum as well on this topic. The information is all available out there, but scattered. Hence, I decided to create a sample application to demostrate the various scenarios that can exist when you need to use the Image control to display pictures.

Continue reading "WPF - Binding to Image Control" »

April 3, 2008

ASP.NET AJAX Perils

ASP.NET AJAX is come a long way since its inception a few years back and my personal take it is that it in a hype cycle right now, where everyone is trying to jump on-board and create AJAX based applications. Needless to say that it has its own benefits, but there definite downsides to it as well. You can read a set of 10 important aspects around AJAX here.

It is known that though it gives a flicker free UX, the under-the-hood story tells a different tale. Having read about it, some days back, we did a small experiment to really see the kind of differences one can get with different approaches and you can read about our findings in this report (Download file). The scenario we took is very simplistic, but the results are still eye-opening.

March 26, 2008

WPF - Updating XmlDataProvider when source XML changes

Some days back i had answered a question on the WPF Forum on how to ensure that when the base XML file changes, the XmlDataProvider is udpated and hence the bound control on the UI.

The key is to set a watch on the particular XML file for changes and then update the provider appropriately. See details here. This solution works fine, but I didn't particularly like my initial code that I wrote since the FileSystemWatcher was set externally. It would be better if this could be self contained within the XmlDataProvider itself.  

Continue reading "WPF - Updating XmlDataProvider when source XML changes" »

March 18, 2008

Expression Blend issue with WPF Data binding debugging

Some days back I had pointed to the blog by Beatriz on how to debug WPF data binding errors. I have been using the PresentationTraceSources.TraceLevel feature (available with .NET 3.5) since then and have found it very easy to use and very effective in resolving my data binding errors.

However recently when I opened a XAML, which had this debugging feature enabled, in Expression Blend 2.5 March Preview, I got an error. The XAML won't open in designer and showed "Invalid XAML" with details as 'The member "TraceLevel" is not recognized or is not accessible'.

Continue reading "Expression Blend issue with WPF Data binding debugging" »

March 12, 2008

WPF TextBox Memory Issue

Some days back, I had blogged about this issue and suggested how to set global style to counter this. However it turns out that with that you may run into 'Cannot use UndoService while it is disabled' related error. To address that, you will need to modify the style using a DataTrigger as below.

        <Style TargetType="{x:Type TextBox}">

            <Style.Triggers>

                <DataTrigger Binding="{Binding Path=IsLoaded, RelativeSource={RelativeSource Self}}" Value="True">

                    <Setter Property="UndoLimit" Value="0" />

                </DataTrigger>

            </Style.Triggers>

        </Style>

MS has accepted the behavior behind this as a bug. Read more discussion on this here.

March 10, 2008

WPF XmlDataProvider, Working with External XML Files

Recently on the WPF Forum I came across an interesting problem about use of XmlDataProvider in XAML and its ability to load external XML files. It took a bit of a struggle, but eventually I did manage to get it working. Here I will try and explain it in some detail so that others can also benefit.

We all know that one can easily bind to inline XML in XAML or can load that from external file. If working with inline XML, you usually use XData to specify the XML file content.

Continue reading "WPF XmlDataProvider, Working with External XML Files" »

March 6, 2008

Expression Blend 2.5 still has some issues with Globalization

Last week I had blogged about an issue with Expression Blend Dec 2007 Preview when working with Globalization and Localization. Yesterday at MIX 2008 Microsoft has launched Expression Blend 2.5 March 2008 Preview along with SilverLight 2.0 Beta. For a list of all the products announced during MIX check here.

With the new version of Expression Blend available, I went ahead and upgraded my machine with it and decided to give it a shot for the Globalization issue I had faced earlier.

Continue reading "Expression Blend 2.5 still has some issues with Globalization" »

White paper on Monitoring Workflows with WF

Last week a white paper on Monitoring Workflows with WF authored by our architects (Ganesan and Prashanth BG) was published on MSDN at http://msdn2.microsoft.com/en-us/library/cc299397.aspx.

Few other white papers authored by our architects were also published last year on MSDN

Integration and Migration of COM+ Services to WCF by Ganesan and Sripriya at http://msdn2.microsoft.com/en-us/library/bb978523.aspx

BizTalk Server and WCF integration by Atul, Amit and Jitendra
http://msdn2.microsoft.com/en-us/library/bb973215.aspx

Well, Ganesan authored those papers while he was with Infy!

Please let us know any specific feedback or comments on the papers through this blog.  

March 1, 2008

WPF - TextBox memory leak issue

Earlier today on the WPF Forum I hit upon this issue about memory leak in TextBox. MS has responded saying it is by design. I am not entirely convinced as to how consuming unlimited memory could be a good design decision. I have been using WPF for a while now and wasn't even aware of this property on TextBox. I am sure many others won't be.

Anyway, the solution discussed there is to set the UndoLimit property of TextBox to 0. Instead of setting this for all TextBoxes in your code, it can more easily set in App.xaml as an application resource so that it is applicable to all TextBoxes by default. You can explicitly undo for specific ones via code or local property setting.

    <Application.Resources>  
        <Style TargetType="{x:Type TextBox}"> 
            <Setter Property="UndoLimit" Value="0" /> 
        </Style> 
    </Application.Resources>

February 29, 2008

Expression Blend issue with Globalized WPF Application

Recently while supporting a project on converting their WPF application for globalization and localization support, we faced an issue in being able to work with Expression Blend 2 Dec preview. We used the recommended approach for globalization and localization and after doing all that Expression Blend failed to load the user controls in design view.

You would get an error like this - "MissingSatelliteAssemblyException: The satellite asembly named yourassemblyname for fallback culture 'en-US' either could not be found or could no be loaded. This is generally a setup problem. Please consider reisntalling or repariring the application."

Continue reading "Expression Blend issue with Globalized WPF Application" »

February 14, 2008

Debugging WPF Databinding errors

For an application I was working on recently, I had a tough time with debugging some of the data binding issues. Then I came across this excellent blog. My personal favorite is the new Trace Level feature of .NET 3.5. For some reason, I could not get the second option to work.

February 5, 2008

Required Field Validation in WPF

In my earlier blog on user input validation in WPF, I had discussed about how extension methods can be used to provide for custom valiation logic. If your need is more simply only mandatory fields, a validation that the RequiredFieldValidation control provides in ASP.NET, you could very well use the concept of Data triggers in WPF.

One of the key benefits triggers offer is that they can be effectively managed within the XAML without usually requiring much of procedural code. Also since triggers are raised on specific actions/events, they are automatically undone when the action/event is over. This comes handy and saves code, since otherwise in procedural code, you need to handle both cases (something that is seen in my work with extension methods).

Continue reading "Required Field Validation in WPF" »

February 4, 2008

Are Remote MSMQ Queues Reliable?

I have played around a bit with MSMQ private queues and documented some of my findings earlier. In my first blog on this topic, I had captured how the naming of the queue is critical to connect to the right queue.

If it was local private queue, you could use - ".\\private$\\queuename"

and if it was remote private queue, you use - "FormatName:Direct=OS:machinename\\private$\\queuename"

Continue reading "Are Remote MSMQ Queues Reliable?" »

January 31, 2008

Working with MSMQ Journal Queues

In one of our internal forums, recently, someone had posted a query regarding issues in connecting and receiving messages from journal queues. The exception they were getting was "Queue ID is not registered in DS". I hadn't worked with Journal queues before, but this error seemed to me to be related to the queue path.

In my earlier blogs (here and here), I had discussed about the importance of specifying the right name for the queue and also mentioned how the path will typically look like. I decided to give it a try and created a private queue on my local machine and enabled journaling on it. Enabling journaling is as trivial as checking a checkbox in the queue property window.  You can also enable it by setting the UseJournalQueue property on the message.

Continue reading "Working with MSMQ Journal Queues" »

January 24, 2008

Importance of Application.DoEvents

Recently a colleague of mine shared a code that he was working on where he was playing around with Asynch ADO.NET. He had a simple WinForm application. On the click of a button, he was making calls to the DB to get data. To try out the asynch features, he had introduced delays in the code.

Continue reading "Importance of Application.DoEvents" »

January 23, 2008

Unit Test Trust Issue on Vista

Further to my unit testing experiments that I have been blogging about in the last few days, I was playing around with the DashCommerce starter kit. After installing and configuring the site, I started by creating some tests for the code in the App_code folder.

The test creation was successful and I was all set to run. But luck was against me and I got compilation errors regarding missing namespace. As I had mentioned in my earlier blog, the testing happens via private accessor and since its creation happened successfully, ideally I shouldn't  have had a need for adding explicit references and namespaces to my test project.

Continue reading "Unit Test Trust Issue on Vista" »

January 22, 2008

Debugging ASP.NET Unit Tests with VS 2008

In my previous blogs (here and here), I have been discussing about unit testing on an ASP.NET web site that is hosted on IIS. While doing the work on that, I also had a need to debug my test case. The documentation on MSDN talks about putting break points and attaching to w3wp process and then debug the tests.

This however didn't work for me on VS 2008. What worked was adding the System.Diagnostics.Debugger.Break() call in my code and then running the tests like normal. When the code hit the Debugger.Break line, it asked me, which debugger to use and I selected the already open VS 2008 instance and it took me to the correct line of code and i was able to debug.

January 21, 2008

ASP.NET Unit Testing on IIS

In my previous blog I had mentioned about the issue in generating private accessors for ASP.NET code that is hosted on IIS. Does this mean that we can't test the web site if hosted on IIS?

You can, but it will be a bit more complex and you may not be able to cover all scenarios. The idea is to work with the PrivateObject that is available from the test context. In the previous blog, I had talked about a web site with a Calculator class in the App_Code folder that i wanted to test. Let's continue with the same example.

Continue reading "ASP.NET Unit Testing on IIS" »

January 18, 2008

ASP.NET Unit Testing issue on IIS with VS 2008

I was recently trying to dirty my hands on using the Unit test framework that comes with Visual Studio. I decided to give it a try on my newly installed VS 2008. I created a pretty trivial ASP.NET site hosted on IIS with a Calculator class that I put in App_Code folder and generated the tests.

One of the key differences in working with Unit test framework for ASP.NET as compared to other projects like Winform or Class library is that the code in ASP.NET gets compiled dynamicall into various assemblies and hence we can't bind to a specific assembly upfront. Check more details on this here.

Continue reading "ASP.NET Unit Testing issue on IIS with VS 2008" »

January 2, 2008

Querying user details from Active Directory

During a recent project, we had need for querying and working with Active Directory. Searching on net, gave lots of help, but most were around creating and managing users. Our need was simple - to get some user specific details from AD.

The trickest part of working with AD is the AD structure and what properties have been defined and hence available for querying. Without really knowing this, one can continue to grop in dark for long hours without much success.

Continue reading "Querying user details from Active Directory" »

December 12, 2007

BizTalk Server and WCF Integration

BizTalk 2006 R2 provides in-built support to access and work with WCF based services. To get more detailed understanding of BizTalk Server 2006 R2, you may want to read "Introducing Microsoft BizTalk Server 2006 R2". In case you want to work with the WCF LOB Adapter SDK, you can get it here.

However you may still be using BizTalk Server 2004 or even the pre-R2 BizTalk Server 2006 version and may still want to work with WCF. In this article, we have provided details on how to go about doing it. Comments about the article are welcome !

September 6, 2007

LocBAML to Localize WPF Applications

Recently I was trying to work with LocBAML (default installation location - C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\WPFSamples\GlobalizationLocalization\LocBaml) to generate localized version of my WPF application. Things worked fine, but I did observe a few differences from what is documented on MSDN Site and this another detailed article. Two main observations

Continue reading "LocBAML to Localize WPF Applications" »

September 3, 2007

Logging Events with User details

The other day a colleague asked about how to provide information for the "User" column in the Event log. The EventLog.WriteEntry method has various overloads, but none that allows you to pass the user details.

There is an EventLogEntry class also that .NET provides, which has a UserName member, but it is read only property and is used to query event entries from the log. This means that by using .NET APIs there isn't a way to provide the user name for event log entries.

Continue reading "Logging Events with User details" »

August 2, 2007

WPF and AppDomains

In my earlier blog I had talked about how to work with AppDomains and the issues I had faced. I had a chance to interact with Hua Wang from Microsoft and it was very enlightening.

There are specific things that need to be taken care when creating and destroying AppDomains in WPF. .NET framework 3.0 supports new APIs for this purpose and these are to account for the threading model of WPF.

Continue reading "WPF and AppDomains" »

July 26, 2007

WPF - Finding Control Location

Recently for a sample application I was building in WPF, I had to find the location of a button control on the window. Playing around with Button.Margin didn't help much since it gave the position with reference to the immediate parent. So if the button was inside a Grid and the grid itself inside say a StackPanel, the values were incorrect.

Searching on the forums, I got some ideas and following is what worked for me

            GeneralTransform transform = button1.TransformToAncestor(this);

            Point rootPoint = transform.Transform(new Point(0, 0));

button1 is the control for whom I wanted to find the location. The this represents the top level window. The value obtained in rootPoint is the Left and Top cordinates of the button with respect to the top level window. Adding button's height and width will give the complete location details.

 

July 10, 2007

Windows Workflow Foundation Web Workflow Approvals Starter Kit – A Review

As you might be aware Microsoft had released the WF web workflow approvals starter kit which is a Visual Studio 2005 project that demonstrates using Windows Workflow Foundation for simple task-oriented workflow in an ASP.NET Web application.

I decided to review the starter kit so as to understand how efficiently and easily this starter kit could be used to develop simple task-oriented workflows in ASP.NET web applications. Let me list down my viewpoints on the same.

Continue reading "Windows Workflow Foundation Web Workflow Approvals Starter Kit – A Review" »

July 6, 2007

WPF Application Default Assembly Version

If you have worked with .NET 2.0 and VS 2005 and then move onto .NET 3.0 and WPF, be careful of the default assembly version. From .NET 1.1 to .NET 2.0, a change was made to default the assembly version to 1.0.0.0 in the AssemblyInfo.cs file, since the C# compiler would otherwise keep incrementing these values everytime you hit "build".

Seems like with for WPF in .NET 3.0, this change has been reversed, if you are working with the WPF Extensions running with VS 2005. The WCF and WF extensions still use 1.0.0.0 as the default version. So if you are working with WPF extensions, be careful, else you will end up having always changing version numbers.

However this seems to have been fixed in Orcas. I checked with Orcas Beta 1 and the version number for WPF apps has again been defaulted to 1.0.0.0.

July 5, 2007

Creating and Working with Applications in AppDomains

We all have read that AppDomains are light weight processes that .net uses to run applications, but I hardly ever played with AppDomains directly. Recently I decided to give this a try and following are my findings. If you want to get more information on AppDomains, check this excellent blog by Chris Brumme.

Continue reading "Creating and Working with Applications in AppDomains" »

May 14, 2007

WindowsClient.net

New Winforms and Windows Presentation Foundation (WPF) community site - http://windowsclient.net/Default.aspx. Lot of material to help developers... do check out the video section for a good collection of video tutorials 

April 18, 2007

WPF - Assigning Icon to Image control

When working with WPF applications, display images is a breeze. The Image control provides rich features to display images of various formats like JPEG, PNG, ICO, BMP, GIF etc. Displaying an image is as simple as setting the Image.Source property to the appropriate image file path. No special coding is required to work with different file formats. 

        <Image Name="icoDisplay" Source="myfile.jpg" />

Ofcourse you need to worry about other aspects like location of the Image control, its size and also setting the Stretch property to appropriately display the image. I haven't shown all that here for sake of simplicity.

Continue reading "WPF - Assigning Icon to Image control" »

April 16, 2007

WPF/E is now Silverlight

Official name for WPF/E is now Microsoft Silverlight (http://blogs.msdn.com/mpowell/archive/2007/04/15/wpf-e-is-now-silverlight.aspx).

Interesting point on agHost.js name linking with silver and hosting - http://blogs.msdn.com/bardak/archive/2007/04/15/the-story-about-silverlight-and-aghost-js.aspx

March 27, 2007

WPF - Animate with less code

I have been playing around with Animation features of WPF and it has indeed made life easy for developers to build some cool animations quickly. Even if you don't go the extent of using Expression Studio to build complex animations, basic things can be easily done with WPF, XAML and code behind itself.

Whatever animation logic we write in XAML, we can write in code behind also. Though in code behind, this takes lot more lines of code and isn't that easily readable and understandable as it is XAML. In one of the samples that I was building, I had a requirement to animate a control, based on some existing data values.

Continue reading "WPF - Animate with less code" »

March 26, 2007

Adding Event handlers for controls in WPF (XAML) applications

I have been extremely used to the way event handlers are added to the code behind files, be it web application or winform application, when working with Visual Studio. This could be done either by double clicking the form/control whose event you want to handle or go the event listing in the properties windows, pick the event and double click there.

However the same doesn't works for WPF applications. It doesn't work using the currently available WPF extensions that work with VS2005 or with March CTP of Orcas.

Continue reading "Adding Event handlers for controls in WPF (XAML) applications" »

March 24, 2007

Using User Control in Windows WPF (XAML) Application

User controls are an essential part of writing Windows/Web applications. The other day I was trying to get a WPF user control (XAML) added to my WPF Window and was running into issues.

I am working on RTM Windows Vista Ultimate with VS2005 SP1 (with patch for Vista), .net fwk 3.0 RTM and November 2006 CTP of WPF extensions for VS. The scenario is as below.

Continue reading "Using User Control in Windows WPF (XAML) Application" »

February 9, 2007

Finding deserialization problems when using MSMQ with WCF

I was trying to build a sample that had a WCF service consuming an input message from MSMQ. Post writing the necessary code when I ran the service and waited for it to pick up the message from MSMQ, nothing happened.

The message was not getting picked up and I wasn't get any exception or an error logged in event log. I didn't know what to do. Since I had used a transactional queue, and the message continued to sit there, I knew this meant that something went wrong while reading the message, but what?

Continue reading "Finding deserialization problems when using MSMQ with WCF" »

February 2, 2007

Writing my first WCF service on Vista

Earlier today I decided to try my hands at building a Windows Communication Foundation (WCF) service on my Vista machine. Since Vista (RTM) comes pre-installed with .net framework 3.0, the necessary components for WCF are already on the machine.

However to work with VS2005 and be able to create WCF based projects, you still need to install the WCF extensions. You can get the necessary files from here - http://www.netfx3.com/blogs/technology_news_and_announcements/archive/2006/12/06/net-framework-3-0-has-been-released.aspx

Continue reading "Writing my first WCF service on Vista" »

January 31, 2007

WCF Service Factory

February 2007 MSDN Magazine contains a good introduction to WCF Software factory by Aaron Skonnard. You can find the article here - http://msdn.microsoft.com/msdnmag/issues/07/02/ServiceStation/default.aspx. The December edition had an article on Web services Software Factory (http://msdn.microsoft.com/msdnmag/issues/06/12/ServiceStation/).

The Service Factory is available on code plex site here - http://www.codeplex.com/servicefactory.

November 30, 2006

Application Thumbnails in Vista

I have been using Vista for a while now (started with RC1 and upgraded to RTM recently). One of the things that one notices immediately is the cool new graphics capabilities that Vista offers. I am amazed by looking at the new set of icons also being used for various applications and the transparency that the windows now offer.

Another interesing feature is the application thumbnails that you see when you do ALT + TAB or hover the mouse over applications in the task bar. If you notice carefully these aren't static images but live previews of the application. So as the application state changes, the thumbnail updates accordingly. One simple way to verify this is the run some setup program and then watch the thumbnail by hovering the mouse over the taskbar button for that application.

Continue reading "Application Thumbnails in Vista" »

November 24, 2006

Visual Studio 2005 and SQL 2005 on Vista RTM

I recently upgraded to Vista RTM and installed VS 2005 and SQL 2005 on it. While running VS2005 I kept getting a message box saying that this program has known compatibility issues with Vista. Checking online, I found this blog entry. Going to the connect.microsoft.com site, I realized that the VS2005 SP 1 Beta program is already over but the SP1 is available for download here. Downloading and installing it caused the warning to go away. I quickly built a WF application to test that it was funtioning alright.

Continue reading "Visual Studio 2005 and SQL 2005 on Vista RTM" »

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter