protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Populate the scenario list from the SampleConfiguration.cs file
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                ScenarioControl.ItemsSource = mobilescenarios;
            }
            else
            {
                ScenarioControl.ItemsSource = desktopscenarios;
            }

            // If we have saved state return to the previously selected scenario
            if (SuspensionManager.SessionState.ContainsKey("SelectedScenarioIndex") && String.IsNullOrEmpty(e.Parameter.ToString()))
            {
                ScenarioControl.SelectedIndex = Convert.ToInt32(SuspensionManager.SessionState["SelectedScenarioIndex"]);
                ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
            }
            else if (!String.IsNullOrEmpty(e.Parameter.ToString()))
            {
                this.LaunchParam = e.Parameter.ToString();
                int index = 0;
                this.GetScenarioIdForLaunch(this.LaunchParam, ref index);
                ScenarioControl.SelectedIndex = index;
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;

            // If we have saved state return to the previously selected scenario
            if (SuspensionManager.SessionState.ContainsKey("SelectedScenarioIndex"))
            {
                ScenarioControl.SelectedIndex = Convert.ToInt32(SuspensionManager.SessionState["SelectedScenarioIndex"]);
                ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }
Esempio n. 3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;

            // If we have saved state return to the previously selected scenario
            if (SuspensionManager.SessionState.ContainsKey("SelectedScenarioIndex") && String.IsNullOrEmpty(e.Parameter.ToString()))
            {
                ScenarioControl.SelectedIndex = Convert.ToInt32(SuspensionManager.SessionState["SelectedScenarioIndex"]);
                ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
            }
            else if (e.Parameter != null && !String.IsNullOrEmpty(e.Parameter.ToString()))
            {
                this.LaunchParam = e.Parameter.ToString();
                int index = 0;
                this.GetScenarioIdForLaunch(this.LaunchParam, ref index);
                ScenarioControl.SelectedIndex = index;
            }
        }
Esempio n. 4
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            Common.APIClient.rootPage = MainPage.Current;

            try
            {
                IEnumerable <int> Autorizados = await Models.UsuariosModel.GetVinculos();

                // Populate the scenario list from the SampleConfiguration.cs file
                ScenarioControl.ItemsSource = from a in scenarios
                                              join b in Autorizados on a.Number equals b
                                              select a;


                foreach (var item in Autorizados)
                {
                    if (item == 23)
                    {
                        ConfLink.Visibility = Visibility;
                    }
                }

                // If we have saved state return to the previously selected scenario
                if (SuspensionManager.SessionState.ContainsKey("SelectedScenarioIndex") && String.IsNullOrEmpty(e.Parameter.ToString()))
                {
                    ScenarioControl.SelectedIndex = Convert.ToInt32(SuspensionManager.SessionState["SelectedScenarioIndex"]);
                    ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
                }
                else if (e.Parameter != null && !String.IsNullOrEmpty(e.Parameter.ToString()))
                {
                    this.LaunchParam = e.Parameter.ToString();
                    int index = 0;
                    this.GetScenarioIdForLaunch(this.LaunchParam, ref index);
                    ScenarioControl.SelectedIndex = index;
                }
            }
            catch (Exception)
            {
                // No hay menu
                NotifyUser("Usted no tiene autorizacion para usar esta aplicacion.", NotifyType.ErrorMessage);
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            String launchArgs = e.Parameter as String;

            if (launchArgs != null && launchArgs.Contains("Windows.Networking.Proximity.PeerFinder:StreamSocket"))
            {
                _isLaunchedByTap = true;

                if (launchArgs.Contains("Role=Host"))
                {
                    _appRole = PeerRole.Host;
                }
                else if (launchArgs.Contains("Role=Client"))
                {
                    _appRole = PeerRole.Client;
                }
                else
                {
                    _appRole = PeerRole.Peer;
                }
            }

            // Populate the scenario list from the SampleConfiguration.cs file
            ScenarioControl.ItemsSource = scenarios;

            // If we have saved state return to the previously selected scenario
            if (SuspensionManager.SessionState.ContainsKey("SelectedScenarioIndex"))
            {
                ScenarioControl.SelectedIndex = Convert.ToInt32(SuspensionManager.SessionState["SelectedScenarioIndex"]);
                ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
            }
            else
            {
                ScenarioControl.SelectedIndex = 0;
            }
        }
 public void NavigateToProtocolPage()
 {
     ScenarioControl.SelectedIndex = 3;
     ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
 }
 public void NavigateToFilePage()
 {
     ScenarioControl.SelectedIndex = 2;
     ScenarioControl.ScrollIntoView(ScenarioControl.SelectedItem);
 }