Exemple #1
0
        private static void ChooseProperContent(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ListContentControl control = (ListContentControl)obj;

            switch ((ListViewModelStates)args.NewValue)
            {
            case ListViewModelStates.Results:
                control.Content = control.ResultsView;
                break;

            case ListViewModelStates.Idle:
                //if (IsAnimationEnabled) ChangeContentUsingAnimation(InitialView);
                //else
                control.Content = control.InitialView;
                break;

            case ListViewModelStates.NoResults:
                //if (IsAnimationEnabled) ChangeContentUsingAnimation(NoResultsView);
                //else
                control.Content = control.NoResultsView;
                break;

            case ListViewModelStates.Progress:
                //if (IsAnimationEnabled) ChangeContentUsingAnimation(ProgressView);
                //else
                control.Content = control.ProgressView;
                break;

            case ListViewModelStates.Error:
                //if (IsAnimationEnabled) ChangeContentUsingAnimation(ErrorView);
                //else
                control.Content = control.ErrorView;
                break;

            default:
                throw new NotImplementedException("Stan " + (ListViewModelStates)args.NewValue + " nie jest obsługiwany przez kontrolkę.");
            }
        }
Exemple #2
0
        private static void InitialViewChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            ListContentControl control = dependencyObject as ListContentControl;

            control.Content = control.InitialView;
        }