Blog: Time to reflect

Sudoku running on a WP7 Device

Added by Fons Sonnemans on 09-Aug-2010

My Sudoku is running on a Samsung Windows Phone 7 device!


Sudoku for WP7 on YouTube

Added by Fons Sonnemans on 22-Jul-2010

I have placed a movie of my Sudoku for the Windows Phone 7 on YouTube. I have build it using the new Beta bits. It uses the same Model and ViewModel code as my Silverlight implementation.

I'm almost finished. I only have to implement the 'Notes' and 'Import from Camera' features. I can't test the Import/OCR yet because the emulator doesn't support the WebCam, bummer. I hope i can test it on a device soon.

Cheers,

Fons


Porting Sudoku to Windows Phone 7

Added by Fons Sonnemans on 04-Jul-2010

Last year I wrote a Sudoku using Silverlight 2. I'm now porting it to the Windows Phone 7. I started designing the UX. I decided to stick to the Metro design. It's really clean.

I'm using the ApplicationBar and Menu. I'm not totally sure which buttons to use. For now: pause, undo, redo and hint. I will have to create a ShakeTrigger which I will use to create a new game. I will have to postpone this until I have a real device to develop on. The accelerometer is hard to emulate.

I'm also planning to 'import' Sudoku's using the phone camera and OCR. But probably not in the first version.

I hope to show you a working version in a YouTube video soon. Come back later. All feedback is welcome on fons@reflectionit.nl

Cheers,

Fons


Touch Gesture Triggers for Windows Phone 7 projects in Blend 4.0

Added by Fons Sonnemans on 04-Jun-2010

The Windows Phone 7 supports single and multi touch gestures. I have implemented the Tap, Double Tap and the Touch&Hold gestures using Triggers. You can use them to trigger an Action in Expression Blend.

You first have to reference the GestureTriggersLibrary. Then you add an Action to a control using the Behavior assets. Finally you change the TriggerType using the New button.

The following example has tree TextBlock controls on with a ChangePropertyAction attached to it. This action sets the Text of the red TextBlock (textBlockResult) using the Tap, Double Tap or Touch and Hold GestureTriggers.

There is also a Flick Gesture Trigger which is created by Jocelyn Villaraza. Expect to see more Behaviors, Actions and Triggers for the WP7 soon.

You can download the April CTP sourcecode from here

Update 22-7-2010
The beta version doesn't support the IsTapEvent property on ManipulationCompletedEventArgs. I have fixed this using an extension method. You can download the Beta sourcecode from here.

Cheers,

Fons


Windows Phone 7 Training

Added by Fons Sonnemans on 03-Jun-2010

Yesterday I attended the Windows Phone 7 Developer Hub. The quality of the sessions was very good. They had some phone prototypes which you could play with during the breaks. I had the chance to play with an LG Windows Phone! It looks and feels great. I can't wait to get one!

It really inspired me to develop a new training for it together with my friend Loek. We plan to finish the training by the time Microsoft releases the first builds which we can run on real phones.

The content of the training will be: 

  • Introduction: Windows Phone 7, Metro Design, Silverlight, XAML, Visual Studio 2010, Microsoft Expression Blend 4, Hardware, Emulator
  • Controls: Runtime Controls, 3rd Party Controls, Events, Fonts, Tips & Tricks
  • Graphics and Animations: Shapes, Brushes, PixelShader Effects, Resources, Transformations, Animations and storyboards, Key frames and Interpolation, Triggering and Programming Animations Methods, Tips & Tricks
  • UI Customization: Styling, Skinning (Templating), Styling and Skinning, Template Binding, Visual State Manager (VSM), Tips & Tricks
  • Data Binding: Element To Element Binding, StaticResource Binding, DataContext Binding, Binding to Collections, Blend Sample Data, MVVM, Converters, Data Validation, Data Annotations DataBinding from Code, DataGrid, Tips & Tricks
  • Programmability: Using and creating Actions/Triggers/Behaviors and Commands. Using Files, Base Class Library, Asynchronous Programming, Sound, Accelerometer, Location Service
  • Control Creation: Creating User Controls, Dependency and Attached Properties, States, Creating Templated Controls, Transition Effects, Tips & Tricks
  • Networking: HTTP (Download, Upload, Data Serialization: XML, JSON, RSS), SOAP (XML WebServices & WCF), OData (WCF Data Services), Push Notification, Tips & Tricks
  • Phone Applications: Navigation, WebBrowser, Pivot, Panorama, Lauchers, Choosers, Bing Maps
  • Deployment: Marketplace, Unit Testing
  • Closure: Summary, Resources, Books, Evaluation

If you can't wait you can prepare yourself with our Silverlight 4 training.

Cheers,

Fons


SpiralText in Silverlight 4

Added by Fons Sonnemans on 31-May-2010

Blend 4.0 includes a new PathListBox control. In Silverlight 4 you can create your own shapes by deriving from the Path class. I have used these two techniques to create this SpiralText sample.

The Spiral class uses ArcSegment objects to create a spiral illusion. It isn't a perfect spiral but it is good enough for me.

The LayoutPath of the PathListBox is set to the Spiral. The ItemsSource is databound to the TextBox.

You can also select the Font, Color, Font Size, Font Spacing and the number of Spirals.

Get Microsoft Silverlight

The Spiral class was all the code I hade to write. Everything else is done using XAML. You can download the sourcecode from here

Cheers,

Fons


RightMouseTrigger

Added by Fons Sonnemans on 09-May-2010

I have written a Silverlight Minesweepe game in October 2008. I just published an improved version on Silver Arcade which support right mouse click. I implemented it using the following RightMouseTrigger. You can set the SetHandled property to true. This stops the MouseRightButtonDown event from bubbling to it's parent.

I really love Behaviors, Actions and Triggers. I hope you like it too.

public class RightMouseTrigger : EventTriggerBase<Control> {


    protected override string GetEventName() {

        return "MouseRightButtonDown";

    }


    #region SetHandled Dependency Property


    /// <summary>

    /// Get or Sets the SetHandled dependency property. 

    /// </summary>

    public bool SetHandled {

        get { return (bool)GetValue(SetHandledProperty); }

        set { SetValue(SetHandledProperty, value); }

    }


    /// <summary>

    /// Identifies the SetHandled dependency property.

    /// This enables animation, styling, binding, etc...

    /// </summary>

    public static readonly DependencyProperty SetHandledProperty =

        DependencyProperty.Register("SetHandled",

                                    typeof(bool),

                                    typeof(RightMouseTrigger),

                                    new PropertyMetadata(true));


    #endregion SetHandled Dependency Property


    protected override void OnEvent(EventArgs eventArgs) {

        var ea = eventArgs as MouseButtonEventArgs;

        if (ea != null && SetHandled) {

            ea.Handled = true;

        }

        base.OnEvent(eventArgs);

    }


}


CountDown Clock in Silverlight 4

Added by Fons Sonnemans on 01-Apr-2010

A while ago I wrote a FlipClock Silverlight 3 application. I have modified it into a CountDown Clock which you can configure using InitParams. It is written in Silverlight 4 and uses the new Viewbox control to make it scalable. I hope you like it.

You can download the sourcecode from here.

Get Microsoft Silverlight

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"

    width="400" height="200">

    <param name="source" value="ClientBin/ReflectionIT.Silverlight.CountDown.xap" />

    <param name="initParams" value="title=Silverlight 4 RTW,date=2010-04-13 08:00AM-8:00" />

    <param name="background" value="white" />

    <param name="minRuntimeVersion" value="4.0.50303.0" />

    <param name="autoUpgrade" value="true" />

    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.41108.0" style="text-decoration: none">

        <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"

            style="border-style: none" />

    </a>

</object>

 

Get Microsoft Silverlight

<param name="initParams" value="title=New Year,date=2011-1-1" />


DevDays 2010 Materiaal

Added by Fons Sonnemans on 01-Apr-2010

Zoals beloofd kan je de Presentatie + Demo's van mijn 'Introduction to WCF RIA Services' sessie van de DevDays downloaden. Je dient eerst wel de Northwind database te installeren op localhost\SQLEXPRESS. Het benodigde installatiescript is ook in de ZIP file opgenomen. 


Mijn WCF RIA Services sessie op DevDays 2010

Added by Fons Sonnemans on 17-Feb-2010

Op 30 en 31 maart a.s. vinden de Microsoft Development Days (DevDays) plaats. DevDays is een evenement dat al 13 jaar dé bron van kennis en inspiratie voor IT ontwikkelaars is. Ook deze keer vinden de DevDays plaats in het World Forum in Den Haag.

Dit jaar zijn de DevDays voor mij extra speciaal omdat ik door Microsoft ben gevraagd om als spreker op de DevDays te verschijnen. Op dinsdag 30 maart mag ik een sessies verzorgen over een onderdeel van Silverlight 4, namelijk WCF RIA Services. Met een goed doordacht Framework, op basis van codegeneratie, wordt hiermee het bouwen van gedistribueerde Silverlight applicaties veel eenvoudiger.

Wilt u ook naar mijn sessie komen luisteren, maar heeft u zich nog niet ingeschreven, ga dan naar www.devdays.nl, want ook u bent uiteraard van harte welkom.


« Previous Entries  Next Entries »