Граф коммитов

94 Коммитов

Автор SHA1 Сообщение Дата
Sören Nils Kuklau 763bf922d9
CSS: Support omitting semicolon from last property (#14306) 2022-01-12 10:49:16 +01:00
Shane Neuville 86db84805e
Fix iOS so if you remove more than one page it's able to remove them successfully (#14383)
* Fix iOS Shell when removing multiple views

* - ui tests and fix navigate args

* - improve logic

* Update ShellSection.cs

* - update UI Tests
2021-07-05 17:42:25 +01:00
Shane Neuville 6a52953a3b
Update to latest Nunit3 (#13677)
* Update to latest Nunit3

* - update ui test libraries

* - adapter updates
2021-02-07 01:41:19 +00:00
Shane Neuville 6b73a624ef
Fix string initializer for ShellNavigationState (#13478) fixes #13422 2021-02-05 17:48:31 +00:00
E.Z. Hart ebd6ac35b0
Bind RadioButton default template root properties to RadioButton's pr… (#12742) fixes #12345
* Bind RadioButton default template root properties to RadioButton's properties
Fixes #12345

* Revert project file changes
2020-11-11 12:25:43 +00:00
Shane Neuville afe2540a7e
Remove markup extensions (#12730)
* Remove markup extensions

* - remove flag
2020-11-06 11:15:13 +00:00
Shane Neuville 454cc53618
Fix MasterBehavior to propagate correctly to FlyoutPage (#12727) fixes #12490 2020-11-06 11:12:01 +00:00
Shane Neuville 75a33d2402
[Shell] Fix query parsing and allow more types for parameters (#12186) fixes #10899
* Fix query parsing and allow more types

* Update ShellNavigationState.cs

* Update Xamarin.Forms.Core.UnitTests.csproj
2020-10-07 15:15:24 +01:00
Pedro Jesus 65e22f02c5
Fix flyout render quirks (#12129)
* Fix UWP and wrong flyout render logic

* Fixed FlyoutItemVisibleWorksForMenuItemsAddedAsShellItem unittest

* fixed grouping in Flyout

* added handle for GetIsVisible for MenuItem

* fixed unit test for FlyoutGroupsNumbersForFlyoutDisplayOptionsAsMultipleItems

* - only increment when needed

* - fix test

* - fix names

* - fix wrong disable behavior

* - generate less noise if flyout hasn't changed

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
2020-09-25 12:51:30 +01:00
Javier Suárez d79d5b77e7
[Core] Added RoundRectangleGeometry (#11851)
* Implemented RoundRectangleGeometry

* Fixed broken unit test

* Fix formatting

* Fixed formatting issues

fixes #11151
2020-09-18 14:36:43 -07:00
Shane Neuville be202998f3
Shell navigating deferral token (#12039)
* Check Point

* Shell Navigating Deferal Token

* - fix PopToRoot and add to store

* - fix animations

* - clean up code

* Update Xamarin.Forms.Core/Routing.cs

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>

* Update Xamarin.Forms.Core/Routing.cs

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>

* - fix formatting

Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>

fixes #10638
2020-09-18 14:34:02 -07:00
E.Z. Hart 2a97a6c5f0
Templated RadioButtons and RadioButtonGroups (#11628)
* First stab at RadioButtonGroup attached property and Templated RadioButton

* RadioButtonGroupController assigning group names

* Added updates for RadioButtonGroupController on selection change

* More galleries!

* Content property propagation

* Ignore renderers if using templated views on UWP

* Apply text/font properties to Content

* Make RadioButton template parts constants

* Cache renderer availability lookup

* Add TemplateView check to CreateRenderer on iOS

* Handle Checked RadioButton GroupName changes

* Update WPF renderer

* Update macOS and Tizen renderers

* Add more unit tests, make RB Value updates propagate to RBG

* Remove Text property, updated examples; throw Exception when Content is not Text and non-Text Content is not supported

* Prevent Content exceptions in demo pages

* Colors -> Brushes

* Add default ControlTemplate example

* Set up flags for Core Gallery test pages

* Switch Android back to ToString for Content

* Back to ToString where necessary, and using the WrapperControl for UWP

* Add comment for Content

* Log a nice warning if folks try to use View as Content and it's not supported

* Add experimental flags for drag and drop tests

* Fix crashes due to missing brush experimental flag

* Make control templates from styles work alongside default templates

* Catch up on which flags are still a concern

* Fix infinite loop in platform tests

* Attempt to fix occasionaly GroupableItemsViewController disposed crash

* Make webview visible so we can verify it loaded in UI test screen shots

* Fix merge

Co-authored-by: Rui Marinho <me@ruimarinho.net>
2020-09-18 17:38:47 +01:00
Shane Neuville 19a15b5da9
Fix various quirks with flyout item bindings (#11987)
* Fix Shell flyout binding quirks

* - fix constructor

* Update ShellTests.cs
2020-09-15 18:17:20 -05:00
Rui Marinho 6b816f7148
[Core,iOS,Droid,UWP,Tizen] Remove MediaElement (#12007)
* [Core,UWP,iOS,Android] Remove MediaElement

* [Tizen] Remove MediaElement

* [WPF] Remove reference to MediaElement

* [Tests] Remove MediaSourceTests

* [Core] Remove MediaSource

* [Tizen] Remove extra files related with MediaElement

* Update ExperimentalFlags.cs

* [Controls] Removing References to MedialElement strings

* [Controls] Remove  reference to MediaElement flag
2020-09-10 10:22:37 +01:00
Javier Suárez ea9c15ec9f
[Android, iOS] Fix issue using ArcSegment to create a Path (#11195)
* Added repro sample

* Fixed crash on iOS

* Updated sample

* Fixed issue

* Added unit tests

* Used always the correct scale using Shapes

* Fixed build error

* Fixed build error

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>

fixes #11190
2020-08-24 14:27:18 -07:00
Shane Neuville bc51d2499b
Drag and drop (#11537)
* Drag and Drop Gesture Recognizers

* - wire up gallery

* - fix android completed

* - wire up completed ios

* - fix macos build

* - add exclusion

* - add commands, tests, and additional galleryies

* - create image for ios drag

* - fix macos build issue and add flag

* - set flag on unit tests

* Update Xamarin.Forms.Controls/GalleryPages/DragAndDropGalleries/EnablingAndDisablingGestureTests.cs

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>

* - fix null check

* - ios null check

* - fix uwp check

* - fix sample

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>

fixes #10778
2020-07-29 17:32:51 -07:00
Javier Suárez 8f7aa4a884
Added pending Shapes classes ctors (#11490) 2020-07-28 14:14:16 -07:00
Javier Suárez 90db081047
Add Rect struct (#11187)
* Added Rect struct

* Fixed Build error

* More Unit Tests

* Changes in RectTypeConverter

* Fixed Build error

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
2020-07-20 16:48:44 -07:00
E.Z. Hart ab55162596
Force off-main-thread ItemsSource updates to update on main thread (#11235)
* Fixed CollectionView issue adding data in different thread on Android

* Fixed build error

* Changes to fix the build

* Force off-main-thread ObservableCollection changes to marshal to main thread

* Update Xamarin.Forms.Controls.Issues.Shared.projitems

* Update interface

* Restore old method

Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>

fixes #10735
fixes #9753
2020-07-20 15:47:40 -07:00
Javier Suárez 3a57e2e020
[Enhancement] Brushes (#9220)
* Added brushes to Core, Core Gallery and the iOS implementation

* Implemented brushes on UWP

* Improved UWP brushes implementation

* Changes to improve the brushes Core Gallery samples

* Added default SolidColorBrush colors

* Improved brushes samples adding more options

* Implement brushes on Android

* Fixed Brush Background on Android ImageButton

* Initial code to add support to brushes using CSS

* Support more CSS gradient options
Added more unit tests

* Changes in Core Gallery brushes samples

* Reuse same ColorTypeConverter in the GradientBrushParser

* Fixed brush issues on specific controles (Android: Page) (iOS: Label, ImageButton, NavBar)

* Updated brushes unit tests

* Added new sample in Core Gallery
Fixed angle issue in UWP LinearGradientBrush

* Fixed UWP issue updating brushes in Buttons

* Improved UWP UpdateBackground logic in VisualElementRenderer

* Fixed UWP build errors
Fixed some UWP brushes issues

* Added WPF implementation

* Fixed issue verifying brushes in iOS VisualElementRenderer

* Fixed iOS brushes in BoxView

* Added scroll to LinearGradientPointsGallery sample

* Fixed iOS brushes size issue

* Implemented brushes in macOS

* Uncommented wrong method to update image brushes resizing the App Window

* Fixed Windows Build

* Fixed broken unit tests

* Added more comments in UWP RadialGradientBrush

* Added BrushExperimental flag

* Notify VisualElement Background changes if some Brush property have changed

* Fixed brush issue in Android Button using CornerRadius

* Fixed unnecessary border color issue applying brushes to Layouts in Android

* Fixed brushes unit tests

* Removed EditorBrowsable label in BackgroundColor until deprecate it

* - fix whitespace

* Changed IsEmpty Brush property to be abstract and implemented it in every brush.

* Changed IGradientShader to GradientShader

* Fixed BindableBrushGallery issue on iOS/macOS

* Fixed wrong iOS right RadialGradientBrush

* Fixed Brush in iOS NavBar iOS < 13

* Fixed iOS Brush on Button and Label

* Fixed Build errors

* Replace UWP Community Toolkit RadialGradientBrush class by WinUI 2.4 RadialGradientBrush

* Fixed broken unit test

* Fixed brushes issues on macOS resizing the Window or on iOS rotation, etc.

* Added the option to choose the BorderColor in the Brushes Playground

* Removed duplicated ShapeRenderer Compile line in Platform iOS csproj

* Removed unnecessary changes

* Added Visual Brush samples

* Implemented Brushes in iOS Visual Renderers

* Only show the access to the Brushes Visual sample in Android and iOS

* Added brushes support to shapes

* Fixed Build error

* Removed unnecessary changes

* Added Brushes support to Android Material ActivityIndicator

* Added brushes support to Android Visual Frame

* Updated Visual Android Renderers

* Fixed BoxView Brush issue

* Updated brush views sample to add more BoxView cases

* Added brushes tests classes

* More Brushes unit tests

* Added more controls to test in the BrushesViewGallery

* Added new Brushes sample

* Fixed build error

* Updated AnimateShapeGallery to use a Brush

* Fixed CoreGallery Core samples allowing to use the Background property

* Added Brushes platform unit tests

* - apply background color if solid brush is empty

* - fix visual checkbox

* Fixed the build

* Fixed issue on Shapes

* Updated MaterialButtonRenderer to use IsOneOf with several properties

* Removed unnecesary change in UWP Styles

* Use IsOneOf in UWP BackgroundTracker

* Added IsNullOrEmpty Brush method

* Removed unnecessary brush updates

* Added more constructors to LinearGradientBrush and RadialGradientBrush

* Fixed UWP NavBar BarBackgroundColor issue

* Removed unnecessary line in UWP BoxViewRenderer

* Fixed NRE in iOS ButtonRenderer

* Updated iOS Button SetBackground logic

* Implemented Shell FlyoutBackground

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
2020-07-17 08:44:13 -06:00
shane bd37fe5d70 Merge branch '4.7.0' into 4.8.0
# Conflicts:
#	Xamarin.Forms.Platform.UAP/FormsTextBox.cs
2020-07-11 19:59:42 -05:00
Javier Suárez 301f8ae2f9
Added SwipeView unit tests (#11355) 2020-07-08 10:09:09 -07:00
Samantha Houts 0fb6dc55f8 Merge branch '4.7.0' 2020-06-09 07:51:02 -07:00
Javier Suárez 9a9f71ddb8
[Enhancement] Shapes (Path) (#9264)
* Added Path definition in Core (Shapes)
Implemented Path in Android and iOS

* Fixed Android build errors

* Fixed UWP Build

* Fixed WPF Build

* Implemented PathRenderer on UWP

* Added unit tests

* Fixed namespaces conflicts in Platform projects

* Changes to fix the build errors

* Implemented Path Transformations in Android and iOS

* Fixed Build error in WPF and UWP

* Implemented Path Transformations in UWP

* Fixed iOS Build error

* Changes to fix the Build (Path namespace conflict)

* More changes to fix the build error

* Fixed Windows Build errors

* Fixed Path size issue on UWP

* Added Shapes_Experimental flag

* Updated path sample

* Updated Android ShapeRenderer size logic

* Added Shape Aspect sample in Core Gallery

* Added more Shapes samples

* Updated UWP PathRenderer size logic

* Updated droid and iOS pathRenderer size logic (same behavior in all the platforms)

* Updated UWP ShapeRenderer

* Implemented Path in WPF Backend

* Fixed build error

* Initial Clip implementation in WPF and UWP (work in progress)

* Added Path implementation on macOS

* Added Clip implementation in Android, iOS and macOS

* Fixed broken unit tests

* Notify the change of Geometry if any of the child properties changed

* Added new sample clipping different views

* Fixed flipped shape issue on macOS

* Added support to Clip using EllipseGeometry, LineGeometry and RectangleGeometry in UWP

* Changed Shape class to be abstract

* Moved Shapes to Xamarin.Forms.Shapes in Android, iOS and macOS

* Moved Shapes to Xamarin.Forms.Shapes namespace in Windows (UWP and WPF)

* Fixed wrong property in LineGeometry

* Fixed build error

* Added Clip Performance sample in Core Gallery

* Update Matrix.cs

* Update RectangleGeometry.cs

* Update Xamarin.Forms.Platform.macOS.csproj

* Some duplicate classes

* Update PointCollectionTests.cs

* Update ImageButtonRenderer.cs

* Update Xamarin.Forms.Platform.iOS.csproj

* Update Xamarin.Forms.Platform.iOS.csproj

* Fixed tabs error

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>

fixes #2452 (partially)
fixes #9178
2020-06-09 07:14:53 -07:00
Javier Suárez 9efe531b19
[Enhancement] Shapes (#9218)
* Added Shapes to Core and Core Gallery samples
Implemented basic Shapes on iOS

* Added basic shapes Android implementation

* Fixed UWP namespace conflicts

* Fixed WPF namespace conflicts

* Implemented basic shapes on UWP

* Fixed UWP Ellipse and Rectangle size issue

* Fixed Tizen Build

* Changes to fix the build errors

* Exclude shapes renderers from Tizen compilation

* Implemented LineCap and LineJoin in Android and iOS

* Implemented LineCap and LineJoin on UWP

* Fixed build error

* Updated Polygon sample

* Fixed UWP Build error (namespace conflicts)

* Fixed namespaces collision build error

* Added "Shapes_Experimental" flag

* Update UWP ShapeRenderer size logic

* Updated iOS and Android ShapeRenderer size logic

* Fixed UWP Build error

* Added WPF implementation

* Fixed Tizen Build error

* Added Shapes macOS implementation

* Fixed broken unit tests

* Use the same Shapes classes between UWP and WPF backends

* Fixed flipper macOS shape issue

* Changed Shape class to be abstract

* Added Polygon and Polyline unit tests

* Added more Shapes Unit Tests

* Moved Shapes to Xamarin.Forms.Shapes in Android, iOS and macOS

* Moved Shapes to Xamarin.Forms.Shapes namespace in Windows (UWP and WPF)

fixes #2452 (partially)
fixes #9178
2020-06-08 15:00:19 -07:00
Rastislav Novotný f06cb1f652
Use HorizontalGrid and VerticalGrid string values to specify GridItemsLayout in XAML (#8104)
* Convert HorizontalGrid and VerticalGrid strings to ItemsLayout (#5577)

* Support GridLayout in ItemsLayoutDesignTypeConverter #5577

* Add Issue5577 control to test ItemsLayoutConverter

* Optimize ItemsLayoutTypeConverter

* Expect InvalidOperationException, when span is missing in ItemsLayoutTypeConverter

Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com>
2020-06-05 15:34:17 -06:00
Felipe Baltazar c986b70194
Shell handle clear refactoring (#9626)
* base collection for shell imte/content/section

* Inner collection fix

* merge changes on abstract collection

* - generalize a bit more

* data sync

# Conflicts:
#	Xamarin.Forms.Core/Shell/ShellContentCollection.cs
#	Xamarin.Forms.Core/Shell/ShellSection.cs
#	Xamarin.Forms.Platform.iOS/Renderers/ShellSectionRootRenderer.cs

* - fix collection sync

* - fix event propagation

* - change visible items events

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
2020-05-27 13:13:52 -06:00
Samantha Houts 199b04429c Merge branch '4.6.0' 2020-05-01 11:20:36 -07:00
Gerald Versluis 6c40121e97
Runtime updating of AppTheme values (#10442)
* Make things BindingBase

* Update OnAppTheme.cs

* Runtime updating

* Fixed

* Cleanup

* Update VisualElement.cs

* Update Application.cs

* Fix NRE for unit tests

* Review feedback

* Update Application.cs

fixes #10391
2020-04-28 11:31:44 -07:00
Peter Moore 573e6cda8f
Gh4565 multibinding (#5) (#8684)
- fixes #4565

* Implement MultiBinding for OneWay and TwoWay modes

* Make it work with different BindingModes

* Add RelativeSource support.

* Additional tweaks for edge cases. Add unit tests.

* Implement RelativeSourceTargetOverride with a WeakReference

* Modify per PR feedback

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
2020-04-22 09:57:06 +02:00
Bohdan Benetskyi c4009b7fb8
#8183 Fix Base Class Selector with Descendant Selection (#9004)
* #8183 Fix Base Class Selector with Descendent Selection

* #8183 Unit Tests

* #8183 Additional Base Class Selector Tests
2020-03-20 17:06:34 +01:00
Vincent Hoogendoorn 1cf98d930c
[Spec] CSharpForMarkup (#8342)
* - Add MarkupExtensions from 0615662827/src/XamarinFormsMarkupExtensions.cs
- Remove specific converters
- Fix .NETStandard 1 build errors by refactoring IConvertible to Enum generic constraints
- Add RegisterDefaultBindableProperties method
- Reformat source to comply with Forms contibuting guidelines

* - Move markup extensions to Xamarin.Forms.Markup namespace to prevent impact on existing code and to support clear separation of UI markup from UI logic
- Split up source file for better maintainability

* Cleanup:
- Names of generic types and variables to reflect where clauses
- Namespaces remove unused & sort
- Add whitespace
- Remove unused file

* Fix for incorrect type name in exception message
Remove RowCol helpers because compiler cannot infer its generic type parameters. Use Row and Col methods instead

* Add targetNullValue and fallbackValue parameters to binding helpers.
Equivalent to bd7f999576

* rename binding helpers sourcePropertyName parameter to path

* Enable Style<T> on BindableObject instead of Element to resolve https://github.com/xamarin/Xamarin.Forms/pull/8342#discussion_r363088124

* Fix for Grid properties Row, Col, RowSpan, ColumnSpan not set when default value is specified https://github.com/VincentH-Net/CSharpForMarkup/issues/7

* Support DefaultBindableProperties for BindableObject (was limited to Element)

* .Font:
- Support any IFontElement (was limited to Button, Label, Entry and Picker)
- Fix for italic ignored when bold == true

* Fix for .FontSize, .Bold, .Italic return Label instead of type derived from Label

* Unit tests batch 1: for LabelExtensions, LayoutExtensions, ViewExtensions

* Add DefaultBindableProperties for more BindableObject types

* Remove .Menu() helper from ViewInFlexLayoutExtensions (bc no relation to FlexLayout)

* Fix for .Row and .Col without span specified still sets span

* Rename MarkupBaseTestFixture.TestPropertySet to TestPropertiesSet

* Add unit tests for ViewInFlexLayoutExtensions, ViewInGridExtensions and VisualElementExtensions

* Add default bindable property for all applicable bindable objects in core.

* Add unit tests for DefaultBindableProperties

* Support Bind, Assign and Invoke on BindableObject (was Element)
Add inline doc to clarify purpose of Bind overloads

* Add unit tests for BindableObjectExtensions

* Fix for attributes not set in .Font
Rename fontSize parameter to size
Enable .FontSize, .Bold and .Italic on IFontElement (was Label)

* Add unit tests for ElementExtensions

* Add unit tests for ElementExtensions

* Add assert of exception message content in GetDefaultBindablePropertyForUnsupportedType

* Add unit tests for EnumsForGridRowsAndColumns

* Add inline doc to clarify purpose of gesture recognizer binding overloads
Rename private constant bindingContextPropertyName to bindingContextPath for clarity

* Add unit tests for Style; cleanup namespaces in Style

* Simplify BindableObjectExtensions implementation (functionality unchanged)

* Add IGestureRecognizers to GestureElement and View, to avoid code duplication when accessing the existing GestureRecognizers property

* - Add specific helpers for more built-in gesture recognizers
- Add helpers to support initializing gesture recognizers
- Eliminate duplicate code for View and GestureElement by using new IGestureRecognizers
- Simplify implementation
- Rename ViewGesturesExtensions to ElementGesturesExtensions

* Extract BindingHelpers from BindableObjectExtensionsTests

* Add unit tests for ElementGesturesExtensions

* Add support for typed converter parameters
Add asserts for conversion values in unit tests

* Add unit tests for FuncConverter

* Add missing calls to Bind overloads in unit test for supporting derived types in BindableObject extensions fluent API

* Cleanup: remove unneeded Xamarin.Forms. prefix from static class references

* Add unit tests for PlatformSpecificsExtensions

* Reorder FuncConverter type params to optimize for most common usage and to remain backwards compatible with https://github.com/VincentH-Net/CSharpForMarkup

* Extend Bind*Gesture helpers to support all possible binding parameters

* Rename EnumsForGridRowsAndColumns to GridRowColEnums

* Add BindCommand helper to bind to default Command + CommandParameter properties
Add RegisterForCommand to register default Command + CommandParameter properties for custom bindable objects

* - Change Bind*Gesture helper parameters to match BindCommand parameters, to enable binding to Command + CommandParameter in a single compact call (removed parameters did not make sense for a command).
- Add inline doc to more ElementGesturesExtensions helpers where needed
- Improve ElementGesturesExtensions source formattting for consistency and readability

* Remove PlatformSpecificsExtensions
(only 2 iOS-only helpers; replace with guidance in PR description on how to use any platform specific with .Invoke)

* Fix inline doc spelling: it's -> its

* Rename TextLeft -> TextStart, TextRight -> TextEnd to support RTL

* Add Columns.Define(width, width ...) and Rows.Define(height, height ...) overloads for Grid

* Rename Grid rows & columns extensions class to GridRowsColumns

* Change gesture recognizer helpers implementation from reuse existing instance to always add new instance

* Change Bind*Gesture helpers default to not bind the commandparameter (is the more common scenario)

* Rename BoolNotConverter to NotConverter and make it a 2-way converter

* Add culture support to FuncConverter

* Rename helpers Left -> Start, Right -> End
Add opt-in LeftToRight and RightToLeft helpers

* Rename Col -> Column throughout

* Rename H -> Horizontal and V -> Vertical throughout

* Add Markup_Experimental flag for all API methods and update all unit tests to run with and without the flag

* Re-add "Markup_Experimental" flag

* Add default bindable properties / test exclusions for new BindableObject types in core

* Add constructorHint to FuncConverter and Style for more clear experimental flag message

* Add default bindable property for RadioButton - fixes test AllBindableElementsInCoreHaveDefaultBindablePropertyOrAreExcluded failure
2020-02-27 15:03:25 -08:00
Javier Suárez Ruiz 414e54837d
[Enhancement] AdaptiveTriggers (#9422)
* Initial AdaptiveTriggers commit

* Updated adaptive triggers implementation

* Fixed AdaptiveTrigger conflicts issue

* Improved OrientationStateTrigger

* Updated AdaptiveTrigger sample

* Improved StateTriggers conflicts resolution
Added CompareStateTrigger
Propagate BindingContext from parent VisualElement to StateTriggers

* Propagate BindingContext correctly to StateTriggers.

* Added StateTriggers unit tests

* Fixed broken unit tests.

* Added more StateTriggers unit tests

* Added more AdaptiveTriggers samples

* Fixed wrong line break

* Moved PropagateBindingContextToStateTriggers from View to VisualElement

* Added DualScreenStateTrigger

* Changes based on PR feedback (modify AdaptiveTrigger class to be sealed)

* Added AdaptiveTriggersExperimental

* Changes in OrientationStateTrigger to use Device Info INPC

* More changes to cover PR feedback

* Updated DualScreenStateTrigger to use TwoPaneViewMode enum instead a bool

* Fixed problem with WeakEventListener, unsubscribe events correctly

* - call update state when attaching

* - IsTriggerActiveChanged

* Update Xamarin.Forms.Core/StateTrigger.cs

* Update Xamarin.Forms.DualScreen/SpanModeStateTrigger.shared.cs

* - isactive simplify

* - update state

* - toggle state tests

* - fix flag on unit tests

Co-authored-by: Shane Neuville <shane94@hotmail.com>
2020-02-07 15:12:57 -07:00
Shane Neuville b907376605
[Android,iOS,UWP,WPF] MediaElement control (#3482) (#9439)
* MediaElement and iOS/Android/UWP renderers.

* Added basic WPF renderer. Fixed sizing issue on UWP renderer. Added sample page to ControlGallery app

* MediaEnded event on UWP. Source Uri convert ms-appx to pack:// uri scheme on WPF

* code style fixes

* resolving conflicts

* Following discussion on PR made NaturalDuration a nullable TimeSpan so that can determine when value is not present.
Added CanSeek property to indicate when Position property can be set.
Added support for KeepScreenOn to WPF renderer.
Improved ControlGallery page with separate Play/Pause/Stop buttons and label to display current state

* coding style fixes

* coding style fixes 2

* Improved media controls on demo page. Renderer enhancements for Android and iOS

* Improved logic around media metadata in iOS renderer.
Switched to https video uri to allow playback in iOS. Increased media control button sizes

* Improved parsing of ms-appdata uris supporting both the local and temp folders

* Removed redundant Debug.WriteLines. Removed XML docs from MediaElement and MediaElementState types.

* Bug fix for iOS MediaElement.Source Uri escape handling

* Adding MediaElement fast renderer for Android

* Rearchitecting the Element/Renderer connectivity. New WPF,UAP and Android FastRenderer complete. Still requires Android classic renderer and iOS renderer...

* More MediaElement renderer development. Converted iOS to a FastRenderer

* Latest android renderer

* Android renderer fix for StopPlayback reusability. MetadataRetreiver now loaded async.

* Added an IMediaElementController property to Android renderers to simplify code.

* Simplified Aspect property

* Changed AreTransportControlsEnabled to ShowsPlaybackControls. Removed commented-out code.

* merging

* merging

* added mediaelementrenderer back

* support for polling the position property. Added timer to demopage to poll for position.

* Fixed scaling issue on iOS and background color

* Renderer code review issues

* Implementing MediaSource (ImageSource pattern) to replace Uris. Other code cleaning fixes.

* Hooked up MediaSource and kept uri custom schema logic

* Moved all the "callback" methods to the IMediaElementController interface so they are not publicly exposed on the MediaElement. Removed HttpHeaders and associated code for v1 release. Other code tidying.

* Code review feedback

* Integrated unit tests. Added support for inherited binding on MediaSource.

* Additional Windows file path test. Fix for UWP renderer to check if Control is released

* Fix for FormsVideoView metadata causing aspect issues. Simplified Android FastRenderer to correctly handle VideoView lifetime.

* fixed merge error

* fixed merge errors

* MediaElement and iOS/Android/UWP renderers.

* Added basic WPF renderer. Fixed sizing issue on UWP renderer. Added sample page to ControlGallery app

* MediaEnded event on UWP. Source Uri convert ms-appx to pack:// uri scheme on WPF

* code style fixes

* resolving conflicts

* Following discussion on PR made NaturalDuration a nullable TimeSpan so that can determine when value is not present.
Added CanSeek property to indicate when Position property can be set.
Added support for KeepScreenOn to WPF renderer.
Improved ControlGallery page with separate Play/Pause/Stop buttons and label to display current state

* coding style fixes

* coding style fixes 2

* Improved media controls on demo page. Renderer enhancements for Android and iOS

* Improved logic around media metadata in iOS renderer.
Switched to https video uri to allow playback in iOS. Increased media control button sizes

* Improved parsing of ms-appdata uris supporting both the local and temp folders

* Removed redundant Debug.WriteLines. Removed XML docs from MediaElement and MediaElementState types.

* Bug fix for iOS MediaElement.Source Uri escape handling

* Adding MediaElement fast renderer for Android

* Rearchitecting the Element/Renderer connectivity. New WPF,UAP and Android FastRenderer complete. Still requires Android classic renderer and iOS renderer...

* More MediaElement renderer development. Converted iOS to a FastRenderer

* Latest android renderer

* Android renderer fix for StopPlayback reusability. MetadataRetreiver now loaded async.

* Added an IMediaElementController property to Android renderers to simplify code.

* Simplified Aspect property

* Changed AreTransportControlsEnabled to ShowsPlaybackControls. Removed commented-out code.

* merging

* support for polling the position property. Added timer to demopage to poll for position.

* Fixed scaling issue on iOS and background color

* Renderer code review issues

* Implementing MediaSource (ImageSource pattern) to replace Uris. Other code cleaning fixes.

* Hooked up MediaSource and kept uri custom schema logic

* Moved all the "callback" methods to the IMediaElementController interface so they are not publicly exposed on the MediaElement. Removed HttpHeaders and associated code for v1 release. Other code tidying.

* Code review feedback

* Integrated unit tests. Added support for inherited binding on MediaSource.

* Additional Windows file path test. Fix for UWP renderer to check if Control is released

* Fix for FormsVideoView metadata causing aspect issues. Simplified Android FastRenderer to correctly handle VideoView lifetime.

* fixed merge error

* manual merge fixes

* Fixed missing FileMediaSourceConverter

* Fixed merge issue with iOS project file

* Clarification to WPF Source Uri exception message

* Changed iOS local path to the Library path as this is not user visible or synchronised with iCloud. Fix for breaking change in WeakEventManager

* Added Volume property

* Fixes for code-review feedback

* Optimised iOS renderer to remove a view layer

* fixes to resolve possible rotation bug

* Moved ms-appdata parsing to shared location.

* fixed codesign error

* Fix for issue on Android where control may show black screen prior to video playing - now respects backgroundcolor property

* Renamed conflicting extensions class

* Add experimental flag; remove slow renderer

* Update MediaElementDemoPage.cs

* Update MediaElementRenderer.cs

* Update MediaElementRenderer.cs

* Porting latest renderer updates. iOS re-written as a non-fast renderer to workaround issue with dispose when using on modal pages.

* Fixed protected member in sealed class issue

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
fixes #1692

Co-authored-by: Peter Foot <peter@inthehand.com>
2020-02-05 16:40:47 -07:00
Shane Neuville df95bd0b47
Shell Modal Behavior (#8790)
* Shell Modal Behavior

* Add Shell.IsModal and Shell.IsModalAnimated

* - cleanup

* - null platform proxy before swapping in new page

* - add dispose checks

* - clear out platform nav models earlier when changing out main pages

* - presentationmode

* - change animated to zero

* - PresentationMode

* - rollback addpage changes

* - fix flags

* - animated

* - remove none
2020-01-16 20:14:17 -07:00
Jonathan Peppers 1ae8fb1cd5 [core] improve Color & Clamp performance (#8884)
* [core] improve Color & Clamp performance

When profiling startup of a HelloForms app on a Pixel 3 XL, I noticed:

    Total(ms) Self(ms)      Calls Method name
            3        1        572 Xamarin.Forms.Internals.NumericExtensions:Clamp (double,double,double)

This method is called multiple times for every `Color` created and
~142 are created on startup. This is why it shows up 572 times for an
app with a single `Label`.

I found there is a `Math.Clamp` implementation in corefx:

6662a0f2fd/src/libraries/System.Private.CoreLib/src/System/Math.cs (L224-L225)

The only difference is this version can throw an exception, so we
could return the incoming value instead. That would be bad to change!

If I rework `NumericExtensions` to use corefx's implementation it is a
bit faster, I did a BenchmarkDotNet comparison running with Mono on
macOS:

     Method |      Mean |    Error |   StdDev |
    ------- |----------:|---------:|---------:|
     Clamp2 |  53.89 ns | 0.668 ns | 0.522 ns |
     Clamp1 |  61.84 ns | 1.270 ns | 2.289 ns |
     Color2 | 112.50 ns | 2.643 ns | 3.705 ns |
     Color1 | 129.03 ns | 2.603 ns | 4.760 ns |

Maybe every `Color` is ~13% faster?

Code for the benchmark is here:

https://github.com/jonathanpeppers/Benchmarks/blob/clamp/Benchmarks/Clamp.cs

Additionally, I reworked the list of default `Color` fields so that
they call a new private constructor that does less math and avoids
`Clamp` completely. We should still keep the original change, as it
would help any cases where the `Color.To*` methods would be used in
apps.

I seem to be able to see a small difference in a Release build running
on a Pixel 3 XL:

    Before:
    12-18 13:04:27.154  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +606ms
    12-18 13:04:30.851  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +589ms
    12-18 13:04:34.601  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +587ms
    12-18 13:04:38.352  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +575ms
    12-18 13:04:42.084  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +583ms
    12-18 13:04:45.802  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +573ms
    12-18 13:04:49.566  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +592ms
    12-18 13:04:53.284  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +583ms
    12-18 13:04:57.015  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +594ms
    12-18 13:05:00.715  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +581ms
    Average(ms): 586.3
    Std Err(ms): 3.05886689260364
    Std Dev(ms): 9.67298643990917

    After:
    12-18 13:08:16.677  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +593ms
    12-18 13:08:20.377  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +577ms
    12-18 13:08:24.107  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +583ms
    12-18 13:08:27.827  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +576ms
    12-18 13:08:31.574  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +586ms
    12-18 13:08:35.324  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +584ms
    12-18 13:08:39.056  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +587ms
    12-18 13:08:42.773  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +586ms
    12-18 13:08:46.523  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +584ms
    12-18 13:08:50.256  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +587ms
    Average(ms): 584.3
    Std Err(ms): 1.56382721409865
    Std Dev(ms): 4.94525586350753

This change seems low risk and would help all platforms.

* One last tweak byte -> int

Doing some reading: https://stackoverflow.com/a/43158214/132442

It seems `int` performs even better than `byte`. I did another test
run with just this change:

    Before:
    12-18 13:37:23.347  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +576ms
    12-18 13:37:27.079  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +575ms
    12-18 13:37:30.828  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +581ms
    12-18 13:37:34.578  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +588ms
    12-18 13:37:38.296  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +572ms
    12-18 13:37:42.046  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +579ms
    12-18 13:37:45.781  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +576ms
    12-18 13:37:49.526  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +586ms
    12-18 13:37:53.276  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +586ms
    12-18 13:37:57.009  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +582ms
    Average(ms): 580.1
    Std Err(ms): 1.70912583243924
    Std Dev(ms): 5.40473043833928

    After:
    12-18 13:35:38.745  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +572ms
    12-18 13:35:42.459  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +572ms
    12-18 13:35:46.209  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +581ms
    12-18 13:35:49.974  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +581ms
    12-18 13:35:53.724  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +574ms
    12-18 13:35:57.474  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +580ms
    12-18 13:36:01.207  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +573ms
    12-18 13:36:04.957  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +568ms
    12-18 13:36:08.707  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +566ms
    12-18 13:36:12.407  1490  1517 I ActivityTaskManager: Displayed com.xamarin.forms.helloforms/crc6450e568c951913723.MainActivity: +565ms
    Average(ms): 573.2
    Std Err(ms): 1.87853370714738
    Std Dev(ms): 5.94044517598546
2020-01-05 16:36:09 -08:00
Shane Neuville f9114b1306
Make the Refresh View Respect Command CanExecute and add Refreshing event (#7866)
* Make Refresh View respect Command CanExecute

* - force isrefreshing false when isenabled fasle
- Add IsRefreshing Event

* - shift command execution up to xplat code

* - fix ui test

* - cleanup

* - add additional check

* Update Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7803.xaml.cs

* - fix flag
2019-10-17 00:44:25 -06:00
Shane Neuville 5298a4c8d3 [Tests]Update to Xamarin.UITest 3.0 and NUnit 3.0 (#6332) (#7031)
* [Tests]Update to Xamarin.UITest 3.0 and NUnit 3.0 (#6332)

* - increment test nugets

* - adapter folder

* - uitest version

* add wait for 34632
2019-09-10 16:05:55 +01:00
Rui Marinho dcff8ef6ff
[Build] Bump msbuild locator move to VS2019 (#7415)
* Bump msbuild locator

* Update test adapter

* Update build-windows.yml

* Update azure-pipelines.yml

* Update build-windows.yml
2019-09-06 00:33:50 +01:00
Rui Marinho 09acfd48d4 [Feature] CarouselView (#5044)
* [Spec] Draft carousel

* [Core,Spec] Add IndicatorsView

* [iOS] IndicatorsViewRenderer and CarouselVieRenderer draft

* [Controls] Fix controls gallery linker

* [Core] Remove extra file

* Fix Remove IITemsSource

* [iOS] Implement Scroll and selected item

* [iOS,Android,Core] Refactor to use CurrentItem on CarouselView

* [iOS,Core] Add NumberOfVisbileItems

* [iOS,Core] Add IsScrolling and IsDragging

* [iOS,Core] Add Visual state for carousel items

* [iOS,Core] Add padding to CarouselView

* [iOS,Controls] Fix sample, disable selection on CarouselViewController

* [Core] Add Delta to ScrolledDirectionEventArgs

* Update SelectableItemsViewRenderer.cs

* [Controls] Refactor Carousel examples

* [Controls] Fix csproj

* [iOS] Fix bug with insets with carouselview padding

* [Controls] Fix vm for CarouselXamlGallery

* [Controls] Collection Carousel type demo

* [Core] Add other CarouselView Layouts

* Fix Carousel rebase (#6518)

* Fix rebase Android

* Fix rebase iOS

* Update ItemSizingStrategy

* [Core] Add ItemSizingStrategy None

* [iOS] Allow to override ReuseId and RegisterCells from ItemsViewController

* Remove IndicatorsView

* Remove ICarouselViewController

* Implemented IsDragging on Android

* Implemented Scrolled for Android

* Removed Spacing methods

Spacing is now available on a lower level and we don't need to worry about it

* Fix rebase

* [UnitTests] Add basic CarouselView unit tests

* [iOS] Update CarouselViewLayout

* [iOS,Core] Remove Padding and add PeekAreaInsets

* [iOS] Fix peek area insets update on CarouselView

* [iOS,Core] Remove extra scroll code update

* [iOS] Fix bug ScrollAnimationEnded missing

* [Core] Mark BPK as private

* [Core] Rename NumberOfSideItems

* Update ItemsViewRenderer.cs

* [Android] Remove scroll direction update

* First small UI tests

* [iOS] Carousel Apply suggestions from code review

Co-Authored-By: Samantha Houts <samhouts@users.noreply.github.com>

* More UI tests and plumbing

* Fix build errors

* [Android] Fix CarouselView sizing on Android

* Implemented IsSwipeEnabled iOS

* Implemented bounce iOS

* Merged with scroll changes ItemsView

* Implemented IsBounceEnabled Android

* [Android] Update position

* Update App.cs

* Added CarouselView Core Gallery sample

* Update ItemsViewController.cs

* Fixed Core Gallery problems with Linker

* Added more CarouselView properties to the Core Gallery sample

* Added new CarouselView sample adding and removing items, etc.

* [Android]Add spacing inset for fist and last item

* [Android] ScrollTo and center item on carousel

* Spelling and not breaking build

* [Android]Use SnapHelper to get centered view

* Make Position work (again) for iOS

* Rebase from master (fixed conflicts)
Fixed Android bug related with the first item inset calcs.
fixes #4996
2019-08-29 16:26:23 -07:00
Edwin Wachs 7a9b54dae9 [UWP] Multi-window (#2432)
* Changes to support multiple windows on UWP

* Locker on Layout.cs to prevent concurrency

* Changes on UnitTests to work with multi-window

* implemented Xamarin.Forms.Core and UAP Element.Dispatcher

* Implementation on each platform

* Implementation on each platform

* Improved Element casting for Dispatcher utilization

* Correction of the items presented in the code review

* Control Gallery for Multiple Window and Code Review

* [UnitTests]Add missing file

* Correction for Unit Tests

* Correction for Unit Tests

* Correction for Unit Tests - Removed ThreadStatic in Ticker

* removed thread static

* removed thread static into application class

* Update Control Gallery

* Code Review (Changes)

* Comment

* Adjust StackOverflow when close the app

* Performace improvements

* - fix merge and ui test performance

* Name of method and adjust on NavigationProxy

* Adjustments in the implementation of the DispatcherManager

* Updated the ListProxy method and adjust the initialization of dispacther on page.

* Remove GetDispacther method from IPlatformServices and some adjusments of code review.

* Adjust after merge on NavigationProxy

* Register IDispatcherProvider on Xamarin.Forms.Core.UnitTests

* Adjustments for correct unit tests operation

* Adjustments for correct unit tests operation

* remove spaces

* Adjust for UITests

* Remove IsInvokeRequired and adjusted de instance of s_resolutionList

* Remove lock() on ResolveLayoutChanges method

* Make IDispatcher implementations internal

* Removed Dispatcher association from Element and Page class. Removed Child Assignment in Element Class and ThreadStatic Removal from NavigationProxy Property

* Remove DispatcherManager; contain thread static to UWP implementation

* Make dispatcher lazy

* MockDispatcherProvider on Xaml.UnitTests

* Add mock Dispatcher and DispatcherProvider for XAML unit tests

* Revert "Add mock Dispatcher and DispatcherProvider for XAML unit tests"

This reverts commit 134320d348.

* Add MockDispactcherProvider on Pager.UnitTests

* Revert covariance change

* Centralize dispatcher checking logic

* Add a fallback dispatcher for platforms without a registered DispatcherProvider

* Remove Dispatcher/DispatcherProvider from project

* Allow UI test pages which use ListProxy to get a dispatcher in UITest mode

* Prevent crash instantiating UITest version of Issue2004

* Removed unnecessary old codes

* Clean up whitespace changes

* Remove unused method
2019-08-15 11:36:38 -06:00
Shane Neuville cd3d7afefc Revert "[Tests]Update to Xamarin.UITest 3.0 and NUnit 3.0 (#6332)" (#7021)
This reverts commit fbebbfc516.
2019-07-31 12:08:17 +02:00
Rui Marinho fbebbfc516
[Tests]Update to Xamarin.UITest 3.0 and NUnit 3.0 (#6332)
* [UITests]Update to Xamarin.UITest 3.0

* [Tests] Move tests to Xamarin.UITests and NUnit 3.0

* [UITests] Use OneTimeSetUp

* suppress CS0436
2019-07-25 10:26:34 +01:00
Samantha Houts 9c016208c6 Merge branch '4.2.0' 2019-07-17 20:06:02 -07:00
Keith Dahlby ef4990bce6 [Core] Missing await in Device.InvokeOnMainThreadAsync(Func<Task>) (#6718)
* [Core] Use local functions

* [Core] Extract DeviceUnitTests

* [Core] Ensure actually called from main thread

* [Core] Add InvokeOnMainThread tests

WithAsyncTask is expected to fail.

* [Core] Rename local wrapper functions

* [Core] Avoid ambiguous call

CS0121: The call is ambiguous between the following methods or
properties: 'Device.InvokeOnMainThreadAsync(Action)' and
'Device.InvokeOnMainThreadAsync(Func<Task>)'

https://github.com/dotnet/roslyn/issues/14885
https://github.com/dotnet/csharplang/issues/98
2019-07-16 09:20:10 +02:00
Peter Moore fa853ff823 RelativeSource Binding (#4375)
RelativeSource Binding

- fixes #3847

Implement RelativeSource binding modes for Self, TemplatedParent, and FindAncestor. Add unit tests. Pare down TemplateBinding class to use RelativeSource binding mechanism.

* Include RelativeSource member in Binding.Clone

* Fix issue of unit tests being tricked by async in Binding.Apply; permit "Source={RelativeSource...}" in addition to "RelativeSource={RelativeSource..."; allow FindAncestor relative binding source mode to be based on BindingContext type or control type

* Fix unit test wasn't actually testing "Source={RelativeSource...}" syntax.

* Address @StephaneDelcroix's comments. Make FindAncestor relative source binding work even when the ancestor changes.

* Much better mechanism for detecting when a parent changes for relativesource

* Cleanup

* more cleanup

* more cleanup

* Remove async/await for identifying templated parent and ancestor type binding source

* Remove unused code; fix linting

* Update Xamarin.Forms.Core/Binding.cs

Co-Authored-By: Stephane Delcroix <stephane@delcroix.org>

* Update Xamarin.Forms.Core/Binding.cs

Co-Authored-By: Stephane Delcroix <stephane@delcroix.org>

* Update Xamarin.Forms.Core/Binding.cs

Co-Authored-By: Stephane Delcroix <stephane@delcroix.org>

* Update Xamarin.Forms.Core/BindingExpression.cs

Co-Authored-By: Stephane Delcroix <stephane@delcroix.org>

* Update Xamarin.Forms.Core/BindingExpression.cs

Co-Authored-By: Stephane Delcroix <stephane@delcroix.org>

* Update Xamarin.Forms.Core/Binding.cs

Co-Authored-By: Stephane Delcroix <stephane@delcroix.org>

* Ensure TemplateBinding works correctly when reparenting. Cleanup.

* Finish addressing comments; linting cleanup

* Remove private modifier where unneeded
2019-07-09 12:10:13 +02:00
Shane Neuville 490be76aab Shell lifecycle (#6527)
* shell appearing and disappearing events

* life cycle UI tests and fixes

* - fix appearing on shell content to only fire when page gets created
- fix navigated to only fire after shell content is appearing

* OnNavigatedOnlyFiresOnce
fixes #6486
2019-07-03 16:53:45 -07:00
Shane Neuville 5b284b4d76
Checkbox (#6232)
* Add CheckBox class and Renderer

* Add CheckBoxCell class

* Add Control Gallery for CheckBox and CheckBoxCell.
Add stubs only for Android for now.

* Update to fast renderer for Android, Implement Checked and Unchecked Colors!

* Initial UWP implementation, no colors yet.

* Add iOS implementation for checkbox. It's not pretty, but it is a start!

* Updates from Frank

* Code cleanup with frank

* Finalize iOS checkbox!!! it is a circle!

* Fix WPF build and Add a checkbox!!!

* Cell Renderers and macOS

* UWP switchcell

* Update CheckBox Cell on ios/android with colors

* Remove all instances of CheckBoxCell per demand

* Added UITests and UnitTests

* Changed colors to TintColor which makes sense. Added a IsChecked visual state property and a sample!

* checkbox cleanup, tint color fixes, and material

* uwp fix when changing TintBrush

* add checkbox to visual controls page

* formatting fix

* formatting fix

* formatting fix

* convert to tabs

* formatting

* checkbox tabs

* roll back formatting changes to WPFResources

* android renderer overrides

* uwp fix and sizing fix ios

* mask checkbox

* use a single image for ios inatead of always drawing new ones

* wpf fix

* rename to color and add css interfaces

* missing wpf file

* designer hack

* fix wpf for ios builds

* assembly info

* fix default tint color and infinite crash

* [iOS] fixes change checked state from control
simplification
added to dynamic galery

* [iOS material] fix crash when dispose

* [UWP, WPF] fix vertical alignment

* [Android] fixes does not change size when the reduction HeightRequest

* Update Xamarin.Forms.Material.iOS/MaterialCheckboxRenderer.cs

Co-Authored-By: Samantha Houts <samhouts@users.noreply.github.com>

* [Android] TabStop support

* alphabetize gallery, fix color update when disabled, unsubscribe from event in dispose

* cleanup assembly info

* fix assembly attributes

* remove assembly info

* pr comments

* couple of more dispose fixes

* One Last Dispose

* fix api 19 call to ClipToOutline
2019-05-30 10:32:28 -06:00
Rui Marinho f8fd2811dc
Merge branch '4.0.0' 2019-05-22 22:32:28 +01:00
Rui Marinho 38711f35d0
Merge branch '3.6.0' into 4.0.0 2019-05-22 16:23:05 +01:00