public override bool OnKeyUp([GeneratedEnum] Keycode keyCode, KeyEvent e) { var handled = true; string key = keyCode.ToString(); if (!key.Equals("Enter")) { if (key.Contains("Num")) { keys += key.Replace("Num", ""); } else { keys += key; } } else { if (_page is MainPageView) { MainPageView view = _page as MainPageView; view.Scanner(keys, e.ToString()); } keys = string.Empty; } return(handled || base.OnKeyUp(keyCode, e)); }
public App() { MainPage = new MainPageView() { BindingContext = new MainPageViewModel() }; }
void OnEnable() { var root = rootVisualElement; root.styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(MainStylePath)); root.AddToClassList(EditorGUIUtility.isProSkin ? UiConstants.ussDark : UiConstants.ussLight); AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(k_LayoutPath).CloneTree(root); m_Provider = new Collab(); m_Provider.UpdatedProjectStatus += OnUpdatedProjectStatus; m_ViewContainer = root.Q <VisualElement>(className: ContainerUssClassName); // Get the views and configure them. m_MainView = new MainPageView(); m_MainView.Presenter = new MainPresenter(m_MainView, new MainModel(m_Provider)); m_StartView = new StartPageView(); m_StartView.Presenter = new StartPresenter(m_StartView, new StartModel(m_Provider)); m_ErrorPageView = new ErrorPageView(); // Add floating dialogue so it can be displayed anywhere in the window. root.Add(FloatingDialogue.Instance); OnUpdatedProjectStatus(m_Provider.GetProjectStatus()); }
public App() { InitializeComponent(); MainPage = new MainPageView { BindingContext = new MainPageViewModel() }; }
public App() { InitializeComponent(); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("pt-BR"); CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("pt-BR"); MainPage = new MainPageView(); }
public App() { InitializeComponent(); var navigationPage = new Xamarin.Forms.NavigationPage(new Views.Clientes.ListagemView()); navigationPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true); //MainPage = navigationPage; MainPage = new MainPageView(); }
public App() { InitializeComponent(); //var navigationPage = new Xamarin.Forms.NavigationPage(new Views.Clientes.ListagemView()); //navigationPage.On<Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true); //MainPage = navigationPage; CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("pt-BR"); CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("pt-BR"); MainPage = new MainPageView(); }
public MainPage() { InitializeComponent(); splash = new SplashPage(this); mainPageView = new MainPageView(); Navigation.PushAsync(splash); Navigation.InsertPageBefore(mainPageView, splash); MessagingCenter.Subscribe <AppEventMesseges>(this, AppEventMesseges.Resumed, async _ => await vc.SwitchView(vc.CurrentView, true, false, null)); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.Skins.SkinManager.EnableFormSkins(); DevExpress.UserSkins.BonusSkins.Register(); UserLookAndFeel.Default.SetSkinStyle("Office 2010 Blue"); var mainForm = new MainPageView(new MainPageController()); mainForm.FormClosing += mainForm.HandleClosing; Application.Run(mainForm); }
public static Content GetNewInstanse(Action <Content> setContentAction) { var content = new MainPageView { DataContext = new HomePageViewModel(setContentAction) }; var settings = new GeneralSettingsView { DataContext = new GeneralSettingsViewModel() }; return(new Content("Home", content, settings)); }
public App() { InitializeComponent(); try { MainPage = new MainPageView(); apiService = new ApiService(); } catch (System.Exception ex) { throw; } }
public App() { if (!Settings.ChoosenLanguage.Equals("none")) { CultureInfo language = new CultureInfo(Settings.ChoosenLanguage); Thread.CurrentThread.CurrentUICulture = language; AppResources.Culture = language; } InitializeComponent(); MainPage = new MainPageView(); //Background color MainPage.SetValue(NavigationPage.BarBackgroundColorProperty, Color.Black); //Title color MainPage.SetValue(NavigationPage.BarTextColorProperty, Color.White); }
/// <summary> /// Invoked when a user issues a global back on the device. /// If the app has no in-app back stack left for the current view/frame the user may be navigated away /// back to the previous app in the system's app back stack or to the start screen. /// In windowed mode on desktop there is no system app back stack and the user will stay in the app even when the in-app back stack is depleted. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void App_BackRequested(object sender, BackRequestedEventArgs e) { MainPageView currentPage = ((Frame)Window.Current.Content).Content as MainPageView; if (currentPage == null && currentPage.MainFrame == null) { return; } //If we can go back and the event has not already been handled, do so. if (currentPage.MainFrame.CanGoBack && e.Handled == false) { e.Handled = true; currentPage.MainFrame.GoBack(); } }
public void SwitchView(string viewName = "") { switch (viewName) { case "": startUsingViewModel = new StartUsingViewModel(diaryLogic); DiaryStartUsing = new StartUsingThisDiaryView(); DiaryStartUsing.DataContext = startUsingViewModel; WaitingAsync(); break; case "Пароль": passwordInputViewModel = new PasswordInputViewModel(diaryLogic); DiaryStartUsing = new PasswordInputView(); DiaryStartUsing.DataContext = passwordInputViewModel; WaitingDonePassword(); break; case "Главная": StopProcess(); DiaryOperation = new MainPageView(); DiaryOperation.DataContext = new MainPageViewModel((importantDatesLogic, timetableForTheDaysLogic, habitsTrackerLogic, goalsLogic)); break; case "Органайзер": StopProcess(); organizerViewModel = new OrganizerViewModel((notesLogic, importantDatesLogic, timetableForTheDaysLogic, habitsTrackerLogic, goalsLogic, basketLogic)); DiaryOperation = new OrganizerView(); DiaryOperation.DataContext = organizerViewModel; break; case "Настройки": StopProcess(); settingsViewModel = new SettingsViewModel(diaryLogic); DiaryOperation = new SettingsView(); DiaryOperation.DataContext = settingsViewModel; break; case "Корзина": StopProcess(); DiaryOperation = new BasketView(); DiaryOperation.DataContext = new BasketViewModel(notesLogic, basketLogic); break; } }
public App() { // The root page of your application MainPage = new MainPageView(); //MainPage = new ContentPage //{ // Content = new StackLayout // { // VerticalOptions = LayoutOptions.Center, // Children = { // new Label { // XAlign = TextAlignment.Center, // Text = "Welcome to Xamarin Forms!" // } // } // } //}; }
void CreateGUI() { EditorApplication.playModeStateChanged += OnPlayModeStateChanged; AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload; AssemblyReloadEvents.afterAssemblyReload += OnAfterAssemblyReload; var root = rootVisualElement; root.styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(MainStylePath)); root.AddToClassList(EditorGUIUtility.isProSkin ? UiConstants.ussDark : UiConstants.ussLight); AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(k_LayoutPath).CloneTree(root); m_Provider = new Collab(); m_Provider.UpdatedProjectStatus += OnUpdatedProjectStatus; m_ViewContainer = root.Q <VisualElement>(className: ContainerUssClassName); // Create models and configure them. var mainModel = new MainModel(m_Provider); var startModel = new StartModel(m_Provider); m_Models = new List <IModel> { mainModel, startModel }; m_Models.ForEach(m => m.OnStart()); // Get the views and configure them. m_MainView = new MainPageView(); m_MainView.Presenter = new MainPresenter(m_MainView, mainModel); m_StartView = new StartPageView(); m_StartView.Presenter = new StartPresenter(m_StartView, startModel); m_ErrorPageView = new ErrorPageView(); // Add floating dialogue so it can be displayed anywhere in the window. root.Add(FloatingDialogue.Instance); OnUpdatedProjectStatus(m_Provider.GetProjectStatus()); }
public App(AppSetup setup) { InitializeComponent(); var page = new MainPageView(); var navPage = new NavigationPage(page); _container = setup.CreateContainer(cb => { cb.RegisterInstance(navPage as Page); cb.RegisterInstance(this as Application); }); _container.BeginLifetimeScope(); setup.RegisterViewModelMappings(); var vm = _container.Resolve <MainViewModelFactory>().Create(); page.BindingContext = vm; MainPage = navPage; }
public MainWindowViewModel( ) { _INPCInvoke = new INPCInvoker(this); CurrentView = new MainPageView( ); }
private void _buttonHome_Click(object sender, RoutedEventArgs e) { var view = new MainPageView(); Navigate(view); }
public MainPageNavigationArgs(MainPageView desiredView) { _mainPageView = desiredView; }
public App() { InitializeComponent(); MainPage = new MainPageView(); }
public async Task <IActionResult> MainPage() { MainPageView mainPage = new MainPageView(_context); return(View(mainPage)); }
public async Task DisplayAlert(string title, string message, string ok) { await MainPageView.DisplayAlert(title, message, ok); }
protected override void OnViewAttached(object view, object context) { base.OnViewAttached(view, context); _view = view as MainPageView; }
public void SetView(XtraForm view) { _form = (MainPageView)view; }
public ShellViewModel(WinRTContainer container, IEventAggregator eventAggregator) { _container = container; _eventAggregator = eventAggregator; MainPage = new MainPageView(); }