Hello , how can I pass a DateTime type into a Command Parameter? In this case I want to try pass Datetime.Now
My Xaml:
<Button Text="Click me" Command="{Binding MyCommand}" VerticalOptions="EndAndExpand" Margin="0,0,0,25"></Button>
My Viewmodule:
public class MainViewModule : INotifyPropertyChanged
{
public ICommand MyCommand{ get; }
public MainViewModule()
{
MyCommand= new Command<DateTime>(Foo);
)
}
void Foo(DateTime dateTime)
{
Device.BeginInvokeOnMainThread(async () =>
{
await App.Current.MainPage.DisplayAlert("", $"you passed {dateTime}", "OK");
});
}