Jérôme Laban

.NET Powered

Canada !

clock August 31, 2007 11:52 by author Jerome

Well, that was as not easy as it would have seemed, but it's done ! I'm moving to Canada !

I'll be in Montréal by the end of the year, still working with .NET technologies, but with the canadian spirit that I think I'll enjoy to learn and live with !

There's a lot of french people over there, like SharkOne (maybe still there at that time ?), or Sanx, and some other Epitech students I've graded a few years ago... This'll be great !

And no worries about Bluetooth Remote Control, I'll continue working on it :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Binding a C# property to a WPF validated Control

clock August 29, 2007 05:48 by author Jerome

The DataBinding in WPF allows the binding of control properties to many things, like other control properties, arrays, data providers, ... But it can also bind a control property to a property defined by code on the C# side.

It is interesting to bind to C# property to be able to have the integrated WPF validation and still use a simple property from the code. In that case, I wanted to have the validation of a TextBox displaying a DateTime object.

Here's how to do this.

On the C# side :

public partial class Window1 : Window

  public Window1() 
  {   
    MyDate = DateTime.Now;
    InitializeComponent();
  }
  public DateTime MyDate { get; set; }
}
 

Note that I'm using the latest C# 3.0 syntax to declare variable-less properties. This is compiler trick, the variable is still declared at compile time, but since I don't need to have a specific code in the get or set accessor, it can stay in this short form.

Now on the XAML side :

<Window ... >
  <TextBox Width="100" Height="20">
    <Binding Path="MyDate" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}" UpdateSourceTrigger="PropertyChanged">
      <Binding.ValidationRules>
        <ExceptionValidationRule />
      </Binding.ValidationRules>
    </Binding>
  </TextBox>
</Window>

The interesting part here is the use of RelativeSource and the FindAncestor mode. Here, we're looking for the property MyDate from the nearest ancestor instance of the Window type, from the current instance.

This way, you'll have a validated date time in your property value. Just make sure you're checking that the value is really valid using the System.Windows.Controls.Validation class.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


0.8.2 Re-Release

clock August 25, 2007 03:05 by author Jerome

It seems that I forgot to update some scripts in my build process, and that the cab files were not updated in the last release.

So, I you downloaded version 0.8.2 and that the version of the software on your mobile device is not 0.8.2.17474 (See options / About...), then you should download it again to run the latest.

These things happen sometimes :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Bluetooth Remote Control 0.8.2

clock August 22, 2007 15:44 by author Jerome

This kind of a fix only release. I'm trying to fix the "MissingMethodException". This is a bit weird since the function I'm calling should always be here, as said in the SDK documentation... Some documentation or ISV glich, maybe.

I've also added a more visual bluetooth availability check. Now, if the background of the desktop server is in some kind of red color, then bluetooth is not available. Of course, nothing won't work until it becomes gray again.

On a side note, I'm trying some of the new features of Visual Studio 2008, like the multi-targeting of frameworks. Too bad they did not include the .NET Compact Framework 1.0. This is not good news for Bluetooth Remote Control, since I'm keeping .NET CF 1.0 to run on older devices like Smartphones with WM2003. I guess I'm going to have to drop support of these devices in future version.

Get the new release here : http://www.jaylee.org/remotecontrol

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Pictures

clock August 15, 2007 15:47 by author Jerome

I'm getting more and more interested in digital photography... That's why I'm now going to post more and more of my pictures on flicker.

Things I like about that is that I can use my existing knowledge for the digital part :) About the artistic part, well... I'm learning. Depth of field, aperture size, exposition time, white balance and stuff like that... many things to configure before taking a picture :) But I like it !

You can see them by clicking on the flicker badge on the right side of this page.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About me

My name is Jerome Laban, I am a Software developer and .NET enthustiast from Montréal, QC. You will find my blog on this site, where I'm adding my thoughts on current events, or the things I'm working on, such as the Bluetooth Remote Control Software for Windows Mobile.

© Copyright 2008

Links

Advertizing

Search

Categories


Tags

Calendar

<<  October 2008  >>
SuMoTuWeThFrSa
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Archive

Blogroll

Sign in