Beispiel #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.CbPlanogramSize.Items.Clear();
            this.CbPlanogramSize.ItemsSource = new List <Scale>
            {
                new Scale {
                    ID = 1, Name = "Small", Description = "Test Scale Only (100 items, 24 slots)"
                },
                new Scale {
                    ID = 2, Name = "Large", Description = "Production Scale (5000 items, 288 slots)"
                }
            };
            this.CbPlanogramSize.DisplayMemberPath = "NameDescription";
            //dataPanel = new DataPanel();
            setSelectedPlanogramSize();
            InitializeGrid(planogram, Colors.LightGray, true);
            InitializeGrid(planogramTensorflow, Colors.LightGray);


            // TEMPORARY, for now we get the items at start up for debugging purposes
            using (PlanogramContext ctx = new PlanogramContext())
            {
                MockData mock = new MockData(ctx);
                itemsCache = mock.GetItemsWithAttr();
                simSettings.ItemMetricMin = mock.GetItemMinimumScore(simSettings);
                simSettings.ItemMetricMax = mock.GetItemMaximumScore(simSettings);
            }
        }
Beispiel #2
0
 public MockData()
 {
     _items      = new List <Item>();
     _attributes = new List <Attributes>();
     _context    = new PlanogramContext();
     rnd         = new Random();
 }
Beispiel #3
0
        private void showDataPanelDlg()
        {
            var dataPanel = new DataPanel();

            if (isSmallPlangoram)
            {
                dataPanel.NumItems   = SMALL_ITEMS_COUNT;
                dataPanel.NumShelves = 1;
                dataPanel.NumSlots   = 24;
            }
            else
            {
                dataPanel.NumItems   = LARGE_ITEMS_COUNT;
                dataPanel.NumShelves = 12;
                dataPanel.NumSlots   = 24;
            }

            dataPanel.Closed += (s, ee) => {
                dataPanel = new DataPanel();
                setSelectedPlanogramSize();
                InitializeGrid(planogram, Colors.LightGray, true);
                InitializeGrid(planogramTensorflow, Colors.LightGray);
            };

            dataPanel.NumItems   = simSettings.NumItems;
            dataPanel.NumShelves = simSettings.NumShelves;
            dataPanel.NumSlots   = simSettings.NumSlots;

            dataPanel.dataGrid.Loaded += (ss, evv) => {
                bool exist = false;
                using (PlanogramContext ctx = new PlanogramContext())
                {
                    exist = ctx.Database.Exists();
                }

                if (exist)
                {
                    dataPanel.dataGrid.ItemsSource = dataFactory.Items; // Setting data source for the DataPanel's datagrid
                    dataPanel.Items = dataFactory.Items;                // Store the items to a new List for searching purposes
                    dataPanel.dataGrid.AutoGenerateColumns = false;

                    // Binding and settings of datagrid columns
                    dataPanel.dataGrid.Columns.Add(new DataGridTextColumn()
                    {
                        Header = "ID", Binding = new Binding("ID"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
                    });
                    dataPanel.dataGrid.Columns.Add(new DataGridTextColumn()
                    {
                        Header = "SKU", Binding = new Binding("SKU"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
                    });
                    dataPanel.dataGrid.Columns.Add(new DataGridTextColumn()
                    {
                        Header = "Name", Binding = new Binding("Name"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
                    });
                }
            };

            dataPanel.ShowDialog();
        }
 private void calculateMaxScore()
 {
     using (PlanogramContext ctx = new PlanogramContext())
     {
         MockData mock = new MockData(ctx);
         MAX_SCORE = mock.GetItemMaxScoreForTop(simSettings);
     }
 }
Beispiel #5
0
 private static void DropDB(PlanogramContext ctx, string dbName)
 {
     if (ctx != null && !string.IsNullOrEmpty(dbName))
     {
         ctx.DropDB(dbName);
         System.Diagnostics.Debug.WriteLine("Db dropped...");
     }
 }
 private void btnDownloadRetailData_Click(object sender, RoutedEventArgs e)
 {
     using (PlanogramContext context = new PlanogramContext())
     {
         MockData data = new MockData(context);
         data.DownloadRetailData();
     }
 }
Beispiel #7
0
        public MockData(PlanogramContext context)
        {
            items      = new List <Item>();
            attributes = new List <Attributes>();

            this.context = context;

            rnd = new Random();
        }
Beispiel #8
0
 public void DropDB(string dbName)
 {
     using (PlanogramContext ctx = new PlanogramContext())
     {
         if (ctx.DBExists(dbName))
         {
             DropDB(ctx, dbName);
         }
     }
 }
        public double CalculateMaxScore()
        {
            using (PlanogramContext ctx = new PlanogramContext())
            {
                MockData mock = new MockData(ctx);
                MAX_SCORE = mock.GetItemMaxScoreForTop(simSettings);
            }

            return(MAX_SCORE);
        }
Beispiel #10
0
        private void CbPlanogramSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var a = sender as ComboBox;

            var s     = a.SelectedItem as ComboBoxItem;
            var scale = a.SelectedItem as Scale;
            var i     = scale.Name;

            if (i == "Small")
            {
                this.simSettings.NumItems   = SMALL_ITEMS_COUNT;
                this.simSettings.NumShelves = 1;
                this.simSettings.NumSlots   = 24;

                this.isSmallPlangoram = true;
                //this.dataPanel.NumItems = SMALL_ITEMS_COUNT;
                //this.dataPanel.NumShelves = 1;
                //this.dataPanel.NumSlots = 24;
            }
            else if (i == "Large")
            {
                this.simSettings.NumItems   = LARGE_ITEMS_COUNT;
                this.simSettings.NumShelves = 12;
                this.simSettings.NumSlots   = 24;

                this.isSmallPlangoram = false;
                //this.dataPanel.NumItems = LARGE_ITEMS_COUNT;
                //this.dataPanel.NumShelves = 12;
                //this.dataPanel.NumSlots = 24;
            }

            if (headToHead)
            {
                FillGrid(planogram, Colors.LightGray);
                FillGrid(planogramTensorflow, Colors.LightGray);
            }
            else
            {
                FillGrid(planogram, Colors.LightGray);
            }

            int count;

            using (PlanogramContext ctx = new PlanogramContext())
            {
                MockData data = new MockData(ctx);
                count = data.GetItemsCount();
            }

            if (count != simSettings.NumItems)
            {
                showDataPanelUntil();
            }
        }
        private void showDataPanelDlg()
        {
            dataPanel.Closed += (s, ee) => {
                dataPanel = new DataPanel();
                setSelectedPlanogramSize();
            };

            dataPanel.NumItems   = simSettings.NumItems;
            dataPanel.NumShelves = simSettings.NumShelves;
            dataPanel.NumSlots   = simSettings.NumSlots;

            dataPanel.dataGrid.Loaded += (ss, evv) => {
                bool exist = false;
                using (PlanogramContext ctx = new PlanogramContext())
                {
                    exist = ctx.Database.Exists();
                }

                if (exist)
                {
                    dataPanel.dataGrid.ItemsSource = dataFactory.Items; // Setting data source for the DataPanel's datagrid
                    dataPanel.Items = dataFactory.Items;                // Store the items to a new List for searching purposes
                    dataPanel.dataGrid.AutoGenerateColumns = false;

                    // Binding and settings of datagrid columns
                    dataPanel.dataGrid.Columns.Add(new DataGridTextColumn()
                    {
                        Header = "ID", Binding = new Binding("ID"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
                    });
                    dataPanel.dataGrid.Columns.Add(new DataGridTextColumn()
                    {
                        Header = "SKU", Binding = new Binding("SKU"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
                    });
                    dataPanel.dataGrid.Columns.Add(new DataGridTextColumn()
                    {
                        Header = "Name", Binding = new Binding("Name"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
                    });
                }
            };

            dataPanel.ShowDialog();
        }
Beispiel #12
0
        private async void generateDataBtn_Click(object sender, RoutedEventArgs e)
        {
            using (PlanogramContext context = new PlanogramContext())
            {
                MockData data = new MockData(context);

                data.NumItems = this.NumItems;

                generateDataBtn.IsEnabled  = false;
                DataProgressBar.Visibility = Visibility.Visible;
                //todo: ask for confirmation
                if (context.Items.Count() > 0)
                {
                    var confirmation = MessageBox.Show("Warning! You currently have an existing database. Generating a new set of data will overwrite the current one. Proceed?", "Confirmation", MessageBoxButton.OKCancel, MessageBoxImage.Question);
                    //var confirmation = MessageBox.Show("Warning! You currently have an existing database. Generating a new set of data will overwrite the current one. Proceed?", "Confirmation", MessageBoxButton.OKCancel, MessageBoxImage.Question);
                    if (confirmation == MessageBoxResult.OK)
                    {
                        //todo: dropDb and generate a new data set
                        context.Database.Delete();
                        context.Database.CreateIfNotExists();

                        this.dataGrid.ItemsSource = dataFactory.Items;
                        this.Items = dataFactory.Items;

                        data.Progress    += dataPanelProgress;
                        data.Refreshdata += refreshDataGrid;
                        await data.Generate();
                    }
                    else
                    {
                        generateDataBtn.IsEnabled  = true;
                        DataProgressBar.Visibility = Visibility.Hidden;
                    }
                }
                else
                {
                    data.Progress    += dataPanelProgress;
                    data.Refreshdata += refreshDataGrid;
                    await data.Generate();
                }
            }
        }
        private void UpdateRLMStatus(string statusMsg, bool isDone = false)
        {
            Dispatcher.Invoke(() =>
            {
                statusTxt.Text = statusMsg;
                isRLMDone      = isDone;

                if (headToHead)
                {
                    if (isRLMDone)
                    {
                        Task.Run(() => {
                            Item[] items;
                            using (PlanogramContext ctx = new PlanogramContext())
                            {
                                MockData mock             = new MockData(ctx);
                                items                     = mock.GetItemsWithAttr();
                                simSettings.ItemMetricMin = mock.GetItemMinimumScore(simSettings);
                                simSettings.ItemMetricMax = mock.GetItemMaximumScore(simSettings);
                            }

                            // let's tensorflow (or other listeners) know that it should start training
                            OnSimulationStart?.Invoke(items, simSettings);
                        });

                        if (isTensorflowDone)
                        {
                            EnableControlButtons(true);
                        }
                    }
                }
                else
                {
                    if (isRLMDone)
                    {
                        EnableControlButtons(true);
                    }
                }
            });
        }
        public async void GenerateDataBtn_Click(object sender, RoutedEventArgs e)
        {
            GenerateDataEvent?.Invoke(0, "Preparing data generation...", false);

            try
            {
                using (PlanogramContext context = new PlanogramContext())
                {
                    int dataCount = context.Items.Count();
                    if (dataCount == this.NumItems)
                    {
                        GenerateDataEvent?.Invoke(100, "", true);
                    }
                    else
                    {
                        context.Database.Delete();
                        context.Database.CreateIfNotExists();

                        MockData data = new MockData(context);
                        data.NumItems = this.NumItems;

                        //generateDataBtn.IsEnabled = false;
                        //DataProgressBar.Visibility = Visibility.Visible;

                        data.GeneratingDataEvent += (p, t, d, ex) =>
                        {
                            GenerateDataEvent?.Invoke(p, t, d, ex);
                        };

                        //data.Refreshdata += refreshDataGrid;
                        await data.Generate();
                    }
                }
            }
            catch (Exception ex)
            {
                GenerateDataEvent?.Invoke(0, "An error occured. Please click here to view the full details.", true, ex);
            }
        }
Beispiel #15
0
        public void setSelectedPlanogramSize()
        {
            int count;

            using (PlanogramContext ctx = new PlanogramContext())
            {
                MockData data = new MockData(ctx);
                count = data.GetItemsCount();
            }

            if (count == SMALL_ITEMS_COUNT)
            {
                CbPlanogramSize.SelectedIndex = 0;
            }
            else if (count == LARGE_ITEMS_COUNT)
            {
                CbPlanogramSize.SelectedIndex = 1;
            }
            else
            {
                showDataPanelUntil();
            }
        }
Beispiel #16
0
        public MockData()
        {
            items      = new List <Item>();
            attributes = new List <Attributes>();
            context    = new PlanogramContext();
            flavors    = new List <string> {
                "Mint Chocolate Chip", "Vanilla Delight", "Chocolate Fudge",
                "Coffee", "Raspberry Sherbet", "Mocha",
                "Banana Nut Fudge", "Cookies and Cream", "Birthday Cake",
                "Strawberry and Cheese", "Rock and Pop Swirl", "French Vanilla",
                "Daiquiri Ice", "Peanut Butter and Chocolate", "Pistachio Almond",
                "Peanut Butter", "Rocky Road", "Vanilla Graham",
                "Mango", "Nutty Coconut", "Berry Strawberry",
                "Orange sherbet", "Pink Bubblegum", "Chocoloate Almond",
                "Egg Nog Supreme", "Ube Avocado", "Cherry Strawyberry",
                "Chocolate Almond", "Vanilla Coffee swirl", "Lemon Custard",
                "Chocolate Chip Delight", "Blackberry",
                // new set of flavors
                "Alumni Swirl", "Arboretum Breeze", "Birthday Bash", "Bittersweet Mint", "Black Raspberry", "Black Raspberry Frozen Yogurt", "Black Walnut Frozen Yogurt", "Butter Pecan", "Caramel Peanut Cluster", "Chocolate", "Chocolate Chip Cookie Dough", "Chocolate Frozen Yogurt", "Chocolate Marble", "Chocolate Marshmallow", "Chocolate No Sugar Added", "Coconut Chip", "Coffee Frozen Yogurt", "Cookies-n-Cream", "Death By Chocolate", "Happy Happy Joy Joy", "Keeney Beany Chocolate", "Marshmallow Cup", "Monkey Business", "Peachy Paterno", "Peanut Butter Swirl", "Pistachio", "Scholar's Chip", "Strawberry", "Strawberry Cheesecake", "Strawberry No Sugar Added", "Toffee Caramel Crunch", "Vanilla", "Vanilla Frozen Yogurt", "WPSU Coffee Break", "Apple Cobbler Crunch", "August Pie", "Bananas Foster", "Berkey Brickle", "Black Cow", "Blueberry Cheesecake", "Centennial Vanilla Bean", "Cherry Cheesecake", "Cherry Quist", "Chocolate Pretzel Crunch", "Coffee Mocha Fudge", "Crazy Charlie Sundae Swirl", "Egg Nog", "Espresso Fudge Pie", "Golden Chocolate Pecan", "Lion Tracks", "LionS'more", "Mint Nittany", "Monster Mash", "Orange Vanilla Sundae", "Palmer Mousseum With Almonds", "Peanut Butter Cup", "Peanut Butter Fudge Cluster", "Peanut Butter Marshmallow", "Peppermint Stick", "Pralines N Cream", "Pumpkin Pie", "Raspberry Fudge Torte", "Raspberry Parfait", "Russ Digs Roseberry", "Sea Salt Chocolate Caramel", "Strawberry Frozen Yogurt", "Teaberry", "Tin Roof Sundae", "Toasted Almond", "Turtle Creek", "Vanilla No Sugar Added", "White House", "Wicked Caramel Sundae",
            };

            rnd = new Random();
        }
Beispiel #17
0
        public void DownloadRetailData()
        {
            string sql = @"SELECT
	                        Items.ID AS ItemID,
	                        Items.SKU,
	                        Items.Name,
	                        Attributes.Metric1,
	                        Attributes.Metric2,
	                        Attributes.Metric3,
	                        Attributes.Metric4,
	                        Attributes.Metric5,
	                        Attributes.Metric6,
	                        Attributes.Metric7,
	                        Attributes.Metric8,
	                        Attributes.Metric9,
	                        Attributes.Metric10
                        FROM Items
                        JOIN ItemAttributes ON ItemAttributes.Item_ID = Items.ID
                        JOIN Attributes ON Attributes.ID = ItemAttributes.Attributes_ID";

            using (PlanogramContext ctx = new PlanogramContext())
            {
                var            result = ctx.Database.SqlQuery <RetailData>(sql).ToList();
                SaveFileDialog saver  = new SaveFileDialog();
                saver.Filter   = "Csv file (*.csv)|*.csv";
                saver.FileName = "retail_data";
                if (saver.ShowDialog() == true)
                {
                    var pathToFile = saver.FileName;
                    using (TextWriter wr = new StreamWriter(pathToFile))
                    {
                        var csv = new CsvWriter(wr);
                        csv.WriteRecords(result);
                    }
                }
            }
        }
Beispiel #18
0
        private void runSlmBtn_Click(object sender, RoutedEventArgs e)
        {
            selectedSlotIndex = -1;
            _row    = -1;
            _col    = -1;
            itemRow = -1;
            itemCol = -1;

            SimulationPanel simPanel = new SimulationPanel();

            simPanel.SetSimSettings(simSettings);
            bool?result = simPanel.ShowDialog();

            if (result.HasValue && result.Value == true)
            {
                // resets grid to default
                usePerfColor = false;
                FillGrid(planogram, Colors.LightGray);
                if (headToHead)
                {
                    FillGrid(planogramTensorflow, Colors.LightGray);
                }

                // disable control buttons
                //statusTxt.Text = statusTxtTensor.Text = "";
                statusTxtTensor.Text = "Waiting for RLM to finish running...";
                EnableControlButtons(false);

                // set simulation settings
                simSettings.SimType                = simPanel.SimType;
                simSettings.Sessions               = simPanel.Sessions;
                simSettings.Hours                  = simPanel.Hours;
                simSettings.Score                  = simPanel.Score;
                simSettings.EnableSimDisplay       = simPanel.EnableSimDisplay;
                simSettings.DefaultScorePercentage = simPanel.simScoreSlider.Value;
                simSettings.HiddenLayers           = simPanel.HiddenLayers;
                simSettings.HiddenLayerNeurons     = simPanel.HiddenLayerNeurons;

                targetScoreTxt.Text = "";
                if (simSettings.SimType == SimulationType.Score)
                {
                    targetScoreLbl.Visibility  = Visibility.Visible;
                    targetScoreTxt.Visibility  = Visibility.Visible;
                    targetScoreTxt.Text        = simSettings.Score.Value.ToString("n");
                    targetScoreTxt2.Visibility = Visibility.Visible;
                    targetScoreTxt2.Text       = simSettings.Score.Value.ToString("n");
                }
                else
                {
                    targetScoreLbl.Visibility  = Visibility.Hidden;
                    targetScoreTxt.Visibility  = Visibility.Hidden;
                    targetScoreTxt2.Visibility = Visibility.Hidden;
                }

                if (simSettings.SimType == SimulationType.Sessions)
                {
                    sessionPerBatchLbl.Visibility = Visibility.Hidden;
                    sessionPerBatchTxt.Visibility = Visibility.Hidden;
                }
                else
                {
                    sessionPerBatchLbl.Visibility = Visibility.Visible;
                    sessionPerBatchTxt.Visibility = Visibility.Visible;
                }

                Logger.Clear();


                string dbIdentifier = "RLM_planogram_" + Guid.NewGuid().ToString("N");
                // instantiate visualizer with this window as its parent reference
                visualizer = new RLVOutputVisualizer(this);
                core       = new RLVCore(dbIdentifier);

                // subscribe mainwindow to the comparison event
                //visualizer.LearningComparisonDisplayResultsEvent += DisplayLearningComparisonResults;

                // open temporary RLV container panel
                // todo this must be embeded in this Window instead of the temporary container
                if (rlvPanel != null)
                {
                    rlvPanel.Close();
                }

                rlvPanel = new TempRLVContainerPanel(core, visualizer);

                //this.Top = 20;
                //tmpPanel.Top = this.Top;
                //this.Height = tmpPanel.Height;
                //tmpPanel.Left = 10;
                //this.Left = tmpPanel.Width + tmpPanel.Left;
                //tmpPanel.Visibility = Visibility.Hidden;

                Task.Run(() =>
                {
                    // get items from db as well as the min and max metric scores as we need that for the calculation later on
                    Item[] items;
                    using (PlanogramContext ctx = new PlanogramContext())
                    {
                        MockData mock             = new MockData(ctx);
                        items                     = itemsCache = mock.GetItemsWithAttr();
                        simSettings.ItemMetricMin = mock.GetItemMinimumScore(simSettings);
                        simSettings.ItemMetricMax = mock.GetItemMaximumScore(simSettings);
                    }

                    // let's tensorflow (or other listeners) know that it should start training
                    //OnSimulationStart?.Invoke(items, simSettings); //return;

                    // initialize and start RLM training
                    optimizer = new PlanogramOptimizer(items, simSettings, this.UpdateRLMResults, this.UpdateRLMStatus, Logger, dbIdentifier);
                    //optimizer.OnSessionDone += Optimizer_OnSessionDone;
                    optimizer.StartOptimization(tokenSource.Token);
                });
            }
        }
        private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            //DataGridRow row = (DataGridRow)(sender as DataGrid).SelectedItem; // Get the selected row
            //ItemVM itemvm = row.Item as ItemVM; // Convert the selected row to the object bound to

            if (dataGrid.SelectedItem == null)
            {
                return;
            }

            ItemVM itemvm = (ItemVM)dataGrid.SelectedItem;
            var    id     = itemvm.ID; // Get the item id

            Item item;

            using (PlanogramContext ctx = new PlanogramContext())
            {
                item = ctx.Items.Include("Attributes").FirstOrDefault(a => a.ID == id); // Get the selected item with attributes
            }
            var attrs = item.Attributes;                                                // Get the item attributes

            ItemAttributesPanel panel = new ItemAttributesPanel();                      // Instantiate the dialog to show the attributes

            panel.itemAttributesGrid.AutoGenerateColumns = false;
            panel.itemAttributesGrid.ItemsSource         = attrs; // Set the data source for the attributes grid

            // Binding and setting of columns for the datagrid
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "ID", Binding = new Binding("ID"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric1", Binding = new Binding("Metric1"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric2", Binding = new Binding("Metric2"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric3", Binding = new Binding("Metric3"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric4", Binding = new Binding("Metric4"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric5", Binding = new Binding("Metric5"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric6", Binding = new Binding("Metric6"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric7", Binding = new Binding("Metric7"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric8", Binding = new Binding("Metric8"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric9", Binding = new Binding("Metric9"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });
            panel.itemAttributesGrid.Columns.Add(new DataGridTextColumn()
            {
                Header = "Metric10", Binding = new Binding("Metric10"), Width = new DataGridLength(1, DataGridLengthUnitType.Star), IsReadOnly = true
            });

            panel.Width = 1500; // Set dialog width
            panel.ShowDialog();

            // Some operations with this row
        }