Guest User

Untitled

a guest
Dec 14th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. private void Image_MouseDown(object sender, MouseButtonEventArgs e)
  2. {
  3. MessageBox.Show(e.Source.ToString());
  4. }
  5.  
  6. Image image = new Image { Height = 225, Width = 236, Source = logo, Stretch = Stretch.Fill };
  7. image.MouseDown += (s, e) => MyMethod(myId); // MyMethod — ваш метод для отправки, myId — ваш id или любой другой параметр
  8. stack.Children.Add(image);
  9.  
  10. <ItemsControl ItemsSource="{Binding MyItems}">
  11. <ItemsControl.ItemTemplate>
  12. <DataTemplate>
  13. <Button Command="{Binding SendCommand}" CommandParameter="{Binding Id}"
  14. Template="{StaticResource MySendButtonTemplate}"/>
  15. </DataTemplate>
  16. </ItemsControl.ItemTemplate>
  17. </ItemsControl>
Add Comment
Please, Sign In to add comment