Beispiel #1
0
        private static void SortRoomsSelectedTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisitorRoomsControlModel model = d as VisitorRoomsControlModel;

            if (model is null)
            {
                return;
            }

            string value = e.NewValue as string;

            if (value is null)
            {
                return;
            }

            if (model.RoomCollectionViewV.GroupDescriptions.Count > 0 ||
                model.RoomCollectionViewV.SortDescriptions.Count > 0)
            {
                model.RoomCollectionViewV.GroupDescriptions.RemoveAt(0);
                model.RoomCollectionViewV.SortDescriptions.RemoveAt(0);
            }

            model.RoomCollectionViewV.GroupDescriptions.Add(new PropertyGroupDescription(value));
            model.RoomCollectionViewV.SortDescriptions.Add(new SortDescription(value, ListSortDirection.Ascending));

            model.RoomCollectionViewV.Refresh();
        }
Beispiel #2
0
        private void InitializeTabs()
        {
            VisitorDashboardTabItems = new List <TabItem>();

            var item1 = new TabItem();

            _roomsControlModel = new VisitorRoomsControlModel(_mainController, _hotel, _dialogService);
            var control1 = new VisitorRoomsControl(_roomsControlModel);

            item1.Content = control1;
            item1.Header  = VisitorRoomsTabHeader;

            var item2 = new TabItem();

            _bookingsControlModel = new VisitorBookingsControlModel(_mainController, _hotel, _dialogService);
            var control2 = new VisitorBookingsControl(_bookingsControlModel);

            item2.Content = control2;
            item2.Header  = VisitorBookingsTabHeader;

            VisitorDashboardTabItems.Add(item1);
            VisitorDashboardTabItems.Add(item2);
        }