

Gelin sizlerle ilk Micosoft Surface uygulamamızı yazalım. “Hello World!” yazacağız ancak öbür programlama dillerinin aksine, biraz atraksiyonlu bir “Hello World!” olacak. Uygulama çalışınca değil de, kullanıcı Surface’in ekranına tıkladığı zaman “Hello World!” yazacak. Hadi başlayalım. File -> New -> Project’ten açılan pencerede Visiual C# -> Surface -> v1.0’ı işaretliyoruz. Ardından sağ tarafta açılan yerden Surface Application (WPF)’yi seçiyoruz ve OK butonuna tıklıyoruz. Böylece Surface proje templatemiz açılmış oldu. Sağ taraftaki Solution Explorer’dan SurfaceWindow1.xaml’e tıklıyoruz. Oraya şu kodları yazıyoruz:
<s:SurfaceWindow x:Class="HelloWorld.SurfaceWindow1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="http://schemas.microsoft.com/surface/2008" Title="HelloWorld"> <s:SurfaceWindow.Resources> <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg"/> </s:SurfaceWindow.Resources> <Canvas Background="{StaticResource WindowBackground}" s:Contacts.ContactDown="OnCanvasContactDown"> <Label Name="HelloWorldLabel" Visibility="Hidden"> Hello World! </Label> </Canvas> </s:SurfaceWindow>
Pingback: Multi-touch ve Microsoft Surface Makalem Part-12 | Bekir Aytac AGMA