Tuesday, September 24, 2013

My Codeproject Article On WPF DataGrid Custom Header With Filter

Woohoo! My first ever article on Codeproject has been published. Here is the URL:

This article has been based on a journey to find simple UI designs. More about them in coming up articles.

It took me 3 weeks to understand WPF DataGrid. It was faster near the end, when I started using Snoop. We can do really good UI designing with WPF. But sadly, most of the professional apps are still not ready to change to simpler UI. Too simple for them, maybe? :-P

Thanks for reading this post! And, yes, please, do vote on Codeproject article, if it makes sense to you.

Saturday, September 15, 2012

Auto Save in Paint - ver - Patch Release

This is a small post to post a minor patch on top of release version 1.7

Tflamb noticed that on Windows 7, the XP Paint application was not able to save the JPEG files, and thus shrink them. He suggested a delay to be introduced while saving the files.

I made the delay configurable in the "Options".

1. In "Options" dialog box, there is a number selector (numeric up/down box) for the required delay while Paint application saves a file. The value that it can hold is in the range of 0 to 30. This number is the delay in seconds that AutoSavePaint (ASP) will wait for Paint application to save per file. If the delay is 0, then ASP will behave normally and no extra delay will be introduced.

I'm only uploading the binary+source for the patch, instead of the whole package. Please download ver 1.7 first and then apply the patch.

Download links for Auto Save in Paint v1.7.0.2 patch:

Thursday, November 3, 2011

Non intrusive shadow effect for translucent area

NeXXeuS asked a very interesting question. In WPF, you have DropShadowEffect which displays a shadow of a geometry/shape. But if the geometry/shape is translucent (0 < Opacity < 1),  then you can see the shadow through.

The question was posted on SO as:

Ques: I have a DropShadowEffect on a Rectangle with a fill that's slightly transparent. The problem is, the drop shadow also shows up inside the fill, which is what I don't want. Anyways to solve this? I tried this, but it doesn't work for me.

My answer:
This is very tricky. You need to customize the shadow effect for this. This solution gives the desired effect.
This is a sample Grid with yellow background. I've drawn two intersecting rectangles of 100x100 dimension on it. You may need to customize the size according to your need. One rectangle is gray rectangle (to show shadow), and the other is a red rectangle (the actual semi-transparent rectangle that you want to display). The shadow depth has been hard coded as 5 pixels here. Please customize it at:
  • RectangleGeometry Rect="5,5,100,100"
  • RectangleGeometry Rect="0,0,95,95"
So, the grid looks like:
   1:  <Grid Background="Yellow">
   2:      <!-- A rectangle for shadow -->
   3:      <Rectangle Fill="Gray" Width="100" Height="100" Opacity=".7">
   4:          <Rectangle.Clip>
   5:              <CombinedGeometry GeometryCombineMode="Exclude">
   6:                  <CombinedGeometry.Geometry1>
   7:                      <RectangleGeometry Rect="5,5,100,100"/>
   8:                  </CombinedGeometry.Geometry1>
   9:                  <CombinedGeometry.Geometry2>
  10:                      <RectangleGeometry Rect="0,0,95,95"/>
  11:                  </CombinedGeometry.Geometry2>
  12:              </CombinedGeometry>
  13:          </Rectangle.Clip>
  14:          <Rectangle.Effect>
  15:              <!-- For nice soft shadow effect -->
  16:              <BlurEffect Radius="5" />
  17:          </Rectangle.Effect>
  18:      </Rectangle>
  20:      <!-- Actual rectangle which is translucent -->
  21:      <Rectangle Fill="Red" Width="100" Height="100" Opacity=".6" >
  22:          <Rectangle.Clip>
  23:              <RectangleGeometry Rect="0,0,95,95"/>
  24:          </Rectangle.Clip>
  25:      </Rectangle>
  26:  </Grid>

Hope this is interesting to you as much as I had fun creating it! :)

Sunday, October 2, 2011

Communication, an IT industry perspective

Does anyone else in software development and sustenance field thinks that actual work, the real work which brings quality to a product, is done by fixing the bugs, and not just by reporting it?

A sustenance (or maintenance) team usually contains two essential parts - development and testing (technical names may vary.) The communication between these two small teams is crucial for customer satisfaction and not just personal financial gains, though its part of it. But then, who wants to get up and walk to the other team member and say, "Hey! I found this crazy bug here... can you fix it?" Very few.

Most of the teams think reaching out to other teams or projects is not their job. They rather shove it in management's behind - "Let them initiate a formal channel." If you work under the style where each team is divided to the extent that they cannot work together without the involvement of superiors, there is something wrong there. I was thinking of designing a flow chart for the problem identification, but it would defeat the purpose of this post. :) We need action to resolve the problem, not just identify and report it.

But in short, if you are not allowed to reach out to the teams and individuals, the problem may very well be in the style of working. The problem may be in the rules that govern the working environment. Locate the problem and find a way which works best to diffuse the problem. This, is troubleshooting.

Communication, even in its bare essential, is terrifyingly important. Its meant to be practiced, or suffer consequences.

Saturday, October 1, 2011

Visio 2010 64-bit bummer

Its so weird and irritating to know something doesn't work and has been documented already. Just that I did not search for it. How would anyone know if things will work or not?

You cannot use the ActiveX control of Visio 64 bit edition in your VS applications. I happen to run everything in 64 bit mode. x-(

Here is the info: http://support.microsoft.com/kb/980533

You cannot add the Microsoft Visio 14.0 drawing control to a Windows Form application in Visual Studio if you have the 64-bit version of Visio 2010 installed

Cause: These problems occur because the Visual Studio designer does not support 64-bit ActiveX controls and because the 64-bit version of Visio 2010 only works with the 64-bit version of the Microsoft Office Visio 14.0 drawing control. Therefore, the drawing control cannot be instantiated.

To work around this problem, follow these steps:
  1. Install the 32-bit version of Visio 2010 on a computer....

Ridiculous. Now, I've to undo the installation and install 32 bit version. Great! :(
Why is VS Designer not modified to support 64 bit ActiveX controls?

Even when I uninstalled 64 bit Visio, the 32 bit Viso won't install because of 64 bit Office installed on my machine. That means I've to uninstall whole 64 bit MS Office for just one VS Designer to work. WTH?!