コード例 #1
0
        /// <summary>
        /// Sets the active view to the requested view with the default data context
        /// </summary>
        /// <param name="targetPage"></param>
        private void SetActiveView(CommunityCalender.ViewModels.ApplicationPage targetPage)
        {
            if (ActiveView != null)
            {
                ActiveView.Visibility = Visibility.Collapsed;
            }

            if (targetPage == ApplicationPage.EventView)
            {
                ActiveView = EventView;
            }
            else
            {
                ActiveView = MonthView;
            }

             ActiveView.Visibility = Visibility.Visible;
        }
コード例 #2
0
 /// <summary>
 /// Callback for the authentication call. Displays a control based on the 
 /// login status of the user
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void clientProxy_IsLoggedInCompleted(object sender, CommunityCalender.AuthenticationService.IsLoggedInCompletedEventArgs e)
 {
     if (e.Result == true)
     {
         MonthViewModel model = new MonthViewModel();
         model.UserGreeting = "Hi there ";
         SetActiveView(ApplicationPage.MonthView, model);
     }
     else
         SetActiveView(ApplicationPage.MonthView, null);
 }