C
C#3mo ago
Mekasu0124

✅ How to get value of DatePicker from nested UserControl Avalonia

<!-- in new user view -->
<UserControl xmlns:uc="clr-namespace:MathGame.Views.UserControls;assembly=MathGame">
<Border>
<StackPanel>
<uc:DatePicker />
</StackPanel>
</Border>
</UserControl>

<!-- in ./Views/UserControls/DatePicker.axaml -->
<UserControl>
<DatePicker DayFormat="ddd dd" MonthFormat="MMM MM" />
</UserControl>
<!-- in new user view -->
<UserControl xmlns:uc="clr-namespace:MathGame.Views.UserControls;assembly=MathGame">
<Border>
<StackPanel>
<uc:DatePicker />
</StackPanel>
</Border>
</UserControl>

<!-- in ./Views/UserControls/DatePicker.axaml -->
<UserControl>
<DatePicker DayFormat="ddd dd" MonthFormat="MMM MM" />
</UserControl>
in the CreateNewUserView.axaml file, how do I get access to the date selected within the DatePicker with the DatePicker being in a nested UserControl?
0 Replies
No replies yetBe the first to reply to this messageJoin