Пример #1
0
        /// <summary>
        ///     Navigated event from NavigationService
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">args</param>
        private void NavigationServiceNavigated(object sender, RegionNavigationEventArgs e)
        {
            string pathToMatch = e.Uri.ToString();

            IsSelected = IsClassNameAMatch(pathToMatch, ViewType) ||
                         ChildViews.Any(x => IsClassNameAMatch(pathToMatch, x));
        }
Пример #2
0
        /// <summary>
        /// Checks if the view can be closed
        /// </summary>
        /// <returns>True if the view can be closed, False otherwise</returns>
        public virtual bool CanClose()
        {
            // ask own model first
            if (Model != null && !Model.CanClose())
            {
                return(false);
            }

            // ask any child views next
            if (ChildViews.Any(v => !v.CanClose()))
            {
                return(false);
            }

            return(true); // all good
        }