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(); } }
private FlatViewModel FindFlat(int flatNumber) { FlatDecoratorViewModel targetFlat = allFloors .SelectMany(decorator => decorator.OriginaFloorViewModel.FlatsEnumerable) .FirstOrDefault(flatDecorator => flatDecorator.Flat.Number == flatNumber); return(targetFlat?.Flat); }
private static void SaveImpl(FlatDecoratorViewModel flatDecorator) { bool saved = flatDecorator.Save(); if (saved) { RelationsProvider.SaveOrUpdateOwnRelation(flatDecorator.OwnerDecorator.AborigenEditable.GetId(), flatDecorator.Flat.Number); flatDecorator.OnSaved(); } }
private static void ShowFlatIndicationsImpl(FlatDecoratorViewModel flat) { flat.Publish(new MessageShowFlatIndications(flat)); }
private void SimpleFlatView_OnEventShowOwnerDetails(FlatDecoratorViewModel flat) { this.Publish(new MessageShowAborigenDetails(flat.OwnerDecorator)); }
private void SimpleFlatView_OnEventShowFlatDetails(FlatDecoratorViewModel flat) { this.Publish(new MessageShowFlatDetails(flat)); }
public MessageShowFlatIndications(FlatDecoratorViewModel flatDecorator) { FlatDecorator = flatDecorator; }
private static bool CanSave(FlatDecoratorViewModel flatDecorator) { return(flatDecorator != null); }