Hello,
I set the x:Name="MyContent"
to the <Frame >
of CarView.xaml
Then I find you lack of OnPropertyChanged
method. And If the IsExpanded
is true, when execute ToggleCollapse
, we need to close the expender. So I change the code like following method.
private void ToggleCollapse()
{
if (!IsExpanded)
{
MyContent.LayoutTo(new Rectangle(MyContent.Bounds.X, MyContent.Bounds.Y, MyContent.Bounds.Width, 300), 500, Easing.CubicOut);
IsExpanded = true;
OnPropertyChanged(nameof(IsExpanded));
}
else
{
MyContent.LayoutTo(new Rectangle(MyContent.Bounds.X, MyContent.Bounds.Y, MyContent.Bounds.Width, 0), 500, Easing.CubicIn);
IsExpanded = false;
OnPropertyChanged(nameof(IsExpanded));
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.