Guest User

Untitled

a guest
Jun 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. internal class Point
  2. {
  3. private int x;
  4. private int y;
  5. public Point(int x, int y)
  6. {
  7. this.x = x;
  8. this.y = y;
  9. }
  10. public int X { get; set; }
  11. public int Y { get; set; }
  12.  
  13. public override string ToString()
  14. {
  15. return $"{x}, {y}";
  16. }
  17. }
  18.  
  19. internal static class PointManager
  20. {
  21. public static Point Point => new Point(0,0);
  22. }
  23.  
  24. public partial class MainWindow : Window
  25. {
  26. public MainWindow()
  27. {
  28. InitializeComponent();
  29. }
  30.  
  31. private void Window_KeyDown(object sender, KeyEventArgs e)
  32. {
  33. PointManager.Point.X = 1;
  34. //как сделать, чтобы на экране отобразилось 1,0
  35. }
  36. }
  37.  
  38. <Border Grid.Column="2" BorderBrush="Black" BorderThickness="1" CornerRadius="10" Margin="3" Padding="10" Background="SandyBrown">
  39. <Label HorizontalAlignment="Center" VerticalAlignment="Center">
  40. <Binding Source="{x:Static local:PointManager.Point}" />
  41. </Label>
  42. </Border>
Add Comment
Please, Sign In to add comment