Big Visible Cruise WPF Enhancement

Having some fun with Ben Carey's Big Visible Cruise app. BVC is a WPF app that looks at CruiseControl (.NET, Ruby, and Java versions) and displays a radiator dashboard of the status of projects. As each project is building, the indicator will turn yellow then green if it suceeds or red if it fails. It's all very cool and I jumped all over this so we could have a visible display of our projects in the office.

Here's the default look that Ben provided:

I submitted a request to be able to control the layout and he reciprocated with a layout option (using skins in WPF). Here's the updated layout he provided:

I had a problem because with only a few (8 in my case) projects, the text was all goofy. The layout was all cool but I wanted something a little flashier and better to read, so some XAML magic later I came up with this:

Here's a single button with some funky reflection:

Okay, here's how you do it. You need to modify two files. First here's the stock LiveStatusBase.xaml file. This file is the base for displaying the bound output from the CruiseStatus for a single entry:

  <DataTemplate x:Key="SimpleStatusDataTemplate">
    <Border BorderBrush="Black" BorderThickness="1">
      <TextBlock TextAlignment="Center"
                 Padding="3"
                 Background="{Binding Path=CurrentBuildStatus, Converter={StaticResource BuildStatusToColorConverter}}"
                 Text="{Binding Path=Name, Converter={StaticResource BuildNameToHumanizedNameConverter}}" />
    </Border>
  </DataTemplate>

It's just a TextBlock bound to the data source displaying the name of the project and using the background color for the status of the build. Here's the modifications I made to make it a little more sexy:

    <DataTemplate x:Key="SimpleStatusDataTemplate">

        <Grid Margin="3">
            <Grid.BitmapEffect>
                <DropShadowBitmapEffect />
            </Grid.BitmapEffect>
            <Rectangle Opacity="1" RadiusX="9" RadiusY="9" Fill="{Binding Path=CurrentBuildStatus, Converter={StaticResource BuildStatusToColorConverter}}" StrokeThickness="0.35">
                <Rectangle.Stroke>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="White" Offset="0" />
                        <GradientStop Color="#666666" Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Stroke>
            </Rectangle>
            <Rectangle Margin="2,2,2,0"
              VerticalAlignment="Top"
              RadiusX="6"
              RadiusY="6"
              Stroke="Transparent"
              Height="15px">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="#ccffffff" Offset="0" />
                        <GradientStop Color="transparent" Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Grid Margin="5">
                <TextBlock TextWrapping="Wrap" TextAlignment="Center"
                           HorizontalAlignment="Center" VerticalAlignment="Center"
                           FontSize="32" FontWeight="Bold" Padding="10,10,10,10"
                           Foreground="Black" FontFamily="Segoe Script, Verdana"
                           Background="{Binding Path=CurrentBuildStatus, Converter={StaticResource BuildStatusToColorConverter}}"
                           Text="{Binding Path=Name, Converter={StaticResource BuildNameToHumanizedNameConverter}}">
                </TextBlock>
            </Grid>
        </Grid>

    </DataTemplate>

I added a grid. The top rectangle is to define the entire area for each project (filling it in with the build status color) and the next one is the highlight (using a LinearGradientBrush) on the button. Then the TextBlock with the name of the project and it's build status gets filled in.

Now here's the stock BigVisibleCruiseWindow.xaml (the main window):

  <DockPanel>

    <Border DockPanel.Dock="Bottom">
      <DockPanel LastChildFill="False">
        <TextBlock DockPanel.Dock="Left"  Text="Big Visible Cruise" FontSize="16" FontWeight="Bold"  Padding="10,10,10,10"  Foreground="White" FontFamily="Segoe Script, Verdana" />
        <Button DockPanel.Dock="Right" Content="Options..." FontSize="9" Margin="10" IsEnabled="False" />
      </DockPanel>
    </Border>
    
    <Viewbox DockPanel.Dock="Top" Stretch="Fill">
      <ItemsControl ItemsSource="{Binding}" Style="{DynamicResource LiveStatusStyle}" />
    </Viewbox>
    
  </DockPanel>

The main window used a DockPanel and displayed some addition things (there's a button there for choosing options but it's non-functional). Here's my changes:

    <Grid>
        <ItemsControl ItemsSource="{Binding}" Style="{DynamicResource LiveStatusStyle}" />
    </Grid>

I just simply replaced the DockPanel with a Grid.

That's it! Feel free to experiment with different looks and feels and maybe submit them to Ben as he could include them in maybe a set of skins to use.

Note: You need to download the code from the repository as the 0.5 release Ben put out doesn't include the skins.

Published Friday, December 14, 2007 10:58 AM by Bil Simser
Filed under: , ,

Comments

# re: Big Visible Cruise WPF Enhancement

Friday, December 14, 2007 2:56 PM by Ben Carey

Nice. I like the look that you came up with. I'm guessing there could be some very nice skins pretty soon :)

# kyberboy08 &raquo; Big Visible Cruise WPF Enhancement

Friday, December 14, 2007 3:16 PM by kyberboy08 » Big Visible Cruise WPF Enhancement

Pingback from  kyberboy08 &raquo; Big Visible Cruise WPF Enhancement

# re: Big Visible Cruise WPF Enhancement

Thursday, December 20, 2007 10:59 AM by Justice~!

Dude, am I missing something?  Are these images really supposed to be out of focus/blurred?  Or is that some sort of pun on "Big Visible Cruise"?

# re: Big Visible Cruise WPF Enhancement

Thursday, December 20, 2007 11:31 AM by Bil Simser

Sheesh. Names of internal projects have been blurred to protect the innocent.

# re: Big Visible Cruise WPF Enhancement

Thursday, December 20, 2007 1:40 PM by Ben Walters

Yes but you can still make out what most of the names are, it just doesn't really show off the font that well.

Leave a Comment

(required) 
(required) 
(optional)
(required)