How the application responds to user requests and what is the life cycle?
نوشته شده توسط : dotnek

the user must clearly state his request. Slowly Use lifecycle and send your request to the application .

In this tutorial you will learn that:

- How to respond to different start, sleep or resume modes of the application - How to store different data in different lifecycle modes.

The requirements for doing this training are as follows:

- Install the latest version of Visual Studio 2019 on the system

- Install the latest version of Mobile development with .NET on the system

Learn how to respond to different modes of an application in Xamarin.Forms using Visual Studio

1- Open Visual Studio.2- After opening Visual Studio, you must create a new black Xamarin.Forms app.3- Choose a name for which you create. The name chosen in this article is AppLifecycleTutorial.

Note:

It is best to be careful in choosing names for projects and classes created.

Note:

The name chosen for the project must be the same as the name chosen for the solution, so choose the solution name AppLifecycleTutorial as well.4-  After naming, you must make sure that the system and application support the .NET Standard mechanism for shared code.This mechanism is used to share code written in Xamarin.Forms with the C # programming language. If your system and app do not support this mechanism, it cannot have multiple outputs on multiple platforms at once. So in order to be able to have multiple outputs on several different platforms at the same time, you need to make sure that your app and system support this mechanism.5-  Click on MainPage.xaml in the Solution Explorer section of the AppLifecycleTutorial project.6- Double click on App.xaml.cs.7- Update OnSleep, OnStart and OnResume overrides as below.

protected override void OnStart ()
{
Console.WriteLine ("OnStart");
}

protected override void OnSleep ()
{
Console.WriteLine ("OnSleep");
}

protected override void OnResume ()
{
Console.WriteLine ("OnResume");
}
By inserting this code, it replaces and updates the override method in the application lifecycle with the statement Console.WriteLine.- The OnStart method is invoked when the application starts.

- The OnSleep method is invoked when the application goes to the background.

- The OnSleep method is invoked when the application is restarted from the background.

Note:

There is no method to end the application.8- Press the start button or Ctrl + F5 key combination and see the result of the applied changes.9-  When the application starts, the OnStart method starts invoking and the result is displayed in the Visual Studio Output window. 

Read more on:https://www.dotnek.com/Blog/Apps/how-the-application-responds-to-user-requests

link:https://dotnek.mystrikingly.com/

Related link:how many apps in play store





:: برچسب‌ها: dotnek , seo , site ,
:: بازدید از این مطلب : 74
|
امتیاز مطلب : 0
|
تعداد امتیازدهندگان : 0
|
مجموع امتیاز : 0
تاریخ انتشار : سه شنبه 19 مرداد 1400 | نظرات ()
مطالب مرتبط با این پست
لیست
می توانید دیدگاه خود را بنویسید


نام
آدرس ایمیل
وب سایت/بلاگ
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

آپلود عکس دلخواه: