Browse Source

fix: textbox = text block labirint

Otter 4 months ago
parent
commit
0254c82965

+ 2 - 1
HelloItQuantum/Function/WorkWithFile.cs

@@ -19,7 +19,8 @@ namespace HelloItQuantum.Function
 		{
 			if (!File.Exists(filePath))
 			{
-				FileStream fs = File.Create(filePath);
+				using (FileStream fs = new FileStream(filePath, FileMode.Create))
+				{}
 				return null;
 			}
 			List<User> users = new List<User>();

+ 11 - 10
HelloItQuantum/ViewModels/LabyrinthViewModel.cs

@@ -30,22 +30,23 @@ namespace HelloItQuantum.ViewModels
             TextInSP = "Çäîðîâî! Ðàêåòà îêàçàëñÿ íà èññëåäîâàòåëüñêîé ñòàíöèè è ïîìîã ïðîôåññîðó ïî÷èíèòü ëàáîðàòîðèþ. Ìèññèÿ âûïîëíåíà!";
             IsVisibleContextWindow = false;
         }
-
-        /// <summary>
-        /// Ôóíêöèÿ çàïóñêà àóäèî
-        /// </summary>
        
         
         public void AddButton(string comand)
         {
-            TextBox tb = new TextBox();
+			ListCommandForRobots.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center;
+			TextBlock tb = new TextBlock();
             tb.Text = "go " + comand;
-            tb.Background = new SolidColorBrush(Avalonia.Media.Color.FromArgb(242, 101, 39, 0));
-            tb.FontSize = 24;
+			tb.TextAlignment = TextAlignment.Center;
+			tb.FontSize = 24;
             tb.Width = 150;
-            tb.CornerRadius = new CornerRadius(10);
-            tb.Margin = new Thickness(5);
-            ListCommandForRobots.Children.Add(tb);
+            tb.Margin = new Thickness(10);
+			Border border = new Border();
+            border.CornerRadius = new CornerRadius(20);
+			border.Background = new SolidColorBrush(Avalonia.Media.Color.FromArgb(242, 101, 39, 0));
+			border.Child = tb;
+			border.Margin = new Thickness(5);
+			ListCommandForRobots.Children.Add(border);
             listContent.Add(tb.Text);
 
         }