public App(string search = null) { InitializeComponent(); DependencyService.Register <MainViewModel>(); DependencyService.Register <PdfService>(); DependencyService.Register <BookmarksRepository>(); DependencyService.Register <StoreViewModel>(); DependencyService.Register <PlayerCharacterEditorViewModel>(); var vm = DependencyService.Get <MainViewModel>(); var titlered = (Color)Resources["HDRed"]; var bgtan = (Color)Resources["HDWhite"]; MainPage = new MainShell(); //var mainNavigationPage = new MainNavigationPage(); //vm.Navigator = new Navigator(mainNavigationPage.Navigation); vm.Navigator = new Navigator(Shell.Current.Navigation); Routing.RegisterRoute("item", typeof(Views.Library.ItemPage)); //MainPage = mainNavigationPage; //mainNavigationPage.Navigation.PushAsync(new MainPage()); if (search != null) { Shell.Current.Navigation.PushAsync(new Views.Library.DeepSearchPage(), true); } }
public App() { InitializeComponent(); Bootstrapper.Init(this); MainPage = new MainShell(); }
private void Page_Loaded(object sender, RoutedEventArgs e) { Frame mainShellFrame = Window.Current.Content as Frame; mainShell = mainShellFrame.Content as MainShell; PassOn(); }
/// <summary> /// Navigates back to the MainShell with a slide from right effect. /// </summary> private void NavigateToMainShell() { //If the application is in demo mode, showedDemoModeIntroduction is set to true so that the introduction isn't showed a second time. if (BridgeInformation.demoMode) { BridgeInformation.showedDemoModeIntroduction = true; } Frame mainShellFrame = Window.Current.Content as Frame; MainShell mainShell = mainShellFrame.Content as MainShell; mainShell.HideIntroduction(); //Frame.Navigate(typeof(MainShell), null, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight }); }
public void Start() { try { var shell = new MainShell() { DataContext = new MainShellController() }; var window = new Window() { Width = 800, Height = 1200, Content = shell }; window.Show(); } catch (Exception e) { MessageBox.Show(e.ToString()); } }
public App() { InitializeComponent(); // create service provider Services = AppServiceProvider.Instance; Services.Theme.UpdateMergedDictionaries(); // why did I do this? Does it load the theme? // Create main page var mainPage = new MainShell(); MainPage = mainPage; // Give reference of shell to navigationservice var nav = AppServiceProvider.Instance.NavigationInstance; nav.ShellInstance = mainPage; // register routes for all pages that will be navigated to not via flyout nav.RegisterRoute <CssPage, CssPageViewModel>(Routes.Css); nav.RegisterRoute <CssRenderPage, CssRenderPageViewModel>(Routes.CssRender); nav.RegisterRoute <CssSelectionPage, CssSelectionPageViewModel>(Routes.CssSelection); nav.RegisterRoute <FolderPage, FolderPageViewModel>(Routes.Folder); nav.RegisterRoute <MovePage, MovePageViewModel>(Routes.Move); nav.RegisterRoute <NotePage, NotePageViewModel>(Routes.Note); nav.RegisterRoute <PreviewPage, PreviewPageViewModel>(Routes.Preview); nav.RegisterRoute <RenderPage, RenderPageViewModel>(Routes.Render); //var tatt = Services.Preferences.Uri; //Services.Preferences.Uri = "folder?folderid=034509d9-0ed6-42a6-b713-2d78457139e4/note?noteid=8eaafcc4-c7a0-4dc5-95b6-89b2c011b5b6"; //Services.Preferences.Uri = ""; //foreach (string uriPart in Services.Preferences.Uri.Split('/')) //{ // Services.Navigation.GoToAsync(uriPart); //} }
void login_Click(object sender, RoutedEventArgs e) { //UserLogin(); string user = tb_UseName.Text; string pwd = pb_Password.Password.Trim(); if (user.Equals("admin")&&pwd.Equals("123")) { ThrowMsg("登陆成功,正在加载数据...", false); System.Threading.Thread.Sleep(1000); App app = (App)Application.Current; //MainWindow mw = new MainWindow(); //app.MainWindow = mw; //mw.Show(); MainShell ms = new MainShell(); app.MainWindow = ms; ms.Show(); login.Close(); } else { ThrowMsg("登陆失败!请检查用户名和密码", true); } }
public App() { InitializeComponent(); MainPage = new MainShell(); }
private void UserLogin() { //检查是否是指定的电脑 ThrowMsg("正在检查硬件...", false); if (!CheckUser()) { ThrowMsg("您的电脑不能登录,请联系管理员!", true); return; } string UserName = login.tb_UseName.Text.Trim(); string UserPassword = login.pb_Password.Password.Trim(); //var sb = login.FindResource("loginClick") as Storyboard; if (!CheckStatue() || hasclick) return; hasclick = true;//用户是否已经请求 //if (TempPwd != UserPassword) //{ // TempLength = UserPassword.Length; // this.MD5Password = helper.StringToMd5(UserPassword); //} TempPwd = UserPassword; TempLength = UserPassword.Length; this.MD5Password = helper.StringToMd5(UserPassword); //SQLiteService server = new SQLiteService(); //if (!server.CheckUser(UserName)) //{ ThrowMsg("您本机登陆的账户不能为该账户", true); hasclick = false; return; } ThrowMsg("正在登录...", false); this.btn_login.IsEnabled = false; //InfoPlatformServiceSoapClient client = new InfoPlatformServiceSoapClient(); //try //{ // UserEntity entity = client.UserLogin(UserName, this.MD5Password, SQLiteService.GetLocalIP()); // // int flag = client.UserLogin(UserName,UsingMD5(UserPassword)); // DealWithLogin(entity); //} //catch (Exception ex) { client.Abort(); } if (CheckLogin(UserName,MD5Password,"first")) { ThrowMsg("登录成功,正在加载数据...", false); //加载数据,暂时无用 GlobalBindingHelper.Name = UserName; //加载数据结束,打开主窗口 App app = (App)Application.Current; MainShell ms = new MainShell(); app.MainWindow = ms; ms.Show(); login.Close(); } else { ThrowMsg("用户名或者密码错误!", true); login.tb_UseName.Focus(); hasclick = false;//用户是否已经请求 this.btn_login.IsEnabled = true; return; } }