You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?xml version="1.0" encoding="UTF-8" ?>
<uranium:UraniumContentPagex:Class="MauiPlayground.Pages.DateAndTimeTestPage"xmlns="http://schemas.microsoft.com/dotnet/2021/maui"xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"xmlns:ctrls="clr-namespace:MauiPlayground.Controls"xmlns:local="clr-namespace:MauiPlayground.Pages"xmlns:material="clr-namespace:UraniumUI.Material.Controls;assembly=UraniumUI.Material"xmlns:uranium="clr-namespace:UraniumUI.Pages;assembly=UraniumUI"xmlns:vm="clr-namespace:MauiPlayground.ViewModels"x:DataType="vm:DateAndTimeViewModel">
<StackLayoutSpacing="20">
<LabelText="SampleDate" />
<material:TextFieldTitle="BoundValue"Text="{Binding SampleDate}" />
<ButtonCommand="{Binding SetToNullCommand}"Text="SetNull" />
<ButtonCommand="{Binding SetToNewYearCommand}"Text="SetTo1-1" />
<ButtonCommand="{Binding SetToNewYear2Command}"Text="SetTo1-2" />
<!-- BUG! Using DateTime.Now will lead to an infinite loop, setting another Date works fine -->
<ButtonCommand="{Binding SetToNowCommand}"Text="SetToNow" />
<!-- Leaving this in as a cautionary tale; see summary comment in DateAndTimePicker.xaml.cs -->
<material:DatePickerFieldTitle="MatDate"Date="{Binding SampleDate}" />
<!--<ctrls:DateAndTimePickerView DateAndTime="{Binding SampleDate}" LabelTextDate="{Binding TestStringDate}" LabelTextTime="{Binding TestStringTime}" />-->
</StackLayout>
</uranium:UraniumContentPage>
Closing this in favor of getting #84 fixed.
The behavior here is more attributable to binding two controls to the same property, and them interacting in unforeseen ways through PropertyChanged events.
Sample repro can be observed here: https://github.com/Hottemax/MauiPlayground
launch app and go to DateAndTimeTestPage
The below code will lead to the following weird behaviors:
DateTime.Now
, which leads to an infinite loophttps://github.com/Hottemax/MauiPlayground/blob/master/MauiPlayground/MauiPlayground/Pages/DateAndTimeTestPage.xaml
where the viewmodel is simply https://github.com/Hottemax/MauiPlayground/blob/master/MauiPlayground/MauiPlayground/ViewModels/DateAndTimeViewModel.cs
The text was updated successfully, but these errors were encountered: