public ProductsWindow(MainWindow parent, List<RoomItem> rooms, List<ManufacturerItem> manufacturers)
        {
            InitializeComponent();

            mRooms = rooms;
            mParent = parent;

            CBRoom.ItemsSource = mRooms;
            CBRoom.SelectedIndex = 0;

            CBNamufacturer.ItemsSource = manufacturers;
            CBNamufacturer.SelectedIndex = 0;

            if(rooms.Count == 0 || rooms[0].child.Count ==0 || rooms[0].child[0].child.Count == 0 || manufacturers.Count == 0)
            {
                MessageBox.Show("Nemozno pridat produkt pretoze nemas izby alebo vyrobcov");
                BTNAdd.IsEnabled = false;
            }

            var Items = new Dictionary<string, object>();
            var names = Enum.GetNames(typeof(ObjectPlacementOptions));
            var options = Enum.GetValues(typeof(ObjectPlacementOptions)).Cast<ObjectPlacementOptions>().ToArray();
            for (int i = 1; i < names.Length; i++)
            {
                Items.Add(names[i], options[i]);
            }

            var SelectedItems = new Dictionary<string, object>();

            MC.ItemsSource = Items;
            MC.SelectedItems = SelectedItems;
        }
        public ManufacturersWindow(List<ManufacturerItem> manufacturers, MainWindow parent)
        {
            InitializeComponent();

            mManufacturers = new ObservableCollection<ManufacturerItem>(manufacturers);
            ManufacturersList.ItemsSource = mManufacturers;
            mParent = parent;
        }
        public RoomManagementWindow(MainWindow parent, JsonBase json)
        {
            InitializeComponent();

            mParent = parent;
            this.json = json;

            tvRooms.ItemTemplateSelector = new A();
            tvRooms.ItemsSource = new List<JsonBase>() { json };
        }
Beispiel #4
0
        public DWWindow(MainWindow parent, DW doors, DW windows)
        {
            InitializeComponent();

            observableDoors = new ObservableCollection<DWItem>(doors.child);
            observableWindows = new ObservableCollection<DWItem>(windows.child);
            mParent = parent;

            ItemsDoors.ItemsSource = observableDoors;
            ItemsWindows.ItemsSource = observableWindows;
        }