I would like there to be no empty space after the content of the collection view.
I tried to put my button in footer but then i ran into problem that property isenabled = false is not being applied to it in my code behind. Here is my xaml file:
<ContentPage.Content>
<RefreshView x:DataType="local:QuestionViewModel" Command="{Binding LoadCommand}" IsRefreshing="{Binding IsBusy, Mode=TwoWay}">
<ScrollView>
<StackLayout>
<views:MyTextView LaTeX="{Binding Formulation}" HorizontalOptions="Center" Margin="15, 10, 15, 0"/>
<!--<RefreshView x:DataType="local:QuestionViewModel" Command="{Binding LoadCommand}" IsRefreshing="{Binding IsBusy, Mode=TwoWay}">-->
<CollectionView
ItemsSource="{Binding Answers, Mode=TwoWay}"
SelectedItems="{Binding SelectedAnswers, Mode=TwoWay}"
SelectionMode="Multiple"
x:Name="collectionView"
SelectionChanged="collectionView_SelectionChanged"
>
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:Answer">
<StackLayout Padding="10">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup Name="CommonStates">
<VisualState Name="Normal">
<VisualState.Setters>
<Setter TargetName="frame" Property="Frame.BackgroundColor" Value="{Binding AnswerColor}"/>
</VisualState.Setters>
</VisualState>
<VisualState Name="Selected">
<VisualState.Setters>
<Setter TargetName="frame" Property="Frame.BackgroundColor" Value="{DynamicResource MainColor}"/>
<Setter TargetName="label" Property="views:MyTextView.TextColor" Value="White"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Frame CornerRadius="10" HasShadow="True" x:Name="frame" BackgroundColor="{Binding AnswerColor}">
<views:MyTextView x:Name="label" LaTeX="{Binding Content}" />
</Frame>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<!--</RefreshView>-->
<StackLayout>
<Label x:Name="conditionLabel" TextColor="{DynamicResource AnswerColor}"/>
<Button x:Name="checkButton" Text="Проверить ответы" CornerRadius="10" Margin="10"
Command="{Binding CheckAnswersCommand}"/>
</StackLayout>
</StackLayout>
</ScrollView>
</RefreshView>
</ContentPage.Content>
Result: 1 part of screen 2 part of screen