Posts

Showing posts with the label uwp

Request for background task in UWP more than one, is it necessary?

Request for background task in UWP more than one, is it necessary? I make a library with several background tasks for UWP 8.1/10 (desktop/mobile). I have 3 background tasks but I talk about one of them. When the app starts, I see permission request dialog: await BackgroundExecutionManager.RequestAccessAsync(); I click to allow and continue registration of background task, this part works excellent. Every 15 minutes I see my task in Output . It works perfectly. So, in near future, I want to change execution time while background task is working it creates the same task with another TimerTrigger (depends on some conditions, but it can happen), for example: TimerTrigger TimerTrigger TimeTrigger I know about: Note Universal Windows apps must call RequestAccessAsync before registering any of the background trigger types. So, I need use await BackgroundExecutionManager.RequestAccessAsync() every time when I try to register any of background task, does I understand it right? await Backgrou...

PopUp Animation UWP

PopUp Animation UWP I have a popup that opens with animation and closes with animation, with the property IsLightDismissEnabled set to true, this allows the popup to close even with a click outside of it. But if I click repeatedly on the btnPopUp, the pop up closes and opens in an always different position. Is possible solve this so that the animation remains - PaneThemeTransition Edge = "Top" - because I would like the animation to scroll when it opens and the same when it closes. MainPage.xaml: <Grid x:Name="RootGrid" Width="500" Height="40"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="40"/> </Grid.ColumnDefinitions> <Popup x:Name="PopUpPanel" IsLightDismissEnabled="True" RenderTransformOrigin="0.5,0.5" > <Popup.ChildTransitions> <TransitionCollection> ...

I got a System error in C# post

Image
I got a System error in C# post It is my first time to ask a question in here (I'm from Asia). Platform:UWP 17632 IDE : Visual Studio 2017 Based on the reqiurement of the project, I need to post some information to a website. I refer the answer about How to make HTTP POST web request Method A. Here is my code: public async void PostDataAsync(string pTemperture, string pHumidity, string pFireStatus, string pLightStatus, string pBodyStatus) { var values = new Dictionary<string, string> { {"count", "1" }, {"temperture_0", pTemperture }, {"Humidity_0", pHumidity }, {"FireStatus_0", pFireStatus }, {"LightStatus_0" ,pLightStatus}, {"BodyDetect_0", pBodyStatus } }; var content = new FormUrlEncodedContent(values); try { var response = await client.PostAsync("...