Button XAML

XAML Button’s in 5 mins..

XAML

<Grid x:Name="LayoutRoot" Background="#FF54126A">
 <Grid  Height="87" Width="400" Margin="31,85.5,209,0" VerticalAlignment="Top" d:LayoutOverrides="Height" >
 <Border Background="#FF449712" Margin="1"   CornerRadius="5" BorderThickness="1">
 <Border.BorderBrush>
 <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
 <GradientStop Color="#6D000000" Offset="0"/>
 <GradientStop Color="Black" Offset="0.994"/>
 </LinearGradientBrush>
 </Border.BorderBrush>
 <Border.Effect>
 <BlurEffect Radius="2"/>
 </Border.Effect>
 </Border>
 <Border   CornerRadius="5" Margin="3" BorderThickness="0,2,0,0">
 <Border.Effect>
 <BlurEffect Radius="3"/>
 </Border.Effect>
 <Border.BorderBrush>
 <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
 <GradientStop Color="#00000000" Offset="1"/>
 <GradientStop Color="#D7FFFFFF"/>
 </LinearGradientBrush>
 </Border.BorderBrush>
 <Border.Background>
 <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
 <GradientStop Color="#1DB1B1B1" Offset="0.5"/>
 <GradientStop Offset="0.5"/>
 </LinearGradientBrush>
 </Border.Background>
 </Border>
 <TextBlock Text="Buy Now !" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="40"  FontFamily="Segoe UI Symbol">
 <TextBlock.Effect>
 <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
 </TextBlock.Effect>
 </TextBlock>
 </Grid>

 <Grid  Height="87" Width="400" Margin="32,209.5,208,183.5" >

 <Border Background="#FF0C64CA" Margin="1"   CornerRadius="5" BorderThickness="1">
 <Border.BorderBrush>
 <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
 <GradientStop Color="#6D000000" Offset="0"/>
 <GradientStop Color="Black" Offset="0.994"/>
 </LinearGradientBrush>
 </Border.BorderBrush>
 <Border.Effect>
 <BlurEffect Radius="2"/>
 </Border.Effect>
 </Border>
 <Border   CornerRadius="5" Margin="3" BorderThickness="0,2,0,0">
 <Border.Effect>
 <BlurEffect Radius="2"/>
 </Border.Effect>
 <Border.BorderBrush>
 <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
 <GradientStop Color="#00000000" Offset="1"/>
 <GradientStop Color="#D7FFFFFF"/>
 </LinearGradientBrush>
 </Border.BorderBrush>
 <Border.Background>
 <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
 <GradientStop Color="#1DB1B1B1" Offset="0.5"/>
 <GradientStop Offset="0.5"/>
 </LinearGradientBrush>
 </Border.Background>
 </Border>
 <TextBlock Text="Download Trial !" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="40"  FontFamily="Segoe UI Symbol">
 <TextBlock.Effect>
 <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
 </TextBlock.Effect>
 </TextBlock>
 </Grid>

 </Grid>

Reactive Extensions (Rx) Data Streaming

You have probably heard about Reactive Extensions, a library from Microsoft that greatly simplifies working with asynchronous data streams and allows to query them with LINQ operators.In my previous post I briefly discussed about loading data via entity framework asynchronously however it lacks getting chunks of data. This post demonstrates how to use Reactive Extensions for loading data from database asynchronously in chunks covering brief around Reactive extension library.

Reactive extensions (Rx)
The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. Using Rx, developers represent asynchronous data streams with Observables, query asynchronous data streams using LINQ operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, Rx = Observables + LINQ + Schedulers.Data sequences can take many forms, such as a stream of data from a file or web service, web services requests, system notifications, or a series of events such as user input. Reactive Extensions represents all these data sequences as observable sequences. An application can subscribe to these observable sequences to receive asynchronous notifications as new data arrive. The Rx library is available for desktop application development in .NET. It is also released for Silverlight, Windows Phone 7 and JavaScript.

Reactive programming allows you to turn those aspects of your code that are currently imperative into something much more event-driven and flexible.Reactive programming can be applied to a range of situations—from WPF applications to Windows Phone apps—to improve coding efficiency and boost performance.

Code snippets to asynchronous load data via entity framework in batches of 200 records.

public void LoadPostCodes()
{
 btnStatus.Content = "Started";
 listBox1.Items.Clear();
 (from p in cx.MAS_PostCode select p)
 .ToObservable(Scheduler.NewThread)
 .Buffer(200)
 .ObserveOn(SynchronizationContext.Current)
 .Subscribe(ld =>
 {
 foreach (var item in ld)
 {
 ListBoxItem litem = new ListBoxItem();
 litem.Content = string.Format("{0} {1}", item.PC_PostCode, item.PC_Address1);
 listBox1.Items.Add(litem);
 listBox1.ScrollIntoView(litem);
 }
 button1.Content = listBox1.Items.Count.ToString();
 },
 () => { btnStatus.Content = "Finished"; }
 );
}

Have finished writing MVVM(Nano View model) based scenario & Rx implementations …

Will write soon and publish code..

Regards
Rajnish

Page flip with deep zoom

Book control is another excellent page flip control which allows you to add any silverlight element as book page.It supports page down and page up as bidiretional navigation keys.Demo application & source code is attached below.
[silverlight: http://www.pixytech.com/rajnish/uploads/code/BookDemo.xap, 850, 650]

The objective of this article is to create photo album application which allows user to add pictures just by drag and drop on album.The picture will be splitted into parts and uploaded on server where it is re-constructed and again processed into deep zoom meta file (on fly) and link to this picture will be then added into album.Photo album will have deep zoom enabled pages.

I couldn’t get much time to finish this project & hence i would call this as beta source code which includes the full source code of Book control (page flip)

Beta Source code for book control is available here

Silverlight for Symbian S60 devices

Microsoft has released Silverlight platform design to work with Symbian S60 devices at the on MIX10 conference at Las Vegas.The plateform is now available for Nokia SymbianOS (S60 5th Edition) devices i.e. Nokia 5235, 5800 XpressMusic, Nokia N97 and Nokia N97 Mini Mobiles. I did some basic test with nokia 5235 and it runs with charm.

The current Silverlight beta for Symbian comes in two forms – one as an installer for Symbian (S60 5th edition) devices and the second one in the form of a developer tools suite for developing Silverlight applications for Symbian devices including emulator etc.

Silverlight includes a Runtime that is optimized to display content on memory-constrained devices.

  •  The ability to view Silverlight applications in the mobile browser.
  •  Tools to build Silverlight applications that target devices

Microsoft has bought the Silverlight platform to a non-Microsoft mobile platform for the first time ever.

In order to get started with Silverlight for Symbian, you will want to familiarize yourself with the platform capabilities.

More resources are available on microsoft website.

Days are not far when you will see silverlight on rest of consumer devices ..