예제 #1
0
        private void DrawObject()
        {
            TabItem TI = new TabItem {
                Header = "Объекты"
            };

            //ThisTC.Items.Add(TI);
            TI.Add(ThisTC);

            Grid grid = new Grid {
                Background = Brushes.LightSteelBlue
            };

            TabControl TC = new TabControl {
                Margin = new Thickness(2)
            };

            TextBlock text = new TextBlock
            {
                Text     = "Объекты",
                FontSize = 20
            };

            grid.SetRowFromGrid(MyTools.GL_Auto);
            grid.SetFromGrid(text);
            grid.SetRowFromGrid(new GridLength(1, GridUnitType.Star));
            grid.SetFromGrid(TC.VerticalHorisontalScroll_From_Control());
            TI.Content = grid;

            foreach (var objecte in client.Objects)
            {
                TabItem Ti = new TabItem {
                    Header = $"Папка - {objecte.NumberFolder}"
                };

                WrapPanel wp = new WrapPanel {
                    Orientation = Orientation.Vertical
                };
                Ti.Content = wp;
                TC.Items.Add(Ti);
                wp.Children.Add(objecte.GetEditor(SFE, WH, Column.Objecte));

                wp.Children.Add(DetailObj(objecte));
                wp.Children.Add(MidMonthVolume(objecte));
                wp.Children.Add(ObjFromRes(objecte));
                wp.Children.Add(WellObj(objecte));
            }

            AdderMenuWithDefaultKeys(text, G.Objecte
                                     , new KeyValuePair <int, object>[]
                                     { new KeyValuePair <int, object>(C.Objecte.NumberFolder, default(int)) }
                                     , new KeyValuePair <int, object>[]
                                     { new KeyValuePair <int, object>(C.Objecte.Client, clientID) }
                                     , new KeyValuePair <int, object>(C.Objecte.Client, client.ID),
                                     new KeyValuePair <int, object>(C.Objecte.YMFrom, DateControl_Class.SelectMonth - 1));
        }