private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            var sequence = "";

            GetInput(ref sequence);
            if (!string.IsNullOrEmpty(sequence))
            {
                GetReferenceCoordinates(out var x_ref, out var y_ref, out var x, out var y);

                GetCoordinates(ref x, ref y, ref sequence);

                int totalRow = 0, totalCol = 0;

                GetRowColCount(ref totalRow, ref totalCol);

                bool isXinBounds = isValidX(x, totalCol);
                bool isYinBounds = isValidY(y, totalRow);

                string outputStr = GetOutput(x, y, x_ref, y_ref, isXinBounds, isYinBounds, totalCol, totalRow);



                int cols = CheckCount(int.Parse(txtColCount.Text), 12);
                int row  = CheckCount(int.Parse(txtColCount.Text), 12);

                if (isXinBounds && isYinBounds)
                {
                    dynamicGridViewModel = new DynamicGridViewModel()
                    {
                        GridWidth   = cols,
                        GridHeight  = row,
                        BorderColor = Colors.Blue,
                        StartColor  = Colors.Azure,
                        FinishColor = Colors.CornflowerBlue,
                        posX        = x,
                        posY        = y,
                    };
                    dynamicGridViewModel.SelectCell(x, y, Colors.Gray);
                    DataContext = dynamicGridViewModel;
                }

                RefreshText(ref outputStr);
            }
            else
            {
                sequence = "";
                MessageBox.Show("Input cant be empty");
            }
        }
 public MainWindow()
 {
     InitializeComponent();
     dynamicGridViewModel = new DynamicGridViewModel
     {
         GridWidth   = 12,
         GridHeight  = 12,
         BorderColor = Colors.Blue,
         StartColor  = Colors.Azure,
         FinishColor = Colors.CornflowerBlue,
         posX        = 11,
         posY        = 11,
     };
     _y = dynamicGridViewModel.GridHeight;
     _x = dynamicGridViewModel.GridWidth;
     dynamicGridViewModel.SelectCell(0, 11, Colors.Gray);
     DataContext = dynamicGridViewModel;
 }