|
@@ -32,8 +32,10 @@ namespace Aitex.UI.RecipeEditor
|
|
|
|
|
|
|
|
|
public RecipeEditorControlViewModel()
|
|
|
- {
|
|
|
-
|
|
|
+ {
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Coral));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Cyan));
|
|
|
+ solidColorBrushes.Add(new SolidColorBrush(Colors.Honeydew));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -60,9 +62,9 @@ namespace Aitex.UI.RecipeEditor
|
|
|
public void OnDeleteStep()
|
|
|
{
|
|
|
if (CurrentRecipe != null&& CurrentRecipe.Steps.Count>0)
|
|
|
- {
|
|
|
+ {
|
|
|
CurrentRecipe.Steps.RemoveAt(CurrentRecipe.Steps.Count - 1);
|
|
|
- currentGrid.ColumnDefinitions.RemoveAt(currentGrid.ColumnDefinitions.Count-1);
|
|
|
+ LoadRecipe(CurrentRecipe);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -83,9 +85,9 @@ namespace Aitex.UI.RecipeEditor
|
|
|
|
|
|
CurrentRecipe = recipe;
|
|
|
Grid grid = new Grid();
|
|
|
-
|
|
|
+ grid.Margin = new Thickness(15);
|
|
|
GridOptions.SetShowBorder(grid, true);
|
|
|
- GridOptions.SetLineBrush(grid, Brushes.White);
|
|
|
+ GridOptions.SetLineBrush(grid, Brushes.Black);
|
|
|
GridOptions.SetLineThickness(grid, 1);
|
|
|
|
|
|
recipe.Steps.ToList().ForEach(x =>
|
|
@@ -203,6 +205,8 @@ namespace Aitex.UI.RecipeEditor
|
|
|
case "Int32":
|
|
|
case "String":
|
|
|
TextBox textBox = new TextBox();
|
|
|
+ textBox.BorderThickness = new Thickness(0);
|
|
|
+
|
|
|
textBox.SetBinding(TextBox.TextProperty, binding);
|
|
|
grid.Children.Add(textBox);
|
|
|
Grid.SetRow(textBox, i);
|
|
@@ -216,6 +220,9 @@ namespace Aitex.UI.RecipeEditor
|
|
|
|
|
|
case "Boolean":
|
|
|
CheckBox checkBox = new CheckBox();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
checkBox.SetBinding(CheckBox.IsCheckedProperty, binding);
|
|
|
grid.Children.Add(checkBox);
|
|
|
Grid.SetRow(checkBox, i);
|
|
@@ -224,6 +231,11 @@ namespace Aitex.UI.RecipeEditor
|
|
|
|
|
|
default:
|
|
|
ComboBox comboBox = new ComboBox();
|
|
|
+ comboBox.BorderThickness = new Thickness(0);
|
|
|
+ comboBox.Style = new Style();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
comboBox.SetBinding(ComboBox.SelectedItemProperty, binding);
|
|
|
ItemsControlHelper.SetEnumValuesToItemsSource(comboBox, true);
|
|
|
grid.Children.Add(comboBox);
|
|
@@ -241,7 +253,7 @@ namespace Aitex.UI.RecipeEditor
|
|
|
TextBlock textBlock = new TextBlock();
|
|
|
textBlock.Text = propertyInfoName;
|
|
|
grid.Children.Add(textBlock);
|
|
|
-
|
|
|
+ textBlock.Background = new SolidColorBrush(Colors.BurlyWood);
|
|
|
Grid.SetRow(textBlock, i);
|
|
|
Grid.SetColumn(textBlock, 0);
|
|
|
}
|
|
@@ -285,11 +297,13 @@ namespace Aitex.UI.RecipeEditor
|
|
|
var item = propertyInfo.PropertyType.Name;
|
|
|
if (propertyInfo.Name == "UnitName")
|
|
|
{
|
|
|
- TextBlock textBlock1 = new TextBlock();
|
|
|
+ TextBox textBlock1 = new TextBox();
|
|
|
|
|
|
|
|
|
textBlock1.Text = propertyInfo.GetValue(x).ToString();
|
|
|
+ textBlock1.BorderThickness = new Thickness(0);
|
|
|
textBlock1.Foreground = Brushes.Red;
|
|
|
+ textBlock1.IsReadOnly = true;
|
|
|
|
|
|
grid.Children.Add(textBlock1);
|
|
|
Grid.SetRow(textBlock1, i);
|
|
@@ -303,6 +317,8 @@ namespace Aitex.UI.RecipeEditor
|
|
|
case "String":
|
|
|
TextBox textBox = new TextBox();
|
|
|
textBox.BorderBrush = Brushes.Transparent;
|
|
|
+ textBox.BorderThickness = new Thickness(0);
|
|
|
+
|
|
|
textBox.SetBinding(TextBox.TextProperty, binding);
|
|
|
grid.Children.Add(textBox);
|
|
|
Grid.SetRow(textBox, i);
|
|
@@ -316,6 +332,7 @@ namespace Aitex.UI.RecipeEditor
|
|
|
|
|
|
case "Boolean":
|
|
|
CheckBox checkBox = new CheckBox();
|
|
|
+ checkBox.Margin = new Thickness(1);
|
|
|
checkBox.SetBinding(CheckBox.IsCheckedProperty, binding);
|
|
|
grid.Children.Add(checkBox);
|
|
|
Grid.SetRow(checkBox, i);
|
|
@@ -324,8 +341,9 @@ namespace Aitex.UI.RecipeEditor
|
|
|
|
|
|
default:
|
|
|
ComboBox comboBox = new ComboBox();
|
|
|
- comboBox.BorderBrush = Brushes.Transparent;
|
|
|
-
|
|
|
+ comboBox.Style = new Style();
|
|
|
+ comboBox.BorderThickness = new Thickness(0);
|
|
|
+ comboBox.Background = Brushes.White;
|
|
|
string path = propertyInfo.Name;
|
|
|
comboBox.SetBinding(ComboBox.SelectedItemProperty, binding);
|
|
|
ItemsControlHelper.SetEnumValuesToItemsSource(comboBox, true);
|
|
@@ -339,6 +357,8 @@ namespace Aitex.UI.RecipeEditor
|
|
|
{
|
|
|
TextBlock textBlock = new TextBlock();
|
|
|
textBlock.Text = propertyInfo.Name;
|
|
|
+ textBlock.Background = solidColorBrushes[k % 3];
|
|
|
+
|
|
|
grid.Children.Add(textBlock);
|
|
|
Grid.SetRow(textBlock, i);
|
|
|
Grid.SetColumn(textBlock, 0);
|