Exemplo n.º 1
0
        /// <summary>
        /// Saves the data, but also closes the view model in the same call if the save succeeds.
        /// </summary>
        /// <returns>
        /// <c>true</c> if successful; otherwise <c>false</c>.
        /// </returns>
        bool MVVM.IViewModel.SaveAndCloseViewModel()
        {
            if (IsClosed)
            {
                return(false);
            }

            if (!CatelViewModel.SaveViewModel())
            {
                return(false);
            }

            CatelViewModel.CloseViewModel(true);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Saves the data, but also closes the view model in the same call if the save succeeds.
        /// </summary>
        /// <returns>
        /// <c>true</c> if successful; otherwise <c>false</c>.
        /// </returns>
        async Task <bool> MVVM.IViewModel.SaveAndCloseViewModel()
        {
            if (IsClosed)
            {
                return(false);
            }

            if (!await CatelViewModel.SaveViewModel())
            {
                return(false);
            }

            await CatelViewModel.CloseViewModel(true);

            return(true);
        }