2011-03-05 7 views
0

Microsoft Surfaceのプログラムを開始しましたが、問題があります。ScatterviewのScatterviewItemの名前をバインドで取得

私は「ContactLeave =」MainScatterView_ContactLeave」、 に移動した項目の名前を取得したいと思いますが、私はそれを行うことができますどのように私にはわからないscatterviewに

<s:ScatterView Name="MainScatterView" ContactLeave="MainScatterView_ContactLeave" ContactEnter="MainScatterView_ContactEnter"> 
     <s:ScatterView.ItemTemplate> 
      <DataTemplate> 
       <Image Name="picture" Source="{Binding}"/> 
      </DataTemplate> 
     </s:ScatterView.ItemTemplate> 

    </s:ScatterView> 



protected override void OnInitialized(EventArgs e) 
    { 
     base.OnInitialized(e); 

     try 
     { 
      MainScatterView.ItemsSource = 
       System.IO.Directory.GetFiles(@"C:\Surface_App_Dam\img\", "*.png"); 
     } 
     catch (System.IO.DirectoryNotFoundException) 
     { 
      // Handle exception as needed. 
     } 
    } 

を使用しています。

あなたは私を助けてくださいもらえますか?

ありがとう。

答えて

0
private void MainScatterView_PreviewContactUp(object sender, ContactEventArgs e) 
    { 
     if (e.GetPosition(this).X < 100 && (coordinates.Height - e.GetPosition(this).Y) < 100) 
     { 
      string file = e.OriginalSource.ToString(); 
      UserNotifications.RequestNotification("Notification PreviewContactUp", file, TimeSpan.FromSeconds(2)); 
     } 
    } 
関連する問題