WatchKit: Why is awakeWithContext not being called for all WKInterfaceControllers in my storyboard? - watchkit

I have a page based WatchKit app with three WKInterfaceControllers in the storyboard each linked with a nextPage segue. For each controller I am logging when the awakeWithContext method is called.
On my Series 6 watch (running 8.4.2) and my Series 3 watch (also running 8.4.2) only the first two controller awakeWithContext methods are called when the app starts. When I swipe to the second page then the awake method is called for the third page - the log looks like this:
// App starts
Page 0 awakeWithContext
Page 1 awakeWithContext
Page 0 willActivate
Page 0 didAppear
// Swipe from page 0 to page 1
Page 0 didDeactivate
Page 1 willActivate
Page 2 awakeWithContext
Page 1 didAppear
Is this expected behaviour? All the things I have read say that awakeWithContext should be called for all the pages on start-up?
Another interesting thing is that if I navigate from Page 0 to Page 1 by calling becomeCurrentPage on Page 1 then awakeWithContext is not called on Page 2 at all. However if I manually swipe back to Page 0 and then back to Page 1 it is called.
All of this makes it impossible to navigate around the page structure of the app since I can't call becomeCurrentPage on Page 2 until it is loaded manually.

Related

Child controls in asp.net Blazor not refreshing. StateHasChanged() not working

Please refer to the following https://github.com/CD1010/BlazorWizard.git for this question. The sample is in StepActivations Branch
I have a page called DemoWizard, which incorporates a 3 step wizard. When i click the "Toggle Enabled" button, the second and third steps links should go to enabled or disabled state. It seems however, that the first time takes 2 clicks to turn off the headers, and the state is always behind.
So it appears that StateHasChanged() is not refreshing child states properly.
Note that the refresh() method was an attempt to get at least step2 to refresh properly, but to no avail.
Any idea why?
the click handler that does toggle is below.
void OnClick()
{
step2Enabled = !step2Enabled;
step3Enabled = !step3Enabled;
StateHasChanged();
Step2.Refresh();
}
Your code isn't showing up exactly as advertised, but i think what you need to do is add an event callback to the Blazorize CheckEdit component:
<Blazorize.CheckEdit #bind-Checked="#Parent.IsValid" CheckedChanged="#VerifyEnabledTabs">Check Me</Blazorise.CheckEdit>
where VerifyEnabledTabs is a method on the top level Wizard that can assess where you are and what is complete / filled / checked / whatever, to allow certain links to be active.

How caching of pages use ionic 2?

Can I save the page status if I moved to new page?
I have a map and some objects on the map. I want if map is loaded, that all state saving if i moved new page and then I come back. That's it high-loaded process (+ loading image again). Use lealetjs
Thanks!
I solved my problem as follows:
I change app architecture - I add two tabs (list elements page and map with markers). And when I opened map page use tabs - page loaded and it's Ok!
Explanation of work ionic:
If you use navCtrl.pop() - current page will be deleted from memory. But If you can not use tabs - use navCtrl.push() new before page. And when user will want to return before page - navCtrl.pop() - delete current page, but before page will be cached.
That is, from the user's point of view - it's back is already on the previous page, and from the point of view of the programmer - a new same page is being created.
And if user wants to move to before->before page, use navCtrl.popTo(index of the desired page - you can use this.navCtrl.popTo(this.navCtrl.getByIndex([yourPageNumber]));

I am not able to find master page when i am trying to create one

This is the screenshot screenshot
I am trying to add a master page in my asp.net web app . But after i choose add new item i am not able to find master page to create one.Thanks in advance
If you are using VS2015 then
Step 1: Right Click on Project
step 2 : Add
Step 3 : New Item
Step 4 : web
and select
Step 5 : web form master page
Now you can see your new master page with .master extension
see screenshot:
You will right click on the project file instead of solution file in solution explorer window.

What is the use of timer control?

I know update panel in ajax control.What is used of timer control.I came across the Web application called a1,inside that there are 3 page p1,p2,p3
respectively.P3 contain code for update progress and for file to download that code is in timer1_tick() function.Inside a1 there is one folder called f1.In f1,there is s1 page.In s1's aspx.cs file ,inside the button click event,I am redirecting to p3. Response.Redirect(#"~\p3.aspx", false);
But s1 does not contain update progress,timer control.Does it fine?

Asp.net Web from Dynamic Controls Based on Dynamic controls

I'm using a wizard control, step 1 has a list box with a list box containing entries 1-10. Step 2 then dynamically build and displays 1 list box per entry. Each list box in step 2 contains 5 entries each. I have one more step that needs to read the list boxes from step 2 and get their values to display 3 radio buttons per choosen entry from step 2.
Currently I have 3 methods that I run populateStep1() populateStep2() populateStep3(). I run each in Page_Load.
void page_load()
{
if(!Page.IsPostBack)
{
populateStep1();
}
populateStep2();
populateStep3();
}
my problem is that step 3 never works the first time around. It works the second time but not the first. I believe this is because the controls in step 2 have not yet had the viewstate applied so there is nothing chosen.
Anyone want sketch out/point me to a pattern to handle working with dynamic controls that are dependent on other dynamic controls?
If you are working with Dynamically added controls then you really need to add them during the Initialization pase of the page life cycle as this will ensure View State is hydrated properly.
Since View State is hydrated before Page_Load, you are adding things too late.
Move your logic into the Page_Init method and you should be golden.
void Page_Init()
{
if(!Page.IsPostBack)
{
populateStep1();
}
populateStep2();
populateStep3();
}

Resources