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 :)
e7372214-4db6-4315-8c66-135baf19b3cd|0|.0
By Jerome at August 29, 2007 05:48
Filed Under: .NET
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.
b4cacf57-7dcc-40fe-9dc1-e37f8d5b3d03|1|3.0
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 :)
5cf1b74c-396f-4cfd-86d8-19813b1c2078|0|.0
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
6554a795-9de0-45f7-a67e-8f83aa5594c2|0|.0
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.
2db53369-6dc1-4366-a371-8a58187f5c8c|0|.0