Exemple #1
0
        /// <summary>
        /// Clears the old Children
        /// Creates the new View and adds it to the Children, and Invalidates the Layout
        /// </summary>
        /// <param name="newvalue"></param>
        private void ViewModelChangedImpl(T newvalue)
        {
            var newchild = TemplateSelector.ViewFor(newvalue);

            //Verify that newchild is a contentview
            Content = newchild;
            InvalidateLayout();
        }
Exemple #2
0
        /// <summary>
        /// Clears the old Children
        /// Creates the new View and adds it to the Children, and Invalidates the Layout
        /// </summary>
        /// <param name="newvalue"></param>
        private void ViewModelChangedImpl(T newvalue)
        {
            View newChild = null;

            // check ItemTemplateSelector first
            if (currentItemSelector != null)
            {
                newChild = this.ViewFor(newvalue, currentItemSelector);
            }

            newChild = newChild ?? TemplateSelector.ViewFor(newvalue);
            //Verify that newchild is a contentview
            Content = newChild;
            InvalidateLayout(); // is this invalidate call necessary? modifying the content seems to do this already
        }