Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class Point
- {
- private int x;
- private int y;
- public Point(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
- public int X { get; set; }
- public int Y { get; set; }
- public override string ToString()
- {
- return $"{x}, {y}";
- }
- }
- internal static class PointManager
- {
- public static Point Point => new Point(0,0);
- }
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void Window_KeyDown(object sender, KeyEventArgs e)
- {
- PointManager.Point.X = 1;
- //как сделать, чтобы на экране отобразилось 1,0
- }
- }
- <Border Grid.Column="2" BorderBrush="Black" BorderThickness="1" CornerRadius="10" Margin="3" Padding="10" Background="SandyBrown">
- <Label HorizontalAlignment="Center" VerticalAlignment="Center">
- <Binding Source="{x:Static local:PointManager.Point}" />
- </Label>
- </Border>
Add Comment
Please, Sign In to add comment