Ejemplo n.º 1
0
        private async void btnAddResident_Click(object sender, RoutedEventArgs e)
        {
            AddResidentDialog dlg = new AddResidentDialog(_home.ResidentCollection.Count);

            dlg.MinWidth = Window.Current.Bounds.Width * 0.8;
            dlg.MaxWidth = Window.Current.Bounds.Width * 0.8;
            var result = await dlg.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                _home.AddResident(dlg.residentViewModel);
                await _home.dataset.SaveToFolder();
            }
        }