Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for PositionSelectedCommand not working with custom Command #519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ iOS/obj
UWP/bin
UWP/obj
packages
*.userprefs
*.userprefs
/.vs/CarouselView
/CarouselView/CarouselView.FormsPlugin.Abstractions.Portable/bin/Debug
/CarouselView/CarouselView.FormsPlugin.Abstractions.Portable/obj/Debug
/Droid/Demo.Droid.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Input;

namespace CarouselView.FormsPlugin.Abstractions
{
Expand Down Expand Up @@ -134,14 +135,14 @@ public float ArrowsTransparency
set { SetValue(ArrowsTransparencyProperty, value); }
}

public static readonly BindableProperty PositionSelectedCommandProperty = BindableProperty.Create("PositionSelectedCommand", typeof(Command), typeof(CarouselViewControl), null, BindingMode.Default, (bindable, value) =>
public static readonly BindableProperty PositionSelectedCommandProperty = BindableProperty.Create("PositionSelectedCommand", typeof(ICommand), typeof(CarouselViewControl), null, BindingMode.Default, (bindable, value) =>
{
return true;
});

public Command PositionSelectedCommand
public ICommand PositionSelectedCommand
{
get { return (Command)GetValue(PositionSelectedCommandProperty); }
get { return (ICommand)GetValue(PositionSelectedCommandProperty); }
set { SetValue(PositionSelectedCommandProperty, value); }
}

Expand Down
2 changes: 1 addition & 1 deletion Demo/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ObservableCollection<View> MyItemsSource {
}
}

public Command MyCommand { protected set; get; }
public ICommand MyCommand { protected set; get; }

protected virtual void OnPropertyChanged(string propertyName)
{
Expand Down
7 changes: 5 additions & 2 deletions iOS/Demo.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer: Alexander Reyes (T3VKUDC3C3)</CodesignKey>
<MtouchProfiling>true</MtouchProfiling>
<CodesignProvision></CodesignProvision>
<CodesignProvision>
</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>full</DebugType>
Expand Down Expand Up @@ -106,7 +107,7 @@
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
</ItemGroup>
<ItemGroup>
Expand All @@ -126,6 +127,8 @@
<ProjectReference Include="..\CarouselView\CarouselView.FormsPlugin.iOS\CarouselView.FormsPlugin.iOS.csproj">
<Project>{D525F236-6A2D-4010-B1CC-4A4B8581C90B}</Project>
<Name>CarouselView.FormsPlugin.iOS</Name>
<IsAppExtension>false</IsAppExtension>
<IsWatchApp>false</IsWatchApp>
</ProjectReference>
<ProjectReference Include="..\CarouselView\CarouselView.FormsPlugin.Abstractions\CarouselView.FormsPlugin.Abstractions.csproj">
<Project>{36E4C107-3B10-4DC6-8E6A-BA251DC3BAF3}</Project>
Expand Down