示例#1
0
 private void NavigateToEstudiante_Click(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(frmEstudiante));
     NavigateToEstudiante.IsChecked = true;
 }
示例#2
0
 public Media()
 {
     this.InitializeComponent();
     NavigationViewControl.SelectedItem = NavigationViewControl.MenuItems.ElementAt(0);
     ContentFrame.Navigate(typeof(Views.Passenger.AudioVideoContentView), new AudioVideo("Movies", CatalogService.Instance.Movies));
 }
示例#3
0
 public bool NavigateTo(Type sourcePageType)
 {
     return(ContentFrame.Navigate(typeof(PumpsPage)));
 }
示例#4
0
 private void EnterItemControl(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(itemControlView);
 }
示例#5
0
 private void EnterCustomizedControl(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(customizedControlView);
 }
示例#6
0
        private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args)
        {
            var item          = args.InvokedItem;
            var itemContainer = args.InvokedItemContainer;

            //var item = Interaction.FindParent<NavigationViewItemBase>(args.InvokedItem as DependencyObject);
            if (args.IsSettingsInvoked == true)
            {
                Frame rootFrame = Window.Current.Content as Frame;
                rootFrame.Navigate(typeof(Settings));
            }
            else
            {
                if (App.ViewModel.tokenSource != null)
                {
                    App.ViewModel.tokenSource.Cancel();
                    App.ViewModel.FilesAndFolders.Clear();
                }
                App.ViewModel.TextState.isVisible = Visibility.Collapsed;
                if (item.ToString() == "Home")
                {
                    ContentFrame.Navigate(typeof(YourHome));
                    auto_suggest.PlaceholderText = "Search Recents";
                }
                else if (item.ToString() == "Desktop")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), DesktopPath);
                    auto_suggest.PlaceholderText = "Search Desktop";
                }
                else if (item.ToString() == "Documents")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), DocumentsPath);
                    auto_suggest.PlaceholderText = "Search Documents";
                }
                else if (item.ToString() == "Downloads")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), DownloadsPath);
                    auto_suggest.PlaceholderText = "Search Downloads";
                }
                else if (item.ToString() == "Pictures")
                {
                    ContentFrame.Navigate(typeof(PhotoAlbum), PicturesPath);
                    auto_suggest.PlaceholderText = "Search Pictures";
                }
                else if (item.ToString() == "Music")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), MusicPath);
                    auto_suggest.PlaceholderText = "Search Music";
                }
                else if (item.ToString() == "Videos")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), VideosPath);
                    auto_suggest.PlaceholderText = "Search Videos";
                }
                else if (item.ToString() == "Local Disk (C:\\)")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), @"C:\");
                    auto_suggest.PlaceholderText = "Search";
                }
                else if (item.ToString() == "OneDrive")
                {
                    ContentFrame.Navigate(typeof(GenericFileBrowser), OneDrivePath);
                    auto_suggest.PlaceholderText = "Search OneDrive";
                }
                else
                {
                    var tagOfInvokedItem = (nv.MenuItems[nv.MenuItems.IndexOf(itemContainer)] as Microsoft.UI.Xaml.Controls.NavigationViewItem).Tag;

                    if (StorageFolder.GetFolderFromPathAsync(tagOfInvokedItem.ToString()) != null)
                    {
                        ContentFrame.Navigate(typeof(GenericFileBrowser), tagOfInvokedItem);
                        auto_suggest.PlaceholderText = "Search " + tagOfInvokedItem;
                    }
                }
            }
        }
示例#7
0
 private void EnterPanel(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(panelView);
 }
 public MainPage()
 {
     InitializeComponent();
     ContentFrame.Navigate(typeof(MasterTablePage), new MasterTablePage());
 }
示例#9
0
        private async void MajaQueryAnswersReceived(object sender, MajaQueryEventArgs e)
        {
            if (e.Answers != null && e.Answers.Count > 0)
            {
                var answer = e.Answers.First();
                switch (answer.ProposalType)
                {
                case MajaQueryAnswerProposalType.AudioFile:
                    await _speechRecognitionService.PlayAudio(answer.Action);

                    break;

                case MajaQueryAnswerProposalType.VideoFile:
                    if (!string.IsNullOrEmpty(answer.Action))
                    {
                        ContentFrame.Navigate(typeof(VideoPage), answer.Action);
                        return;
                    }
                    break;

                case MajaQueryAnswerProposalType.Location when answer.Entities.Count > 0:
                    var dict = new Dictionary <string, List <string> >();

                    foreach (var entity in answer.Entities)
                    {
                        if (entity.DisplayAttributes.TryGetValue("lat", out var lat) && entity.DisplayAttributes.TryGetValue("lon", out var @long))
                        {
                            if (!dict.TryGetValue("lat", out var lats))
                            {
                                lats        = new List <string>();
                                dict["lat"] = lats;
                            }
                            lats.Add(((double)lat).ToString(CultureInfo.InvariantCulture));

                            if (!dict.TryGetValue("lng", out var lngs))
                            {
                                lngs        = new List <string>();
                                dict["lng"] = lngs;
                            }
                            lngs.Add(((double)@long).ToString(CultureInfo.InvariantCulture));

                            if (!dict.TryGetValue("name", out var names))
                            {
                                names        = new List <string>();
                                dict["name"] = names;
                            }
                            names.Add(entity.Name);
                        }
                    }
                    if (dict.Count > 0)
                    {
                        var url = new Uri("https://maps.maja.ai/?" + string.Join("&", dict.Select(kv => string.Join("&", kv.Value.Select(v => kv.Key + "=" + Uri.EscapeDataString(v))))));
                        ContentFrame.Navigate(typeof(BrowserPage), url);
                        return;
                    }
                    break;

                case MajaQueryAnswerProposalType.ImmoSuche:
                    ContentFrame.Navigate(typeof(ImmoPage), answer, new DrillInNavigationTransitionInfo());
                    return;

                case MajaQueryAnswerProposalType.Link when !string.IsNullOrEmpty(answer.Url):
                    try
                    {
                        var uri = new Uri(answer.Url);
                        if (string.Equals(uri.Scheme, "http", StringComparison.OrdinalIgnoreCase) || string.Equals(uri.Scheme, "https", StringComparison.OrdinalIgnoreCase))
                        {
                            ContentFrame.Navigate(typeof(BrowserPage), uri);
                        }
                        else
                        {
                            await Launcher.LaunchUriAsync(uri);
                        }
                        return;
                    }
                    catch { }
                    break;

                default:
                    if (string.Equals(answer.Action, MajaQueryAnswerAction.Weather, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(answer.Data))
                    {
                        ContentFrame.Navigate(typeof(WeatherPage), new WeatherForecast(answer.Data));
                        return;
                    }
                    break;
                }
            }
            if (!string.IsNullOrEmpty(e.SpeakingText))
            {
                _majaConversation.MajaStatus = MajaListeningStatus.Speaking;
                await _speechRecognitionService.SpeakTextAsync(e.SpeakingText);

                _majaConversation.MajaStatus = MajaListeningStatus.Idle;
            }
        }
示例#10
0
        private void buttonRefresh_Click(object sender, RoutedEventArgs e)
        {
            //refreshProgress.IsActive = true;
            RegistryKey CurrentVersionKey   = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
            RegistryKey CentralProcessorKey = Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor\0");

            // Easy stuff
            vals.WeekOfYear    = current.DayOfYear / 7;
            vals.CopyrightYear = current.Year.ToString();
            vals.Version       = (string)CurrentVersionKey.GetValue("DisplayVersion");
            if (vals.Version == "")
            {
                vals.Version = (string)CurrentVersionKey.GetValue("ReleaseId");
                if (vals.Version == "2009")
                {
                    vals.Version = "20H2";
                }
            }
            vals.Build      = (string)CurrentVersionKey.GetValue("CurrentBuild") + "." + CurrentVersionKey.GetValue("UBR").ToString();
            vals.User       = (string)CurrentVersionKey.GetValue("RegisteredOwner");
            vals.SystemName = ExecuteCommandSync("hostname").Replace("\r\n", "");
            vals.Workgroup  = (string)CurrentVersionKey.GetValue("RegisteredOrganization");
            vals.CPU        = (string)CentralProcessorKey.GetValue("ProcessorNameString");
            vals.Arch       = SysInfo("Win32_Processor", "Architecture");
            vals.RAM        = GetTotalMemoryInGibibytes();
            vals.RAMType    = RamType();
            vals.RAMSpeed   = SysInfo("Win32_PhysicalMemory", "Speed");
            vals.Path       = @"C:\Windows"; //(string)CurrentVersionKey.GetValue("PathName"); TODO: find a proper way to get this because im lazy
            vals.FreeSpace  = GetTotalFreeSpace();
            vals.Storage    = GetTotalSpace();

            switch (SysInfo("Win32_Processor", "Architecture"))
            {
            case "0":
                vals.Arch = "x86"; break;

            case "1":
                vals.Arch = "MIPS"; break;

            case "2":
                vals.Arch = "Alpha"; break;

            case "3":
                vals.Arch = "PowerPC"; break;

            case "5":
                vals.Arch = "ARM"; break;

            case "6":
                vals.Arch = "ia64"; break;

            case "9":
                vals.Arch = "AMD64"; break;

            default:
                vals.Arch = "Real"; break;
            }


            // Get edition of Windows 10 because apparently that's bloody impossible any other way and the registry returns me wrong values
            try
            {
                ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem");

                foreach (ManagementObject queryObj in searcher.Get())
                {
                    vals.Edition = ((string)queryObj["Caption"]).Replace("Microsoft ", "");
                    if (vals.Edition.Contains("Insider Preview") && vals.Version != "Dev")
                    {
                        vals.Version = "vNext";
                    }
                    vals.Edition = vals.Edition.Replace("Insider Preview", "");
                }
            }
            catch (ManagementException ex)
            {
                MessageBox.Show("An error occurred while querying for WMI data: " + ex.Message);
            }

            // This just prevents you from having a blank username
            if (vals.User == "" || vals.User == "user name")
            {
                vals.User = "******";
            }

            // If in org, show org name, else show hostname
            if (vals.Workgroup == "" || vals.Workgroup == "org name")
            {
                vals.IsLocal = true;
            }
            else
            {
                vals.IsLocal = false;
            }

            // Writes files
            File.Create(ValuesPath).Close();
            File.WriteAllText(ValuesPath, JsonConvert.SerializeObject(vals, Formatting.Indented));

            // Reloads pages
            LoadedAboutPage    = new AboutPage();
            LoadedSystemPage   = new SystemPage();
            LoadedThemePage    = new ThemePage();
            LoadedAdvancedPage = new AdvancedPage();
            if (ContentFrame != null)
            {
                ContentFrame.Navigate(LoadedAboutPage);
                NavView.SelectedItem = NavView.MenuItems[0];
            }
            //refreshProgress.IsActive = false;
        }
示例#11
0
 public void GoHome()
 {
     ContentFrame.Navigate(new Uri("/Home", UriKind.Relative));
 }
示例#12
0
 private void Settings_Tapped(object sender, TappedRoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(SettingsView));
 }
示例#13
0
        public PageTransitionPage()
        {
            this.InitializeComponent();

            ContentFrame.Navigate(typeof(SamplePages.SamplePage1));
        }
示例#14
0
 private void rbtMatricula_Click(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(frmMatricula));
     rbtMatricula.IsChecked = true;
 }
示例#15
0
 private void Example1_Loaded(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(SampleStandardSizingPage), null, new SuppressNavigationTransitionInfo());
 }
示例#16
0
 /// <summary>
 /// This method is responsible for loading the individual input and output sections for each scenario.  This
 /// is based on navigating a hidden Frame to the ScenarioX.xaml page and then extracting out the input
 /// and output sections into the respective UserControl on the main page.
 /// </summary>
 /// <param name="scenarioName"></param>
 public void LoadScenario(Type scenarioClass)
 {
     ContentFrame.Navigate(scenarioClass, this);
 }
示例#17
0
 private void Compact_Checked(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(SampleCompactSizingPage), null, new SuppressNavigationTransitionInfo());
 }
示例#18
0
 private void NavView_Loaded(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(HomePage));
     CurrStrContentFrameName = "HomePage";
 }
示例#19
0
 public MainWindow()
 {
     InitializeComponent();
     ContentFrame.Navigate(panelView);
 }
示例#20
0
 private void btnBinding_Click(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(TestUWPSolution.Common.View.BindingPage));
 }
示例#21
0
 private void EnterEventAndCommand(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(eventAndCommandView);
 }
示例#22
0
 private void BtnPrimera_Click(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(TemplateView));
 }
示例#23
0
 private void EnterAnimation(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(animationView);
 }
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(new Uri("/Home", UriKind.Relative));
 }
示例#25
0
 private void EnterTemplate(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(templateView);
 }
示例#26
0
 public void LoginOk()
 {
     ContentFrame.Navigate(typeof(UserDetailPage));
 }
示例#27
0
 private void NavigationView_Loaded(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(Home));
 }
示例#28
0
 public void Logout() => ContentFrame.Navigate(typeof(UserLoginPage));
示例#29
0
 private void NavView_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
 {
     ContentFrame.Navigate(typeof(HomePage));
 }
示例#30
0
 private void NavigateToPageTwo_Click(object sender, RoutedEventArgs e)
 {
     ContentFrame.Navigate(typeof(Pagina3));
     NavigateToPageTwo.IsChecked = true;
 }