Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

error: System.InvalidCastException: Specified cast is not valid. #35

Closed
maxdiable opened this issue Jun 10, 2017 · 11 comments
Closed

error: System.InvalidCastException: Specified cast is not valid. #35

maxdiable opened this issue Jun 10, 2017 · 11 comments

Comments

@maxdiable
Copy link

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

Version Number of Plugin:1.0.0.49-beta
Device Tested On:LG
Simulator Tested On:

hi, i tested switch on my xamarin forms, but my debug show this error in main activity:
LoadApplication (new PayAndShare.App ());

this is my page:

<StackLayout Padding="20">
    <Label Text="Regular switch" />
    <Switch x:Name="NormalSwitch" />
    <Label Text="ChangeColorSwitchEffect" Margin="0,20,0,0" />
    <Switch x:Name="ChangeColorSwitch" effects:ChangeColorEffect.FalseColor="#AAEE00" effects:ChangeColorEffect.TrueColor="Blue" />
</StackLayout>

any help?
br
Massimo

@Depechie
Copy link
Contributor

@maxdiable can you see if the changing the name fixes this? The effect has been renamed and the old example does not yet reflect this... so the name now is SwitchChangeColor

Can't test myself at the moment, so please let me know if this works or not. If not I'll make some more time to be able to test run this myself!

@Depechie
Copy link
Contributor

Ow I think we may have a bug if I look at the effect code, the BindableProperties on the SwitchChangeColor static class should be of typeof(Color) instead of typeof(Color?)

I'll change that in another PR soon...

@maxdiable
Copy link
Author

maxdiable commented Jun 12, 2017

hi,
Thanks, thank you for the answer.
Could i know when the new version will be ready?
Yours sincerely
Max

@Depechie
Copy link
Contributor

True... :/
We are currently in the process to bring over the samples app again.
When that is done we will tackle the documentation!

@maxdiable
Copy link
Author

hi,
Thanks, thank you for the answer.
Could i know when the new version will be ready?
Yours sincerely
Max

@Depechie
Copy link
Contributor

I'll try to keep you posted through this issue...

@maxdiable
Copy link
Author

Thanks :)
good woork :)

@Depechie
Copy link
Contributor

@maxdiable the fix is in the PR #36 also in there is a samples page with the correct syntax for using the switch effect.
I think as long as the PR is still open, the nuget will not be correct.

@maxdiable
Copy link
Author

hi,
By the way, will I have to wait for the new version on nuget?
br
Max

@Depechie
Copy link
Contributor

If you just want to use the nuget, yeah... the PR first needs to be merger into the main code - that will trigger a new nuget creation.
But if you like you could also just copy paste the effect from the PR if needed :)

@maxdiable
Copy link
Author

Ok, I expect there is the new version on nuget..I hope it will be released soon :)
good job :)
br
Max

jamesmontemagno added a commit that referenced this issue Apr 4, 2018
* Initial Commit

* Renaming folders

* Sample app renaming projects and namespace

* Folder renaming

* Italic Placeholder Effect

Created Effect that makes the placeholder of an Entry in Xamarin.Forms italicized. A comment on StackOverflow said Font.PointSize isn't exactly the size of the text, but I've found it's close enough.

* Updated Sample app

Updated the Sample app to include a demonstration of the Italic Placeholder Effect. I forgot the RoutingEffect so had to make that.

* Add tests and rename

* Add visibility

* Tabs to spaces

* Add the ValueConversionAttribute that is used by tools such as the WPF Designer or MFractor to verify conversion type-safety in Xaml #2

Also, annotate all existing classes with ValueConversionAttribute.

* Fix references for pcl

* Add xml file to release mode

* Add sample project

* Add SelectAllTextEntryEffect for Android and iOS, with Example

* Add support for changing the true color for a toggle switch

* First implementation SelectAllTextEntryEffect for UWP

* More Organon renaming

* PR feedback on unspecified

* removed unused variables

* Added SelectAllTextEntryEffect to UWP

* [UWP] Add SearchBarSuggestionEffect

* Add ChangePickerColorEffect for Android

* Clean

* Add ChangeColorPickerEffect also for iOS, with sample.
SelectAllTextEntryEffect corrected…

* Re-organization/Naming/Appveyor Scripts/More

Gettings ready for builds in appveyor. Moved to a standard that I use in
all projects.

* Mass renaming. remove _, remove private, and more style guidelines

* Initial Commit of Behaviors

* Added ChangeColorPickerEffect for UWP

* Initial Control Commit

* Initial Gesture Commit

* Initial Animation Commit

* Update nugget & rd.xml file

* Add platform specific projects

* Add platform specific projects

* Add platform specific projects

* Add Entry Behaviors

* Add New Behaviors

EventToCommand, AddEffect, and NumericValidation

* Add projects to solution

* Update solution with projects.

* Add projects to solution

* Rename rd file

* rename rd file

* Fixes for building Effects lib

* Fixing clear entry effect

* Remove arrow pattern

Fixes #31

* Else not needed on if - return pattern

* Spaces instead of Tabs

* Bye tabs

* Try saving the Visual Studio settings!

* Revert "Try saving the Visual Studio settings!"

This reverts commit 22229ce356f8890e72a838ffb2f78d14ad53543d.

* Converting tabs to spaces

* Fix for PR27

* Tabs to spaces

* Adding unstaged project file

Someone got lost

* Fixed filename and tts

* Build fixes

* Some tabs slipped in

* Removing magic strings from Effects ctors

* Removing orphaned old sample files

* Moving filtered Converters back to /src

* Moving filtered Behaviors back to /src

* Moving filtered Gestures back to /src

* Moving filtered Effects back to /src

* Moving filtered Controls back to /src

* Moving filtered Animations back to /src

* Restructure the codebase and add CI!

* Update cake

* Fix package locations

* cleanup slns

* fix gestures sln

* Update README.md

* Update README.md

* Adding editorconfig

* Update Contributing.md

* Refactor and rename

* Adjustments

* Build fix

* Added allias

* Fixing NuGet monnikers

* Update build.cake

* Updating nuspecs to unified repo

* Unify package descriptions

* Fix for #25

This code fixes #25. It is a bug of built-in behaviour in Xamarin.iOS,
as seen on their [bug
tracker](https://bugzilla.xamarin.com/show_bug.cgi?id=33666). After
each change of certain properties (TextColor, Font, Text or
FormattedText) the effect is reapplied.

* Code formatting

Reformatted some code for better readability

* Toggled event and value is being eaten by the effect implementation!
Need to apply the value to the Xamarin forms Control
Fixes #31

* First stab at adding samples project

* Changes to address issues during code review

* I blame NUGET

* Fix #35

* Added Switch change color effect sample

* Added Forms Community Toolkit animations code

* Changed namespaces declaration position

* Changed project error message from Spanish to English.

* BindableProperty nameof

* Added Animations Sample

* Revert "BindableProperty nameof"

This reverts commit d0749a5.

* Revert "Revert "BindableProperty nameof""

This reverts commit 30d41f0.

* Deleted animations sample (left for another PR).

* Change condition to positive checks

* if (Animation == null) Change condition

* Added Animations Sample
Some fixes in Animations Library
Updated Xamarin.Forms NuGet version of sample projects

* Fixed wrong Spanish error project message

* More error messages fixes

* Changes related to PR #39 Feedback

* Update README.md

* Effect sample Entry disable auto correct

* Effect sample Entry italic placeholder

* Review adjustments

* Added all current entry effect samples

* Added Size Font To Fit label effect sample

* Remove file level xaml compilation attribute

* trying to fix cake

* Target newer Cake

* Try specific Cake filehelpers version

* Image View blur effect sample
#HacktoberFest

* Updating AppVeyor badge

* Adding missing tempkey

* Fixed link to sample app

Fixes #29

* Added link to documentation

Fixes #33

* Add converter

* Add tests

* Add doc

* Move MockConverter to separate file

* Update explanation of methods

* Update docs

* Added ColorAnimation
Updated Animations Sample
Added Animations nuspec

* Fixed ColorAnimation usings
Changed Animations nuspec Xamarin.Forms version

* Make it easy to spot esp on mobile

* Updated Xamarin.Forms NuGet packages to v2.5

* Update README.md

toolkit name change.

* Update Contributing.md

name change

* Update LICENSE

name change, update year

* Updated more projects to Net Standard
Renamed namespaces from FormsCommunityToolkit to XamarinCommunityToolkit
Updated some nuspecs

* Changed Sample namespaces
More changes in nuspecs

* Fixed Effects.Android namespace error

* Fixed incorrect project references

* Updated nuspecs

* Updated nuspecs (PR feedback)

* Multi-target!

* Rename to Xamarin.Toolkit

Aligns with UWP Community Toolkit

* Fix tests

* Fix android build

* Final fix for android

* Finalize new SLN

* update readme

* Final tweaks to csproj files

* Add netstandard 1.0 and docs

* Refactor Build Props and Targets

Nothing for targets right now.

* Cleanup samples

* Update android resources :)

* Remove readthedocs link
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants