I have a Xamarin.Forms PCL project and have a xaml page (relevant code below)
if I add "viewmode = linear", the entire control doesnt show up. if the control shows up, the buttons do not, if the control doesnt show up, the buttons do. and the "default" viewmode seems to start from the bottom right of the screen and swipe up to the top left of the screen. i will attach a screenshot
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SkazPro.BrewControl.Pages.RecipesPage"
xmlns:carousel="clr-namespace:Syncfusion.SfCarousel.XForms;assembly=Syncfusion.SfCarousel.XForms">
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="ItemTemplate">
<StackLayout Orientation="Vertical">
<Label Text="{Binding Name}" TextColor="Black" FontSize="Large" />
<Label Text="{Binding FG}" TextColor="Black" FontSize="Small" />
<Label Text="{Binding OG}" TextColor="Black" FontSize="Small" />
</StackLayout>
</DataTemplate>
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout>
<carousel:SfCarousel x:Name="Carousel" ItemTemplate="{StaticResource ItemTemplate}" DataSource="{Binding Recipes}" Offset="20" RotationAngle="30" SelectedIndex="1" HeightRequest="600" />
<StackLayout Orientation="Horizontal">
<Button Text="New Recipe" HorizontalOptions="Center" Clicked="OnNewClicked"/>
<Button Text="Details" HorizontalOptions="Center" Clicked="OnDetailsClicked"/>
<Button Text="Import" HorizontalOptions="Center" Clicked="OnImportClick"/>
</StackLayout>
</StackLayout>
</ContentPage>
the cs file:
public partial class RecipesPage : ContentPage
{
public RecipesPage()
{
InitializeComponent();
Carousel.BindingContext = new RecipesViewModel();
}
private void OnDetailsClicked(object sender, EventArgs e)
{
throw new NotImplementedException();
}
private void OnNewClicked(object sender, EventArgs e)
{
throw new NotImplementedException();
}
private void OnImportClick(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
recipeviewmodel.cs
public class RecipesViewModel : ViewModelBase
{
public RecipesViewModel()
{
#if DEBUG
Recipes.Add(new Recipe
{
Name = "Test 1",
FG = 1.120,
OG = 0.120
});
Recipes.Add(new Recipe
{
Name = "Test 2",
FG = 1.00,
OG = 0.20
});
Recipes.Add(new Recipe
{
Name = "Test 3",
FG = 0.95,
OG = 0.09
});
#endif
}
private ObservableCollection<Recipe> _recipes;
public ObservableCollection<Recipe> Recipes
{
get
{
if (_recipes == null) Recipes = new ObservableCollection<Recipe>();
return _recipes;
}
set
{
if (_recipes == value) return;
OnPropertyChanging(() => Recipes);
_recipes = value;
OnCollectionChanged(() => Recipes);
}
}
public Recipe SelectedRecipe
{
get
{
if (_selectedRecipe == null) SelectedRecipe = new Recipe();
return _selectedRecipe;
}
set
{
if (_selectedRecipe == value) return;
OnPropertyChanging(() => SelectedRecipe);
_selectedRecipe = value;
OnPropertyChanged(() => SelectedRecipe);
}
}
private Recipe _selectedRecipe;
}
}