Menu

Programming

Beta Testers Needed for MuvUnder Cover: The Album Art Sleuth

MuvEnum is looking for 20 beta testers for its latest product: MuvUnder Cover: The Album Art Sleuth, which is a Windows WPF application for automatically finding and embedding album art into the following file types: APE, ASF, FLAC, M4A, M4P, M4V, MP3, MP4, MPC, MPP, MP+, WMA, WMV, and WV.

Using Windows Presentation Foundation (WPF), we’ve been able to create a unique experience that fits well within the “album cover” concept

To become a beta tester, please send an email that includes your system specifications (OS, CPU, RAM) to beta@muvenum.com requesting to be a part of the “MuvUnder Cover Beta Testing Team”.

Each active beta tester will receive a free copy of both MuvUnder Cover: The Album Art Sleuth and MuvAudio2.

Once we have 20 beta testers, testing will begin. We’ve ironed out a lot of issues with our current internal testing team and hope to have the beta last for only a few weeks.

If you have any questions, feel free to post a comment and we’ll be sure to answer it

Here’s a quick sneak peek (user interface subject to change):

image

image

Silverlight 2.0 will include a WatermarkedTextBox (a.k.a. InfoTextBox)

Since I’ve been trying to finish my latest project using WPF, Silverlight 2.0 excites me because I will be able to take a lot of stuff that I’ve done and learned and use it in Silverlight 2.0!  Scott Guthrie just posted a sneak peak into the latest offerings that will be coming in Beta 1 along with an 8 part tutorial taking you through the creation of a sample Digg app. 

In the 2nd part of the tutorial I noticed he included a “WatermarkedTextBox“.  This is an out-of-the-box (OOTB) control which basically adds the fancy faded text inside of a textbox that disappears when you start typing in it, to allow you to forego a label and minimize UI space needed.  In my current project I use the “InfoTextBox” provided by the WPF Bag O’ Tricks which does the same thing.  Having a control OOTB is always a nice thing, especially for those people that don’t know what the heck you would call this type of TextBox and therefore would never be able to find it using Google.

Silverlight 2.0 is definitely some cool stuff.  And for those of you that prefer something other than C# or VB, “Developers can write Silverlight applications using any .NET language (including VB, C#, JavaScript, IronPython and IronRuby”.

Vista – Explorer: Disable Full-Row Selection, Add Tabs

One of the changes from Windows XP to Windows Vista is the difference when selecting/deselecting items in Windows Explorer when using the Detail View. In XP, you can deselect all items by left-clicking any column that is not the name column. I love that it is this way. In Vista, good luck trying to deselect all items using the same method. In Vista, the details view uses full-row selection. Clicking on other columns causes the item to stay selected. Sure, you can right-click to deselect, but that shows the context-menu which requires another left-click to remove. The only way in Vista to deselect all items is to click in actual white-space below any selectable items.

The good news is that I’ve found a free Explorer Plugin that lets you set Vista to use the XP style of deselection: QT Tab Bar

Vista Default Sample:

If I click on the date column in this case, Music
remains selected.

Vista w/ QT Tab Bar Sample:

If I click on the date column in this case, Music
is deselected, the same way it would work in XP.

To set the option, please do the following:

  1. Install QT Tab Bar (requires log-off).
  2. Open Explorer.
  3. Hit Alt to show the default file menu.
  4. Right-click in the empty space to the right and check QT Tab Bar.
  5. Right-click next to one of the tabs that now appears and choose Options.
  6. Click the Misc. tab and make sure that Full row selection in details view is unchecked.
  7. Make sure that Hide menu bar(Vista) is checked on this tab as well. (hit Alt+M to toggle the menu bar)
  8. Click OK. (If you get an error, just click Continue and everything will work fine).
  9. Close and re-open Windows Explorer.
  10. Note: If you switch from a different view to details view, it will possibly show full-row selection in the current directory. Once you change directories and go back, it will correctly show without full-row selection.

There are a bunch of other features that QT Tab Bar provides. Here are a few of my favorites:

  1. Tabs! – Very cool way to organize your numerous open Explorer windows. As a developer, I have way too many explorer instances open. This allows me to become better organized and save time. It also doesn’t require me to use a different program that is meant to be an explorer replacement but lacks much of the functionality I already depend on.
  2. Tab Groups – Again, as a developer switching between different projects, I can have preset groups of folders I need open while developing. QT Tab Bar gives me that functionality.
  3. Restore Tabs – When I close Explorer I lose my open folders. This makes it so I can close Explorer, go do something else and re-open Explorer with the same folders I previously had open.
  4. Application Groups – I haven’t used this one yet, but I’m sure it will help. An easy way to startup a set of applications that you need for a specific task.
  5. Plugins – Create your own additional functionality to plugin without having to do everything yourself (the download comes with some plugins which I have yet to use – If I find one that stands out, I’ll make sure to add it to this post).
  6. Shortcut Keys – For all the QT Tab features: undo last closed tab, clone tab, forward, back, next tab, etc.
  7. Change Selection with F2 – A nifty feature that toggles the filename selection when renaming. Hit F2 to rename, in Vista, it selects the filename without the extension. Hit F2 again and it changes the selection to no selection but with the cursor at the end of the filename in front of the .ext. Hit F2 again and now the extension is selected. This will save a bunch of time when all I want to do is change the extension.
     

Sample of Tabs added by QT Tab Bar:

It’s definitely a tool to add to your collection if you’re using XP or Vista. Did I mention that they also created a plugin to add the Vista Breadcrumb Bar to XP?

Download QT Tab Bar

Showing different text (or elements) in a disabled ToolTip versus an enabled ToolTip in WPF

I originally started this post with a title of “WPF ToolTip Child Element Visibility Based on the Parent of the ToolTip IsEnabled Property… and you are not it with a dirty dirty dish rag on your toe reading behind a dirty magazine”, but I decided that in the best interest of my sanity (read: “what sanity”) that I would make it a little more descriptive to what my goal for creating this functionality was and a lot less wordy (read: less words than the number of pieces of bubble gum in a dish that you wished for). Don’t ask.

After writing my last post about the advanced tooltip functionality in .NET 2.0 using the VisualTips component, I realized that WPF (Windows Presentation Foundation) lacked a way OOTB to create two distinctive tooltips on an element that could be displayed based on whether or not the control was disabled or enabled. VisualTips provides this functionality. This helps users to better understand what step they need to take before a control will become enabled and why the heck they can’t click on it. For instance, in MuvAudio, the “Record” button is disabled until an item has been added to the playlist. When they move their mouse over the button, as of right now, they get no message whatsoever. They don’t even get the regular tooltip telling them what it would do if it were enabled. (I’m in the process of implementing the VisualTips so the next version of MuvAudio will have the functionality I’m about to explain). It would make sense to do the following:

  • Make the Record button, in the disabled state, display a message that says: “To being recording you must first add at least one audio file to the playlist. You can do this by double-clicking anywhere in the playlist area or by clicking on “Playlist”, “Add File(s)” and selecting the audio files that you would like to record.”
  • Make the Record button in the enabled state display: “Starts the recording process.”

To do this in WPF I had look at the problem from a different perspective. Now, I’m not the greatest programmer in the world and I am definitely am open to suggestion, so please leave me comments, but this is what I came up with:

To add a ToolTip that displays different text based on the enabled/disabled of a button (this can be replaced with any element) that it is the child of:

[source:xml]

[/source]

The important parts are as follows:

[source:xml]
Visibility=”{Binding Path=IsEnabled, Converter={StaticResource ToolTipElementVisibilityConverter}, ConverterParameter=VisibleOnDisabled}”

Visibility=”{Binding Path=IsEnabled, Converter={StaticResource ToolTipElementVisibilityConverter}, ConverterParameter=VisibleOnEnabled}”
[/source]
  • In the declaration of the Element that will contain the tooltip, you need to make sure you have ToolTipService.ShowOnDisabled=”True”
    because this allows the tooltip to still be displayed when the element is disabled.
  • You need to set the DataContext of the tooltip as follows: DataContext=”{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}”; this allows us to set the binding of the IsEnabled property in the elements of the tooltip.
  • Finally, you need to set the Visibility using a binding with a Converter and a ConverterParameter based on when you want the items to be displayed. In the above example we only want one of the textblocks to be displayed in either state so we have the parameter set to the opposite of each other:
    • The Path is bound to the IsEnabled property of the element that is the parent of this tooltip (as described above).
    • The Converter is a converter that we created that returns back the Visibility we want (Visible or Collapsed) based on the IsEnabled property and the ConvertParameter.
    • The ConverterParameter is a string that we use to tell the item to be visible when the item is enabled or when the item is disabled. The two choices are VisibleOnDisabled and VisibleOnEnabled.

The actual converter is contained in the sample project.

As a side, I looked into using enums for the parameter instead of strings but they just added extra code that doesn’t get taken advantage of (Visual Studio 2008 Beta 2 doesn’t display auto completion for enums in xaml). An example would look like this: “ConverterParameter={x:Static local:ToolTipElementVisibility.VisibleOnDisabled}”, where “local” is a xml namespace you would add to the window declaration.

The other pieces of the puzzle are as follows:

  1. Add an xml namespace declaration for the converter class to reference the converter (I prefer to add this to the window.xaml the tooltip will be used on): xmlns:cvrt=”clr-namespace:MuvEnum.ToolTipElementVisibility.Converters”
  2. Add the converter as a resource in the same window.xaml you used in #1: <Window.Resources>        <cvrt:ToolTipElementVisibilityConverter x:Key=”ToolTipElementVisibilityConverter” />    </Window.Resources>

A full sample is attached and has a compiled executable.

You’re free to use this code in any project you like. A reference to this post would be appreciated but is not required.

After I finished this code, which I’ll definitely be using in a soon to be finished WPF product, I realized that this goes above and beyond what the VisualTips for .NET can do by allowing a user to create distinctively different tooltips based on the enabled and/or disabled state of the element they are a child of thanks to the ability of tooltips to host any WPF element.

I assume this idea can be used to bind to other Boolean properties of elements and not just the IsEnabled. One of the most exciting things about WPF is the ability to create things that even those that created WPF didn’t even foresee. Now that deserves a post of its own.

WPF ToolTip Element Visibility Sample Project

Upgrade your .NET Tooltips to the Office 2007 style

I’m a big fan of the Office 2007 style tooltips and one of the areas where I feel .NET lets me down a little is in the ToolTip department.

Here’s the default .NET ToolTip:

Now take a look at the following ToolTips:

Not only do they look much better, but they also provide some very needed features.

  1. Each ToolTip can be defined with an access key, F2 in the above samples, which provides you with the ability to give extra functionality for each ToolTip.
  2. Each ToolTip can be given a specific “disabled” message that you can define to let your users know why a button is disabled and what the next step would be to get it enabled. In the regular ToolTips, if a control is disabled then no ToolTip is shown.

The best part about the above ToolTips is that you can add this functionality to your program for free thanks to SKYBOUND. Their free .NET component is called VisualTips and it’s a breeze to implement. They also have a bunch of other free components to help you spruce up your application so definitely check them out.

On a side note, WPF (.NET 3.0) provides similar functionality out of the box and here is a xaml sample (not the coolest, but can be beefed up easily):

<Button x:Name=”btn1″ HorizontalAlignment=”Left” VerticalAlignment=”Top” Content=”Button” IsEnabled=”False” ToolTipService.ShowOnDisabled=”True” >

<Button.ToolTip>

<ToolTip x:Name=”buttonToolTip”>

<StackPanel>

<Image Source=”http://www.muvaudio.com/banner/muv2banner170x77.png” />

<TextBlock x:Name=”buttonToolTipText” Text=”This is a sample tooltip in WPF”/>

</StackPanel>

</ToolTip>

</Button.ToolTip>

</Button>

The ToolTipService.ShowOnDisabled=”True”
attribute makes it so the ToolTip is displayed whether or not the control it is attached to is enabled or disabled. In the below screenshot, the control is disabled and you can see the sample WPF ToolTip.

ToolTips are an important part of the usability of any application, especially when it helps remove the need of requiring the user to read the manual before beginning use of your application.