[UWP] [物联网]为什么调度计时器不停止?

编程入门 行业动态 更新时间:2024-10-28 16:19:16
本文介绍了[UWP] [物联网]为什么调度计时器不停止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是UWP工作的新手,通常我们更多地使用c#MVC4项目。

i am new to the UWP work, normally we work more with c# MVC4 project.

我们有一个小项目需要在Pi3板上运行。该项目有3页,登陆页面,ScreenSaver页面和配置页面。就像我需要3页和一个小菜单一样,我找到了一个使用appShell和左菜单的演示,点击菜单项我们导航到另一个页面。

We have a small project that need to be running on a Pi3 board. The project have 3 pages, Landing Page, ScreenSaver Page and Config Page. Like I need 3 page and a small menu, I found a demo that uses appShell and a left menu when clicking on menu items we navigate to another page.

在屏幕上保护页面,我们显示小时和一些天气信息,当用户点击屏幕时,页面导航到"登陆页面"。屏幕保护程序页面有一个DispatchTimer,可以通过webserivce 调用更新时间和每个5分钟的更新天气信息。当我需要返回LandingPage时,我有一个Close函数,如:

In the Screen saver page, we display hour and some weather info and when a user tap the screen, the page navigate to the "landingPage". The Screen Saver page has a DispatchTimer that update time and each 5 min update weather info with a webserivce call. When I need to return to the LandingPage I have a Close function like:

public void Close() { if (_timer != null) { _timer.Stop(); _timer = null; } AppShell shell = Window.Current.Content as AppShell; shell.AppFrame.BackStack.Clear(); shell.AppFrame.Navigate(typeof(LandingPage), _keyPressed); }

但导航到登陆页面后,​​我仍然在_timer.tick函数中遇到断点...为什么?

But after navigating to landing page, I still got a breakpoint hit in the _timer.tick function... Why?

有任何建议吗?

Pierre

推荐答案

嗨皮埃尔,

你陈述:

我找到了一个演示,当点击我们导航到另一个页面的菜单项时,它会使用appShell和左侧菜单。

I found a demo that uses appShell and a left menu when clicking on menu items we navigate to another page.

但未提供您正在使用的样本的链接。物联网核心没有外壳,所以请您提供更多有关您正在尝试的内容的详细信息?

but did not provide a link to the sample you are using. IoT Core does not have a shell so can you please provide more details on what you are trying?

此致,

IoTGirl

更多推荐

[UWP] [物联网]为什么调度计时器不停止?

本文发布于:2023-11-06 17:06:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564281.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计时器   UWP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!