private void Button_Click(object sender, RoutedEventArgs e) { var btn = sender as Button; var cnt = btn?.Content as string; var page = RegisteredPages.FirstOrDefault(f => f.Name == cnt); this.CurrentPage = page; }
private BasePage GetPage(RegisteredPages type) { if (!collection.ContainsKey(type)) { switch (type) { case RegisteredPages.MainPage: collection.Add(RegisteredPages.MainPage, new MainPage(driver)); break; case RegisteredPages.BestPage: collection.Add(RegisteredPages.BestPage, new BestPage(driver)); break; } } return(collection[type]); }
private MyWindow() { this.Log = components.ConsolePage.Instance; RegisteredPages.Insert(0, new OrdersPage("Ostatní", Appka.InactiveOrders)); RegisteredPages.Insert(0, new OrdersPage("Nevyřízené", Appka.IncompleteOrders)); RegisteredPages.Add(this.Log as components.ConsolePage); #if DEBUG RegisteredPages.Add(new components.TestPage()); #endif this.CurrentPage = RegisteredPages[0]; InitializeComponent(); }