Пример #1
0
        private static void SelectOwnerImpl(FlatDecoratorViewModel flatDecorator)
        {
            Window window = Extensions.WindowExtensions.CreateEmptyVerticalWindow();

            window.MakeSticky();

            AborigenDecoratorViewModel selectedDecorator = null;

            void SelectView_OntAborigenSelected(AborigenDecoratorViewModel decorator)
            {
                selectedDecorator   = decorator;
                window.DialogResult = true;
            }

            var selectView = new SelectAborigenView();

            selectView.EventAborigenSelected += SelectView_OntAborigenSelected;
            window.Title = Resources.AborigensSelection;
            window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            window.Owner   = Application.Current.MainWindow;
            window.Content = selectView;
            window.ShowDialog();

            selectView.EventAborigenSelected -= SelectView_OntAborigenSelected;
            if (selectedDecorator != null)
            {
                flatDecorator.SetOwner(selectedDecorator);
                CommandSave.RaiseCanExecuteChanged();
            }
        }
Пример #2
0
        private FlatViewModel FindFlat(int flatNumber)
        {
            FlatDecoratorViewModel targetFlat =
                allFloors
                .SelectMany(decorator => decorator.OriginaFloorViewModel.FlatsEnumerable)
                .FirstOrDefault(flatDecorator => flatDecorator.Flat.Number == flatNumber);

            return(targetFlat?.Flat);
        }
Пример #3
0
        private static void SaveImpl(FlatDecoratorViewModel flatDecorator)
        {
            bool saved = flatDecorator.Save();

            if (saved)
            {
                RelationsProvider.SaveOrUpdateOwnRelation(flatDecorator.OwnerDecorator.AborigenEditable.GetId(), flatDecorator.Flat.Number);
                flatDecorator.OnSaved();
            }
        }
Пример #4
0
 private static void ShowFlatIndicationsImpl(FlatDecoratorViewModel flat)
 {
     flat.Publish(new MessageShowFlatIndications(flat));
 }
Пример #5
0
 private void SimpleFlatView_OnEventShowOwnerDetails(FlatDecoratorViewModel flat)
 {
     this.Publish(new MessageShowAborigenDetails(flat.OwnerDecorator));
 }
Пример #6
0
 private void SimpleFlatView_OnEventShowFlatDetails(FlatDecoratorViewModel flat)
 {
     this.Publish(new MessageShowFlatDetails(flat));
 }
 public MessageShowFlatIndications(FlatDecoratorViewModel flatDecorator)
 {
     FlatDecorator = flatDecorator;
 }
Пример #8
0
 private static bool CanSave(FlatDecoratorViewModel flatDecorator)
 {
     return(flatDecorator != null);
 }