public DrawAreaViewModel()
        {
            GridHeight = HEIGHT;
            GridWidth = WIDTH;

            inputBlock = JsonToDML.DMLUIElementName.InputBlock;
            outputBlock = JsonToDML.DMLUIElementName.OutputBlock;
            pauseBlock = JsonToDML.DMLUIElementName.PauseBlock;
            currentBlockType = JsonToDML.DMLUIElementSyntax.InputBlock;

            CreateFileWatcher();

            inputBlockPropertiesViewModel = new InputBlockPropertiesViewModel();
            inputBlockPropertiesViewModel.OnParameterChange += ParameterViewModel_OnParameterChange_Input;
            inputBlockPropertiesViewModel.inputBlockVisibility = Visibility.Hidden;

            outputBlockPropertiesViewModel = new OutputBlockPropertiesViewModel();
            outputBlockPropertiesViewModel.OnParameterChange += ParameterViewModel_OnParameterChange_Output;
            outputBlockPropertiesViewModel.outputBlockVisibility = Visibility.Hidden;
        }
            private void createBlock(int row, int col, int blockWidth, int blockHeight)
            {
                if (currentBlockType == JsonToDML.DMLUIElementSyntax.InputBlock)
                {
                    InputBlockPropertiesViewModel ob = new InputBlockPropertiesViewModel();
                    ob.OnParameterChange += ParameterViewModel_OnParameterChange_Input;
                
                    int numberOfBlocksLabel;
                    int numberOfBlocksBox;
                    LabelTextBox ltb = new LabelTextBox();
                    ltb.DataContext = ob;

                    uid++;
                    ob.ID = uid.ToString();
                    ob.Row = row.ToString();
                    ob.Col = col.ToString();
                    ob.dmlKeyword = currentBlockType;
                    ltb.txb.Text = "Label";
             
                    Size s = MeasureTextSize(ltb.txb.Text, ltb);
                    numberOfBlocksLabel = (int)Math.Ceiling((double)(Math.Ceiling(s.Width) / WIDTH));
                    numberOfBlocksBox = blockWidth - numberOfBlocksLabel;

                    ltb.Width = blockWidth * WIDTH;
                    ltb.Height = blockHeight * HEIGHT;

                    ltb.txb.Width = WIDTH * numberOfBlocksLabel;
                    ltb.txb.Height = HEIGHT * blockHeight;

                    ltb.txt.Width = WIDTH * numberOfBlocksBox;
                    ltb.txt.Height = HEIGHT * blockHeight;

                    ltb.txt.BorderBrush = Brushes.Red;
                    ltb.txt.BorderThickness = new Thickness(2, 2, 2, 2);

                    ltb.txt.TextChanged += blockTextChange;
                    ltb.PreviewKeyDown += selectInputBlock;
                    ltb.PreviewMouseDown += mouseClickInputBlock;

                    Grid.SetRow(ltb, row);
                    Grid.SetColumn(ltb, col - numberOfBlocksLabel);
                    Grid.SetColumnSpan(ltb, ((int)(ltb.Width) / WIDTH));
                    Grid.SetRowSpan(ltb, ((int)(ltb.Height) / HEIGHT));
                    MyGrid.Children.Add(ltb);

                    var blockName = "BLOCK";
                    blockNameCount = blockNameCount + 1;
                    blockName = "BLOCK_" + blockNameCount;

                    daElement = new DrawAreaUiElement(ob.ID, currentBlockType, ob.Row.ToString(), ob.Col.ToString(), blockName, "TOKEN", "", "#TARGET", "#SOURCE", "", ltb.txt.Width.ToString(), "12", ltb.txt.Height.ToString());
                    daList.addUIElementToUIElementList(daElement);
                    DrawToJSON.DrawAreaToJSON(daList.UIL);

                    inputBlockPropertiesViewModel = ob;
                    viewModelList.Add(ob);
                    inputBlockPropertiesViewModel.inputBlockVisibility = Visibility.Visible;
                    outputBlockPropertiesViewModel.outputBlockVisibility = Visibility.Collapsed;
                }
                else if (currentBlockType == JsonToDML.DMLUIElementSyntax.OutputBlock)
                {
                    OutputBlockPropertiesViewModel ob = new OutputBlockPropertiesViewModel();
                    ob.OnParameterChange += ParameterViewModel_OnParameterChange_Output;

                    int numberOfBlocksLabel;
                    int numberOfBlocksBox;
                    LabelTextBox ltb = new LabelTextBox();
                    ltb.DataContext = ob;

                    uid++;
                    ob.ID = uid.ToString();
                    ob.Row = row.ToString();
                    ob.Col = col.ToString();
                    ob.dmlKeyword = currentBlockType;
                    ltb.txb.Text = "Label";

                    Size s = MeasureTextSize(ltb.txb.Text, ltb);
                    numberOfBlocksLabel = (int)Math.Ceiling((double)(Math.Ceiling(s.Width) / WIDTH));
                    numberOfBlocksBox = blockWidth - numberOfBlocksLabel;

                    ltb.Width = blockWidth * WIDTH;
                    ltb.Height = blockHeight * HEIGHT;

                    ltb.txb.Width = WIDTH * numberOfBlocksLabel;
                    ltb.txb.Height = HEIGHT * blockHeight;

                    ltb.txt.Width = WIDTH * numberOfBlocksBox;
                    ltb.txt.Height = HEIGHT * blockHeight;

                    ltb.txt.BorderBrush = Brushes.Red;
                    ltb.txt.BorderThickness = new Thickness(2, 2, 2, 2);

                    ltb.txt.TextChanged += blockTextChange;
                    ltb.PreviewKeyDown += selectOutputBlock;
                    ltb.PreviewMouseDown += mouseClickOutputBlock;

                    Grid.SetRow(ltb, row);
                    Grid.SetColumn(ltb, col - numberOfBlocksLabel);
                    Grid.SetColumnSpan(ltb, ((int)(ltb.Width) / WIDTH));
                    Grid.SetRowSpan(ltb, ((int)(ltb.Height) / HEIGHT));
                    MyGrid.Children.Add(ltb);

                    var blockName = "BLOCK";
                    blockNameCount = blockNameCount + 1;
                    blockName = "BLOCK_" + blockNameCount;

                    daElement = new DrawAreaUiElement(ob.ID, currentBlockType, ob.Row.ToString(), ob.Col.ToString(), blockName, "TOKEN", "", "#TARGET", "#SOURCE", "", ltb.txt.Width.ToString(), "12", ltb.txt.Height.ToString());
                    daList.addUIElementToUIElementList(daElement);
                    DrawToJSON.DrawAreaToJSON(daList.UIL);

                    outputBlockPropertiesViewModel = ob;
                    viewModelOutputList.Add(ob);
                    inputBlockPropertiesViewModel.inputBlockVisibility = Visibility.Collapsed;
                    outputBlockPropertiesViewModel.outputBlockVisibility = Visibility.Visible;
                }
            }