Example #1
0
        private void WindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var pageViewModel = DataContext;

            if (pageViewModel == null)
            {
                return;
            }

            FrameworkElement frameworkElement;
            var pageLayout = PageLayoutProvider.DetermineVisualState(NarrowWidth);

            if (_viewCache.ContainsKey(pageLayout))
            {
                frameworkElement = _viewCache[pageLayout];
            }
            else
            {
                frameworkElement = ViewLocator.Resolve(pageViewModel, pageLayout);
                _viewCache.Add(pageLayout, frameworkElement);
            }

            Content = frameworkElement;
            ResetAppBarContentForView(frameworkElement);
        }
Example #2
0
 protected virtual string DetermineVisualState()
 {
     return(PageLayoutProvider.DetermineVisualState(NarrowWidth).ToString());
 }