summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.nuget/packages/Mono.Cecil.0.10.0-beta2.nupkgbin687828 -> 0 bytes
-rw-r--r--.nuspec/Xamarin.Forms.Maps.nuspec15
-rw-r--r--.nuspec/Xamarin.Forms.nuspec14
-rw-r--r--Xamarin.Forms.Build.Tasks/CompiledConverters/ListStringTypeConverter.cs41
-rw-r--r--Xamarin.Forms.Build.Tasks/CompiledValueProviders/SetterValueProvider.cs2
-rw-r--r--Xamarin.Forms.Build.Tasks/CompiledValueProviders/TriggerValueProvider.cs2
-rw-r--r--Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs17
-rw-r--r--Xamarin.Forms.Build.Tasks/ExpandMarkupsVisitor.cs18
-rw-r--r--Xamarin.Forms.Build.Tasks/SetFieldVisitor.cs18
-rw-r--r--Xamarin.Forms.Build.Tasks/SetNamescopesAndRegisterNamesVisitor.cs18
-rw-r--r--Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs25
-rw-r--r--Xamarin.Forms.Build.Tasks/SetResourcesVisitor.cs22
-rw-r--r--Xamarin.Forms.Build.Tasks/TypeReferenceExtensions.cs6
-rw-r--r--Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj1
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj1
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/coffee.pngbin490 -> 0 bytes
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla25979.cs6
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26501.cs2
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26993.cs3
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29257.cs24
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30353.cs47
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31330.cs2
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31333.cs12
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32206.cs142
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36171.cs3
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39489.cs4
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39530.cs9
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40173.cs3
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40704.cs3
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41619.cs62
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43783.cs30
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43867.cs49
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43941.cs136
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs12
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs4
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue206.cs2
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2272.cs3
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2411.cs6
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs110
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems5
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs145
-rw-r--r--Xamarin.Forms.Controls/ControlGalleryPages/ToolbarItems.cs34
-rw-r--r--Xamarin.Forms.Controls/CoreGallery.cs10
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/MacOSTestGallery.cs401
-rw-r--r--Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj713
-rw-r--r--Xamarin.Forms.Core.UnitTests/ButtonUnitTest.cs28
-rw-r--r--Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs75
-rw-r--r--Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs193
-rw-r--r--Xamarin.Forms.Core.UnitTests/RelativeLayoutTests.cs41
-rw-r--r--Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs14
-rw-r--r--Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj3
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs46
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs164
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs9
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs3
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs4
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs3
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs2
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs5
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs3
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs3
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs126
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs29
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/UITestCategories.cs1
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs9
-rw-r--r--Xamarin.Forms.Core/Accessibility.cs14
-rw-r--r--Xamarin.Forms.Core/Button.cs21
-rw-r--r--Xamarin.Forms.Core/ConcurrentDictionary.cs (renamed from Xamarin.Forms.Platform.WP8/ConcurrentDictionary.cs)0
-rw-r--r--Xamarin.Forms.Core/Device.cs9
-rw-r--r--Xamarin.Forms.Core/IButtonController.cs2
-rw-r--r--Xamarin.Forms.Core/INavigationPageController.cs4
-rw-r--r--Xamarin.Forms.Core/ListStringTypeConverter.cs1
-rw-r--r--Xamarin.Forms.Core/ListView.cs2
-rw-r--r--Xamarin.Forms.Core/MessagingCenter.cs89
-rw-r--r--Xamarin.Forms.Core/NavigationPage.cs72
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/ExtensionPoints.cs1
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabbedPage.cs50
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabsStyle.cs12
-rw-r--r--Xamarin.Forms.Core/Properties/AssemblyInfo.cs5
-rw-r--r--Xamarin.Forms.Core/RelativeLayout.cs62
-rw-r--r--Xamarin.Forms.Core/ResourceDictionary.cs2
-rw-r--r--Xamarin.Forms.Core/SplitOrderedList.cs (renamed from Xamarin.Forms.Platform.WP8/SplitOrderedList.cs)0
-rw-r--r--Xamarin.Forms.Core/TargetPlatform.cs2
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj10
-rw-r--r--Xamarin.Forms.Maps.iOS/FormsMaps.cs18
-rw-r--r--Xamarin.Forms.Maps.iOS/GeocoderBackend.cs35
-rw-r--r--Xamarin.Forms.Maps.iOS/MapPool.cs4
-rw-r--r--Xamarin.Forms.Maps.iOS/MapRenderer.cs88
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Maps/Properties/AssemblyInfo.cs7
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs38
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs9
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/IVisualElementRenderer.cs3
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs26
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/EditorEditText.cs13
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/EntryEditText.cs13
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/MasterDetailRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ScrollViewRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/SearchBarRenderer.cs20
-rw-r--r--Xamarin.Forms.Platform.Android/ViewRenderer.cs99
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementExtensions.cs12
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementRenderer.cs77
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.UAP/NavigationPageRendererUWP.cs97
-rw-r--r--Xamarin.Forms.Platform.UAP/PlatformUWP.cs257
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs7
-rw-r--r--Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj2
-rw-r--r--Xamarin.Forms.Platform.WP8/ButtonRenderer.cs13
-rw-r--r--Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj2
-rw-r--r--Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.WinRT.Phone/WindowsPhoneResourcesProvider.cs108
-rw-r--r--Xamarin.Forms.Platform.WinRT.Tablet/TabbedPageRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.WinRT.Tablet/WindowsResourcesProvider.cs67
-rw-r--r--Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs16
-rw-r--r--Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.WinRT/IVisualElementRenderer.cs3
-rw-r--r--Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs28
-rw-r--r--Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs159
-rw-r--r--Xamarin.Forms.Platform.WinRT/NavigationPageRendererWinRT.cs57
-rw-r--r--Xamarin.Forms.Platform.WinRT/Platform.cs461
-rw-r--r--Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs211
-rw-r--r--Xamarin.Forms.Platform.WinRT/SliderRenderer.cs12
-rw-r--r--Xamarin.Forms.Platform.WinRT/ViewRenderer.cs98
-rw-r--r--Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs91
-rw-r--r--Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj4
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs18
-rw-r--r--Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs16
-rw-r--r--Xamarin.Forms.Platform.iOS/Deserializer.cs5
-rw-r--r--Xamarin.Forms.Platform.iOS/EffectUtilities.cs6
-rw-r--r--Xamarin.Forms.Platform.iOS/ElementChangedEventArgs.cs8
-rw-r--r--Xamarin.Forms.Platform.iOS/EventTracker.cs110
-rw-r--r--Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs12
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/ColorExtensions.cs47
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/DateExtensions.cs5
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/LayoutExtensions.cs21
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/PlatformConfigurationExtensions.cs11
-rw-r--r--Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs45
-rw-r--r--Xamarin.Forms.Platform.iOS/Forms.cs60
-rw-r--r--Xamarin.Forms.Platform.iOS/IVisualElementRenderer.cs13
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs13
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeViewPropertyListener.cs7
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs12
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeViewWrapperRenderer.cs30
-rw-r--r--Xamarin.Forms.Platform.iOS/PlatformEffect.cs9
-rw-r--r--Xamarin.Forms.Platform.iOS/RendererPool.cs8
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs25
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs108
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs35
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs114
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs153
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.iOS/ResourcesProvider.cs16
-rw-r--r--Xamarin.Forms.Platform.iOS/ViewInitializedEventArgs.cs9
-rw-r--r--Xamarin.Forms.Platform.iOS/ViewRenderer.cs109
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementPackager.cs10
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs145
-rw-r--r--Xamarin.Forms.Platform.iOS/VisualElementTracker.cs61
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml3
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs9
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz27863.xaml.cs13
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz27968.xaml.cs13
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml9
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs46
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml24
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml.cs51
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml21
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml.cs48
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml4
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml.cs58
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml12
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml.cs48
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml9
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml.cs58
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml14
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml.cs55
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml14
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml.cs140
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml17
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml.cs54
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj30
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs1
-rw-r--r--Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs55
-rw-r--r--Xamarin.Forms.Xaml/CreateValuesVisitor.cs18
-rw-r--r--Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs18
-rw-r--r--Xamarin.Forms.Xaml/FillResourceDictionariesVisitor.cs18
-rw-r--r--Xamarin.Forms.Xaml/MarkupExtensions/StaticResourceExtension.cs2
-rw-r--r--Xamarin.Forms.Xaml/NamescopingVisitor.cs18
-rw-r--r--Xamarin.Forms.Xaml/PruneIgnoredNodesVisitor.cs15
-rw-r--r--Xamarin.Forms.Xaml/RegisterXNamesVisitor.cs18
-rw-r--r--Xamarin.Forms.Xaml/TypeConversionExtensions.cs4
-rw-r--r--Xamarin.Forms.Xaml/XamlNode.cs123
-rw-r--r--Xamarin.Forms.Xaml/XamlNodeVisitor.cs24
-rw-r--r--Xamarin.Forms.Xaml/XamlParser.cs6
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration.macOSSpecific/TabbedPage.xml176
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration/macOS.xml35
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml91
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/Button.xml70
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml15
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/IButtonController.xml32
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml205
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/INavigationPageController.xml52
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml229
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/NavigationPage.xml96
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/OnIdiom`1.xml17
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/RelativeLayout.xml84
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/TabsStyle.xml87
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/TargetIdiom.xml14
-rw-r--r--docs/Xamarin.Forms.Core/index.xml115
-rw-r--r--docs/Xamarin.Forms.Core/ns-Xamarin.Forms.PlatformConfiguration.macOSSpecific.xml6
-rw-r--r--docs/Xamarin.Forms.Maps/index.xml2
-rw-r--r--verify-nuspecs.ps1130
219 files changed, 2098 insertions, 7181 deletions
diff --git a/.gitignore b/.gitignore
index dd726ad5..f69592b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,4 +46,4 @@ Xamarin.Forms.Controls/secrets.txt
Xamarin.Forms.Controls/controlgallery.config
Xamarin.Forms.ControlGallery.Android/Properties/MapsKey.cs
*.tss
-*.bak
+*.bak \ No newline at end of file
diff --git a/.nuget/packages/Mono.Cecil.0.10.0-beta2.nupkg b/.nuget/packages/Mono.Cecil.0.10.0-beta2.nupkg
deleted file mode 100644
index 3ffbbcfc..00000000
--- a/.nuget/packages/Mono.Cecil.0.10.0-beta2.nupkg
+++ /dev/null
Binary files differ
diff --git a/.nuspec/Xamarin.Forms.Maps.nuspec b/.nuspec/Xamarin.Forms.Maps.nuspec
index 7221c1c7..9e7aef47 100644
--- a/.nuspec/Xamarin.Forms.Maps.nuspec
+++ b/.nuspec/Xamarin.Forms.Maps.nuspec
@@ -30,7 +30,7 @@
</group>
</dependencies>
<references>
- <group targetFramework="portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20">
+ <group targetFramework="portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10">
<reference file="Xamarin.Forms.Maps.dll" />
</group>
<group targetFramework="Xamarin.iOS10">
@@ -56,16 +56,11 @@
<reference file="Xamarin.Forms.Maps.dll" />
<reference file="Xamarin.Forms.Maps.WP8.dll" />
</group>
- <group targetFramework="Xamarin.Mac">
- <reference file="Xamarin.Forms.Maps.dll" />
- <reference file="Xamarin.Forms.Maps.macOS.dll" />
- <reference file="Xamarin.Forms.Maps.MacOS.Extra.dll" />
- </group>
</references>
</metadata>
<files>
- <file src="..\Xamarin.Forms.Maps\bin\$Configuration$\Xamarin.Forms.Maps.dll" target="lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20" />
- <file src="..\docs\Xamarin.Forms.Maps.xml" target="lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20" />
+ <file src="..\Xamarin.Forms.Maps\bin\$Configuration$\Xamarin.Forms.Maps.dll" target="lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10" />
+ <file src="..\docs\Xamarin.Forms.Maps.xml" target="lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10" />
<file src="..\Xamarin.Forms.Maps.Android\bin\$Configuration$\Xamarin.Forms.Maps.Android.dll" target="lib\MonoAndroid10" />
<file src="..\Xamarin.Forms.Maps\bin\$Configuration$\Xamarin.Forms.Maps.dll" target="lib\MonoAndroid10" />
@@ -132,10 +127,6 @@
<file src="..\Xamarin.Forms.Maps.Design\bin\$Configuration$\Xamarin.Forms.Maps.Design.dll" target="lib\win81\Design" />
<file src="..\Xamarin.Forms.Maps.Design\bin\$Configuration$\Xamarin.Forms.Maps.Design.dll" target="lib\uap10.0\Design" />
- <file src="..\Xamarin.Forms.Maps.MacOS\bin\$Configuration$\Xamarin.Forms.Maps.macOS.dll" target="lib\Xamarin.Mac" />
- <file src="..\Xamarin.Forms.Maps.MacOS\bin\$Configuration$\Xamarin.Forms.Maps.MacOS.Extra.dll" target="lib\Xamarin.Mac" />
- <file src="..\Xamarin.Forms.Maps\bin\$Configuration$\Xamarin.Forms.Maps.dll" target="lib\Xamarin.Mac" />
- <file src="..\docs\Xamarin.Forms.Maps.xml" target="lib\Xamarin.Mac" />
</files>
</package>
diff --git a/.nuspec/Xamarin.Forms.nuspec b/.nuspec/Xamarin.Forms.nuspec
index fa933839..ce123806 100644
--- a/.nuspec/Xamarin.Forms.nuspec
+++ b/.nuspec/Xamarin.Forms.nuspec
@@ -76,12 +76,6 @@
<reference file="Xamarin.Forms.Xaml.dll" />
<reference file="Xamarin.Forms.Platform.WP8.dll" />
</group>
- <group targetFramework="Xamarin.Mac">
- <reference file="Xamarin.Forms.Core.dll" />
- <reference file="Xamarin.Forms.Platform.macOS.dll" />
- <reference file="Xamarin.Forms.Platform.dll" />
- <reference file="Xamarin.Forms.Xaml.dll" />
- </group>
</references>
</metadata>
<files>
@@ -225,16 +219,10 @@
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\PageControl.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\Resources.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\FormsTextBoxStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
- <file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\AutoSuggestStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
+ <file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\AutoSuggestStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\MasterDetailControlStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\PageControlStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\TabbedPageStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
-
- <!--Mac-->
- <file src="..\Xamarin.Forms.Core\bin\$Configuration$\Xamarin.Forms.Core.dll" target="lib\Xamarin.Mac" />
- <file src="..\Xamarin.Forms.Xaml\bin\$Configuration$\Xamarin.Forms.Xaml.dll" target="lib\Xamarin.Mac" />
- <file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\Xamarin.Forms.Platform.macOS.dll" target="lib\Xamarin.Mac" />
- <file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\Xamarin.Forms.Platform.dll" target="lib\Xamarin.Mac" />
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\Xamarin.Forms.Core.dll" target="lib\uap10.0" />
<file src="..\docs\Xamarin.Forms.Core.xml" target="lib\uap10.0" />
diff --git a/Xamarin.Forms.Build.Tasks/CompiledConverters/ListStringTypeConverter.cs b/Xamarin.Forms.Build.Tasks/CompiledConverters/ListStringTypeConverter.cs
deleted file mode 100644
index 3f1c0569..00000000
--- a/Xamarin.Forms.Build.Tasks/CompiledConverters/ListStringTypeConverter.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-using Xamarin.Forms.Xaml;
-using Xamarin.Forms.Build.Tasks;
-
-namespace Xamarin.Forms.Core.XamlC
-{
- class ListStringTypeConverter : ICompiledTypeConverter
- {
- public IEnumerable<Instruction> ConvertFromString(string value, ModuleDefinition module, BaseNode node)
- {
- if (value == null) {
- yield return Instruction.Create(OpCodes.Ldnull);
- yield break;
- }
- var parts = value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
-
- var listCtor = module.ImportReference(typeof(List<>)).Resolve().Methods.FirstOrDefault(md => md.IsConstructor && md.Parameters.Count == 1 && md.Parameters[0].ParameterType.FullName == "System.Int32");
- var listCtorRef = module.ImportReference(listCtor);
- listCtorRef = module.ImportReference(listCtorRef.ResolveGenericParameters(module.ImportReference(typeof(List<string>)), module));
-
- var adder = module.ImportReference(typeof(ICollection<>)).Resolve().Methods.FirstOrDefault(md => md.Name == "Add" && md.Parameters.Count == 1);
- var adderRef = module.ImportReference(adder);
- adderRef = module.ImportReference(adderRef.ResolveGenericParameters(module.ImportReference(typeof(ICollection<string>)), module));
-
- yield return Instruction.Create(OpCodes.Ldc_I4, parts.Count);
- yield return Instruction.Create(OpCodes.Newobj, listCtorRef);
-
- foreach (var part in parts) {
- yield return Instruction.Create(OpCodes.Dup);
- yield return Instruction.Create(OpCodes.Ldstr, part);
- yield return Instruction.Create(OpCodes.Callvirt, adderRef);
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Build.Tasks/CompiledValueProviders/SetterValueProvider.cs b/Xamarin.Forms.Build.Tasks/CompiledValueProviders/SetterValueProvider.cs
index e2d74884..e8bca7c1 100644
--- a/Xamarin.Forms.Build.Tasks/CompiledValueProviders/SetterValueProvider.cs
+++ b/Xamarin.Forms.Build.Tasks/CompiledValueProviders/SetterValueProvider.cs
@@ -44,4 +44,4 @@ namespace Xamarin.Forms.Core.XamlC
yield return Instruction.Create(OpCodes.Callvirt, setValueRef);
}
}
-}
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Build.Tasks/CompiledValueProviders/TriggerValueProvider.cs b/Xamarin.Forms.Build.Tasks/CompiledValueProviders/TriggerValueProvider.cs
index 35b4adc1..6b4f0b6b 100644
--- a/Xamarin.Forms.Build.Tasks/CompiledValueProviders/TriggerValueProvider.cs
+++ b/Xamarin.Forms.Build.Tasks/CompiledValueProviders/TriggerValueProvider.cs
@@ -44,4 +44,4 @@ namespace Xamarin.Forms.Core.XamlC
yield return Instruction.Create(OpCodes.Callvirt, setValueRef);
}
}
-}
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs b/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs
index b73926fd..c684e512 100644
--- a/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs
+++ b/Xamarin.Forms.Build.Tasks/CreateObjectVisitor.cs
@@ -21,11 +21,20 @@ namespace Xamarin.Forms.Build.Tasks
ModuleDefinition Module { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.BottomUp;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return true; }
+ }
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Build.Tasks/ExpandMarkupsVisitor.cs b/Xamarin.Forms.Build.Tasks/ExpandMarkupsVisitor.cs
index ff83de7a..e647f6c2 100644
--- a/Xamarin.Forms.Build.Tasks/ExpandMarkupsVisitor.cs
+++ b/Xamarin.Forms.Build.Tasks/ExpandMarkupsVisitor.cs
@@ -24,10 +24,20 @@ namespace Xamarin.Forms.Build.Tasks
ILContext Context { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.BottomUp;
- public bool StopOnDataTemplate => false;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => true;
+ public bool VisitChildrenFirst
+ {
+ get { return true; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return false; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Build.Tasks/SetFieldVisitor.cs b/Xamarin.Forms.Build.Tasks/SetFieldVisitor.cs
index 9a5b7444..1839cf7b 100644
--- a/Xamarin.Forms.Build.Tasks/SetFieldVisitor.cs
+++ b/Xamarin.Forms.Build.Tasks/SetFieldVisitor.cs
@@ -13,10 +13,20 @@ namespace Xamarin.Forms.Build.Tasks
public ILContext Context { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return false; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Build.Tasks/SetNamescopesAndRegisterNamesVisitor.cs b/Xamarin.Forms.Build.Tasks/SetNamescopesAndRegisterNamesVisitor.cs
index 1c776ab8..d810bd80 100644
--- a/Xamarin.Forms.Build.Tasks/SetNamescopesAndRegisterNamesVisitor.cs
+++ b/Xamarin.Forms.Build.Tasks/SetNamescopesAndRegisterNamesVisitor.cs
@@ -16,10 +16,20 @@ namespace Xamarin.Forms.Build.Tasks
ILContext Context { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return false; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs b/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs
index 235115d6..c93c14f2 100644
--- a/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs
+++ b/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs
@@ -37,9 +37,8 @@ namespace Xamarin.Forms.Build.Tasks
public ILContext Context { get; }
public bool StopOnResourceDictionary { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.BottomUp;
- public bool StopOnDataTemplate => true;
- public bool VisitNodeOnDataTemplate => true;
+ public bool VisitChildrenFirst { get; } = true;
+ public bool StopOnDataTemplate { get; } = true;
ModuleDefinition Module { get; }
@@ -89,11 +88,6 @@ namespace Xamarin.Forms.Build.Tasks
if ((propertyName != XmlName.Empty || TryGetPropertyName(node, parentNode, out propertyName)) && skips.Contains(propertyName))
return;
- if (propertyName == XmlName._CreateContent) {
- SetDataTemplate((IElementNode)parentNode, node, Context, node);
- return;
- }
-
//if this node is an IMarkupExtension, invoke ProvideValue() and replace the variable
var vardef = Context.Variables[node];
var vardefref = new VariableDefinitionReference(vardef);
@@ -120,15 +114,18 @@ namespace Xamarin.Forms.Build.Tasks
return;
if (parentNode is IElementNode && ((IElementNode)parentNode).SkipProperties.Contains (propertyName))
return;
-
- Context.IL.Append(SetPropertyValue(Context.Variables[(IElementNode)parentNode], propertyName, node, Context, node));
+
+ if (propertyName == XmlName._CreateContent)
+ SetDataTemplate((IElementNode)parentNode, node, Context, node);
+ else
+ Context.IL.Append(SetPropertyValue(Context.Variables[(IElementNode)parentNode], propertyName, node, Context, node));
}
else if (IsCollectionItem(node, parentNode) && parentNode is IElementNode)
{
// Collection element, implicit content, or implicit collection element.
string contentProperty;
var parentVar = Context.Variables[(IElementNode)parentNode];
- if (parentVar.VariableType.ImplementsInterface(Module.ImportReference(typeof (IEnumerable))) && parentVar.VariableType.GetMethods(md => md.Name == "Add" && md.Parameters.Count == 1, Module).Any())
+ if (parentVar.VariableType.ImplementsInterface(Module.ImportReference(typeof (IEnumerable))))
{
var elementType = parentVar.VariableType;
if (elementType.FullName != "Xamarin.Forms.ResourceDictionary" && elementType.Resolve().BaseType.FullName != "Xamarin.Forms.ResourceDictionary")
@@ -152,8 +149,7 @@ namespace Xamarin.Forms.Build.Tasks
if (parentNode is IElementNode && ((IElementNode)parentNode).SkipProperties.Contains (propertyName))
return;
Context.IL.Append(SetPropertyValue(Context.Variables[(IElementNode)parentNode], name, node, Context, node));
- } else
- throw new XamlParseException($"Can not set the content of {((IElementNode)parentNode).XmlType.Name} as it doesn't have a ContentPropertyAttribute", node);
+ }
}
else if (IsCollectionItem(node, parentNode) && parentNode is ListNode)
{
@@ -725,7 +721,7 @@ namespace Xamarin.Forms.Build.Tasks
if (CanAdd(parent, localName, valueNode, context))
return Add(parent, localName, valueNode, iXmlLineInfo, context);
- throw new XamlParseException($"No property, bindable property, or event found for '{localName}', or mismatching type between value and property.", iXmlLineInfo);
+ throw new XamlParseException($"No property, bindable property, or event found for '{localName}'", iXmlLineInfo);
}
static FieldReference GetBindablePropertyReference(VariableDefinition parent, string namespaceURI, ref string localName, out bool attached, ILContext context, IXmlLineInfo iXmlLineInfo)
@@ -846,7 +842,6 @@ namespace Xamarin.Forms.Build.Tasks
{
var module = context.Body.Method.Module;
var varValue = context.Variables [elementNode];
- var implicitOperator = varValue.VariableType.GetImplicitOperatorTo(module.Import(typeof(BindingBase)), module);
//TODO: check if parent is a BP
var setBinding = typeof(BindableObject).GetMethod("SetBinding", new [] { typeof(BindableProperty), typeof(BindingBase) });
diff --git a/Xamarin.Forms.Build.Tasks/SetResourcesVisitor.cs b/Xamarin.Forms.Build.Tasks/SetResourcesVisitor.cs
index c5be1fbd..f046efcb 100644
--- a/Xamarin.Forms.Build.Tasks/SetResourcesVisitor.cs
+++ b/Xamarin.Forms.Build.Tasks/SetResourcesVisitor.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;
@@ -19,15 +20,26 @@ namespace Xamarin.Forms.Build.Tasks
ModuleDefinition Module { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return false; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
XmlName propertyName;
- if (!SetPropertiesVisitor.TryGetPropertyName(node, parentNode, out propertyName)) {
+ if (!SetPropertiesVisitor.TryGetPropertyName(node, parentNode, out propertyName))
+ {
if (!IsCollectionItem(node, parentNode))
return;
string contentProperty;
diff --git a/Xamarin.Forms.Build.Tasks/TypeReferenceExtensions.cs b/Xamarin.Forms.Build.Tasks/TypeReferenceExtensions.cs
index f862de3e..3b69bfd5 100644
--- a/Xamarin.Forms.Build.Tasks/TypeReferenceExtensions.cs
+++ b/Xamarin.Forms.Build.Tasks/TypeReferenceExtensions.cs
@@ -157,7 +157,7 @@ namespace Xamarin.Forms.Build.Tasks
var typeDef = typeRef.Resolve();
if (TypeRefComparer.Default.Equals(typeDef, baseClass.Resolve()))
return true;
- if (typeDef.Interfaces.Any(ir => TypeRefComparer.Default.Equals(ir.InterfaceType.ResolveGenericParameters(typeRef), baseClass)))
+ if (typeDef.Interfaces.Any(ir => TypeRefComparer.Default.Equals(ir.InterfaceType, baseClass)))
return true;
if (typeDef.BaseType == null)
return false;
@@ -257,8 +257,10 @@ namespace Xamarin.Forms.Build.Tasks
var returnType = castDef.ReturnType;
if (returnType.IsGenericParameter)
returnType = ((GenericInstanceType)opDeclTypeRef).GenericArguments [((GenericParameter)returnType).Position];
- if (returnType.InheritsFromOrImplements(toType))
+ if (returnType.FullName == toType.FullName &&
+ cast.Parameters [0].ParameterType.Name == fromType.Name) {
return castDef;
+ }
}
}
return null;
diff --git a/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj b/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj
index 3a2929ea..6424c930 100644
--- a/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj
+++ b/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj
@@ -109,7 +109,6 @@
<Compile Include="CompiledValueProviders\ICompiledValueProvider.cs" />
<Compile Include="CompiledValueProviders\TriggerValueProvider.cs" />
<Compile Include="CompiledValueProviders\PassthroughValueProvider.cs" />
- <Compile Include="CompiledConverters\ListStringTypeConverter.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
diff --git a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
index f512352a..3eeb9484 100644
--- a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
+++ b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
@@ -291,7 +291,6 @@
<BundleResource Include="Resources\twitternav.png" />
<BundleResource Include="Resources\twitternav%402x.png" />
<BundleResource Include="Resources\xamarinlogo.png" />
- <BundleResource Include="coffee.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="AdvancedColorPicker">
diff --git a/Xamarin.Forms.ControlGallery.iOS/coffee.png b/Xamarin.Forms.ControlGallery.iOS/coffee.png
deleted file mode 100644
index 350257c0..00000000
--- a/Xamarin.Forms.ControlGallery.iOS/coffee.png
+++ /dev/null
Binary files differ
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla25979.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla25979.cs
index 08b6f8a6..dc07c04b 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla25979.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla25979.cs
@@ -115,17 +115,11 @@ namespace Xamarin.Forms.Controls.Issues
RunningApp.Screenshot ("At page one");
RunningApp.WaitForElement (q => q.Marked ("PageOneButtonId"));
RunningApp.Tap (q => q.Marked ("PageOneButtonId"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("PageTwoId"));
RunningApp.Screenshot ("At page two - I didn't crash");
RunningApp.WaitForElement (q => q.Marked ("PageTwoButtonId"));
RunningApp.Tap (q => q.Marked ("PageTwoButtonId"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("PageThreeId"));
RunningApp.Screenshot ("At page three - I didn't crash");
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26501.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26501.cs
index b2f13b0a..56ccec81 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26501.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26501.cs
@@ -136,7 +136,7 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST
[Test]
- public void TestCellsShowAfterRefresh()
+ public void TestCellsShowAfterRefresh ()
{
RunningApp.Tap (q => q.Marked ("Refresh"));
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26993.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26993.cs
index 77081ccc..5ba0de11 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26993.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26993.cs
@@ -87,9 +87,6 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST
[Test]
-#if __MACOS__
- [Ignore("Webview query is not implemented yet on UITEst desktop")]
-#endif
public void Bugzilla26993Test ()
{
RunningApp.Screenshot ("I am at BZ26993");
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29257.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29257.cs
index a05be9fb..35503f9c 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29257.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29257.cs
@@ -81,42 +81,18 @@ namespace Xamarin.Forms.Controls.Issues
public void Bugzilla29257Test ()
{
RunningApp.Tap (q => q.Marked ("Page 1"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("This is page 1"));
RunningApp.Back ();
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.Tap (q => q.Marked ("Page 2"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("This is page 2"));
RunningApp.Back ();
RunningApp.Tap (q => q.Marked ("Page 3"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("This is page 3"));
RunningApp.Back ();
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.Tap (q => q.Marked ("Page 4"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("This is page 4"));
RunningApp.Back ();
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.Tap (q => q.Marked ("Page 5"));
-#if __MACOS__
- System.Threading.Thread.Sleep(2000);
-#endif
RunningApp.WaitForElement (q => q.Marked ("This is page 5"));
}
#endif
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30353.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30353.cs
index 3738c7e8..cde2fad5 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30353.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30353.cs
@@ -10,69 +10,62 @@ using NUnit.Framework;
namespace Xamarin.Forms.Controls.Issues
{
- [Preserve(AllMembers = true)]
- [Issue(IssueTracker.Bugzilla, 30353, "MasterDetailPage.IsPresentedChanged is not raised")]
+ [Preserve (AllMembers = true)]
+ [Issue (IssueTracker.Bugzilla, 30353, "MasterDetailPage.IsPresentedChanged is not raised")]
public class Bugzilla30353 : TestMasterDetailPage
{
- protected override void Init()
+ protected override void Init ()
{
- var lbl = new Label
- {
+ var lbl = new Label {
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
Text = "Detail"
};
-#if !UITEST
- if (App.IOSVersion == 7 || Device.RuntimePlatform == Device.macOS)
- {
+ #if !UITEST
+ if (App.IOSVersion == 7) {
lbl.Text = "Don't run";
}
-#endif
+ #endif
- var lblMaster = new Label
- {
+ var lblMaster = new Label {
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
Text = "Master"
};
- var btn = new Button()
- {
+ var btn = new Button () {
Text = "Toggle"
};
- var btn1 = new Button()
- {
+ var btn1 = new Button () {
Text = "Toggle"
};
btn.Clicked += (object sender, EventArgs e) => IsPresented = !IsPresented;
btn1.Clicked += (object sender, EventArgs e) => IsPresented = !IsPresented;
- var stacklayout = new StackLayout();
- stacklayout.Children.Add(lbl);
- stacklayout.Children.Add(btn);
+ var stacklayout = new StackLayout ();
+ stacklayout.Children.Add (lbl);
+ stacklayout.Children.Add (btn);
- var stacklayout1 = new StackLayout();
- stacklayout1.Children.Add(lblMaster);
- stacklayout1.Children.Add(btn1);
+ var stacklayout1 = new StackLayout ();
+ stacklayout1.Children.Add (lblMaster);
+ stacklayout1.Children.Add (btn1);
- Master = new ContentPage
- {
+ Master = new ContentPage {
Title = "IsPresentedChanged Test",
BackgroundColor = Color.Green,
Content = stacklayout1
};
- Detail = new ContentPage
- {
+ Detail = new ContentPage {
BackgroundColor = Color.Gray,
Content = stacklayout
};
MasterBehavior = MasterBehavior.Popover;
IsPresentedChanged += (s, e) =>
- lblMaster.Text = lbl.Text = string.Format("The Master is now {0}", IsPresented ? "visible" : "invisible");
+ lblMaster.Text = lbl.Text = string.Format ("The Master is now {0}", IsPresented ? "visible" : "invisible");
}
-#if UITEST
+ #if UITEST
[Test]
public void Bugzilla30353Test ()
{
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31330.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31330.cs
index 5ab11a06..75e30b13 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31330.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31330.cs
@@ -127,7 +127,7 @@ namespace Xamarin.Forms.Controls.Issues
}
}
-#if UITEST
+ #if UITEST
[Test]
public void Bugzilla31330Test ()
{
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31333.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31333.cs
index 830982ea..52c9f578 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31333.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31333.cs
@@ -210,9 +210,6 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST
[Test]
-#if __MACOS__
- [Ignore("EnterText on UITest.Desktop not implemented")]
-#endif
[UiTest (typeof(NavigationPage))]
public void Issue31333FocusEntryInListViewCell ()
{
@@ -225,9 +222,6 @@ namespace Xamarin.Forms.Controls.Issues
}
[Test]
-#if __MACOS__
- [Ignore("EnterText on UITest.Desktop not implemented")]
-#endif
[UiTest (typeof(NavigationPage))]
public void Issue31333FocusEditorInListViewCell ()
{
@@ -241,9 +235,6 @@ namespace Xamarin.Forms.Controls.Issues
[Test]
-#if __MACOS__
- [Ignore("EnterText on UITest.Desktop not implemented")]
-#endif
[UiTest (typeof(NavigationPage))]
public void Issue31333FocusEntryInTableViewCell ()
{
@@ -256,9 +247,6 @@ namespace Xamarin.Forms.Controls.Issues
}
[Test]
-#if __MACOS__
- [Ignore("EnterText on UITest.Desktop not implemented")]
-#endif
[UiTest (typeof(NavigationPage))]
public void Issue31333FocusEditorInTableViewCell ()
{
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32206.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32206.cs
deleted file mode 100644
index 428538f6..00000000
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32206.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Xamarin.Forms.CustomAttributes;
-using Xamarin.Forms.Internals;
-using System.Threading;
-
-#if UITEST
-using Xamarin.UITest;
-using NUnit.Framework;
-#endif
-
-namespace Xamarin.Forms.Controls.Issues
-{
- [Preserve(AllMembers = true)]
- [Issue(IssueTracker.Bugzilla, 32206, "ContextActions cause memory leak: Page is never destroyed", PlatformAffected.iOS)]
- public class Bugzilla32206 : TestNavigationPage
- {
- protected override void Init()
- {
- PushAsync(new LandingPage32206());
- }
-
-#if UITEST && __IOS__
- [Test]
- public void Bugzilla32206Test()
- {
- for (var n = 0; n < 10; n++)
- {
- RunningApp.WaitForElement(q => q.Marked("Push"));
- RunningApp.Tap(q => q.Marked("Push"));
-
- RunningApp.WaitForElement(q => q.Marked("ListView"));
- RunningApp.Back();
- }
-
- // At this point, the counter can be any value, but it's most likely not zero.
- // Invoking GC once is enough to clean up all garbage data and set counter to zero
- RunningApp.WaitForElement(q => q.Marked("GC"));
- RunningApp.Tap(q => q.Marked("GC"));
-
- RunningApp.WaitForElement(q => q.Marked("Counter: 0"));
- }
-#endif
- }
-
- [Preserve(AllMembers = true)]
- public class LandingPage32206 : ContentPage
- {
- public static int Counter;
- public Label Label;
-
- public LandingPage32206()
- {
- Label = new Label
- {
- Text = "Counter: " + Counter,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
-
- Content = new StackLayout
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- Spacing = 15,
- Children =
- {
- new Label
- {
- Text = "Click Push to show a ListView. When you hit the Back button, Counter will show the number of pages that have not been finalized yet."
- + " If you click GC, the counter should be 0."
- },
- Label,
- new Button
- {
- Text = "GC",
- AutomationId = "GC",
- Command = new Command(o =>
- {
- GC.Collect();
- GC.WaitForPendingFinalizers();
- GC.Collect();
- Label.Text = "Counter: " + Counter;
- })
- },
- new Button
- {
- Text = "Push",
- AutomationId = "Push",
- Command = new Command(async o =>
- {
- await Navigation.PushAsync(new ContentPage32206());
- })
- }
- }
- };
- }
-
- protected override void OnAppearing()
- {
- base.OnAppearing();
-
- if (Label != null)
- Label.Text = "Counter: " + Counter;
- }
- }
-
- [Preserve(AllMembers = true)]
- public class ContentPage32206 : ContentPage
- {
- public ContentPage32206()
- {
- Interlocked.Increment(ref LandingPage32206.Counter);
- System.Diagnostics.Debug.WriteLine("Page: " + LandingPage32206.Counter);
-
- Content = new ListView
- {
- ItemsSource = new List<string> { "Apple", "Banana", "Cherry" },
- ItemTemplate = new DataTemplate(typeof(ViewCell32206)),
- AutomationId = "ListView"
- };
- }
-
- ~ContentPage32206()
- {
- Interlocked.Decrement(ref LandingPage32206.Counter);
- System.Diagnostics.Debug.WriteLine("Page: " + LandingPage32206.Counter);
- }
- }
-
- [Preserve(AllMembers = true)]
- public class ViewCell32206 : ViewCell
- {
- public ViewCell32206()
- {
- View = new Label();
- View.SetBinding(Label.TextProperty, ".");
- ContextActions.Add(new MenuItem { Text = "Delete" });
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36171.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36171.cs
index bb8743d4..6bcd16b7 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36171.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36171.cs
@@ -67,9 +67,6 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST
[Test]
-#if __MACOS__
- [Ignore("Missing UITest for focus")]
-#endif
public void EntryTextDoesNotDisplayNonnumericInput ()
{
RunningApp.WaitForElement ("Start Entry");
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39489.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39489.cs
index 622a5f4b..0e04fcd5 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39489.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39489.cs
@@ -7,7 +7,6 @@ using System.Threading.Tasks;
using Xamarin.Forms.Maps;
#if UITEST
-using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
@@ -15,9 +14,6 @@ using NUnit.Framework;
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
-#if UITEST
- [Category(UITestCategories.Maps)]
-#endif
[Issue(IssueTracker.Bugzilla, 39489, "Memory leak when using NavigationPage with Maps", PlatformAffected.Android | PlatformAffected.iOS)]
public class Bugzilla39489 : TestNavigationPage
{
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39530.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39530.cs
index 6b7d380a..735b7197 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39530.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39530.cs
@@ -57,9 +57,6 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST
[Test]
-#if __MACOS__
- [Ignore("UITest.Desktop doesn't return empty NSView yet so it can't find the frame")]
-#endif
public void Bugzilla39530PanTest()
{
// Got to wait for the element to be visible to the UI test framework, otherwise we get occasional
@@ -72,9 +69,6 @@ namespace Xamarin.Forms.Controls.Issues
}
[Test]
-#if __MACOS__
- [Ignore("UITest.Desktop doesn't return empty NSView yet so it can't find the frame")]
-#endif
public void Bugzilla39530PinchTest()
{
RunningApp.PinchToZoomIn ("frame");
@@ -82,9 +76,6 @@ namespace Xamarin.Forms.Controls.Issues
}
[Test]
-#if __MACOS__
- [Ignore("UITest.Desktop doesn't return empty NSView yet so it can't find the frame")]
-#endif
public void Bugzilla39530TapTest()
{
RunningApp.WaitForElement (q => q.Marked ("frame"));
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40173.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40173.cs
index 61d2b1b6..054a68c8 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40173.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40173.cs
@@ -32,10 +32,9 @@ namespace Xamarin.Forms.Controls.Issues
RunningApp.Tap(q => q.All().Marked(CanTouchButtonId));
RunningApp.WaitForElement(q => q.All().Text(CanTouchSuccessText));
-#if !__MACOS__
+
RunningApp.Tap(q => q.All().Marked(ListTapTarget));
RunningApp.WaitForElement(q => q.All().Text(ListTapSuccessText));
-#endif
}
#endif
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40704.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40704.cs
index 7efea71b..1298110f 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40704.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40704.cs
@@ -224,9 +224,6 @@ namespace Xamarin.Forms.Controls.Issues
RunningApp.WaitForElement("Menu - 0");
}
[Test]
-#if __MACOS__
- [Ignore("ScrollDownTo not implemented in UITest.Desktop")]
-#endif
public void Bugzilla40704Test()
{
RunningApp.ScrollDownTo("btnCollappse", "lstMain", ScrollStrategy.Gesture, 0.8, timeout: TimeSpan.FromMinutes(2));
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41619.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41619.cs
deleted file mode 100644
index 24c277de..00000000
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41619.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using Xamarin.Forms.CustomAttributes;
-using Xamarin.Forms.Internals;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-
-#if UITEST
-using Xamarin.UITest;
-using NUnit.Framework;
-#endif
-
-namespace Xamarin.Forms.Controls.Issues
-{
- [Preserve(AllMembers = true)]
- [Issue(IssueTracker.Bugzilla, 41619, "[WinRT/UWP] Slider binding works incorrectly", PlatformAffected.WinRT)]
- public class Bugzilla41619 : TestContentPage
- {
- protected override void Init()
- {
- var vm = new Bugzilla41619ViewModel { SliderValue = 5 };
- BindingContext = vm;
- var label = new Label();
- label.SetBinding(Label.TextProperty, "SliderValue");
- var slider = new Slider
- {
- Maximum = 10,
- Minimum = 1,
- };
- slider.SetBinding(Slider.ValueProperty, "SliderValue", BindingMode.TwoWay);
- Content = new StackLayout
- {
- Children =
- {
- label,
- slider,
- new Label { Text = "The initial slider value above should be 5." }
- }
- };
- }
-
- class Bugzilla41619ViewModel : INotifyPropertyChanged
- {
- private double _sliderValue;
-
- public double SliderValue
- {
- get { return _sliderValue; }
- set
- {
- _sliderValue = value;
- OnPropertyChanged();
- }
- }
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43783.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43783.cs
deleted file mode 100644
index 99d4fcae..00000000
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43783.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Xamarin.Forms.CustomAttributes;
-using Xamarin.Forms.Internals;
-
-namespace Xamarin.Forms.Controls.Issues
-{
- [Preserve(AllMembers = true)]
- [Issue(IssueTracker.Bugzilla, 43783, "[WP8.1] Most Device Styles do not render correctly in Windows Phone 8.1 (RT) applications", PlatformAffected.WinPhone)]
- public class Bugzilla43783 : TestContentPage
- {
- protected override void Init()
- {
- Title = "Device";
-
- Content = new StackLayout
- {
- Children = {
- new Label { Margin = new Thickness(10), Text = "The Labels for Body, Caption, List Item, List Item Detail, and No Style should not all look the same. If all of them look the same, this test has failed."},
- new Label { Text = "Title style", Style = Device.Styles.TitleStyle },
- new Label { Text = "Subtitle style", Style = Device.Styles.SubtitleStyle },
- new Label { Text = "Body style", Style = Device.Styles.BodyStyle },
- new Label { Text = "Caption style", Style = Device.Styles.CaptionStyle },
- new Label { Text = "List item text style", Style = Device.Styles.ListItemTextStyle },
- new Label { Text = "List item detail text style", Style = Device.Styles.ListItemDetailTextStyle },
- new Label { Text = "No style" }
- }
- };
- }
-
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43867.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43867.cs
deleted file mode 100644
index 938200c0..00000000
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43867.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using Xamarin.Forms.CustomAttributes;
-using Xamarin.Forms.Internals;
-using Xamarin.Forms.PlatformConfiguration;
-using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
-
-#if UITEST
-using Xamarin.UITest;
-using NUnit.Framework;
-#endif
-
-namespace Xamarin.Forms.Controls.Issues
-{
- [Preserve(AllMembers = true)]
- [Issue(IssueTracker.Bugzilla, 43867, "Numeric keyboard shows text / default keyboard when back button is hit", PlatformAffected.Android)]
- public class Bugzilla43867 : TestContentPage // or TestMasterDetailPage, etc ...
- {
- protected override void Init()
- {
- Application.Current.On<Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
-
- Content = new StackLayout
- {
- Spacing = 10,
- VerticalOptions = LayoutOptions.Center,
- Children =
- {
- new Label
- {
- Text = "Focus and unfocus each element 10 times using the Back button. Observe that the soft keyboard does not show different characters while hiding. Now repeat the test by tapping off of the element."
- },
- new Entry
- {
- WidthRequest = 250,
- HeightRequest = 50,
- BackgroundColor = Color.AntiqueWhite,
- Keyboard = Keyboard.Numeric
- },
- new Editor
- {
- WidthRequest = 250,
- HeightRequest = 50,
- BackgroundColor = Color.BurlyWood,
- Keyboard = Keyboard.Numeric
- }
- }
- };
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43941.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43941.cs
deleted file mode 100644
index b69e968a..00000000
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43941.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Xamarin.Forms.CustomAttributes;
-using Xamarin.Forms.Internals;
-using System.Threading;
-
-#if UITEST
-using Xamarin.UITest;
-using NUnit.Framework;
-#endif
-
-namespace Xamarin.Forms.Controls.Issues
-{
- [Preserve(AllMembers = true)]
- [Issue(IssueTracker.Bugzilla, 43941, "Memory leak with ListView's RecycleElement on iOS", PlatformAffected.iOS)]
- public class Bugzilla43941 : TestNavigationPage
- {
- protected override void Init()
- {
- PushAsync(new LandingPage43941());
- }
-
-#if UITEST && __IOS__
- [Test]
- public void Bugzilla43941Test()
- {
- for (var n = 0; n < 10; n++)
- {
- RunningApp.WaitForElement(q => q.Marked("Push"));
- RunningApp.Tap(q => q.Marked("Push"));
-
- RunningApp.WaitForElement(q => q.Marked("ListView"));
- RunningApp.Back();
- }
-
- // At this point, the counter can be any value, but it's most likely not zero.
- // Invoking GC once is enough to clean up all garbage data and set counter to zero
- RunningApp.WaitForElement(q => q.Marked("GC"));
- RunningApp.Tap(q => q.Marked("GC"));
-
- RunningApp.WaitForElement(q => q.Marked("Counter: 0"));
- }
-#endif
- }
-
- [Preserve(AllMembers = true)]
- public class ContentPage43941 : ContentPage
- {
- public ContentPage43941()
- {
- Interlocked.Increment(ref LandingPage43941.Counter);
- System.Diagnostics.Debug.WriteLine("Page: " + LandingPage43941.Counter);
-
- var list = new List<int>();
- for (var i = 0; i < 30; i++)
- list.Add(i);
-
- Title = "ContentPage43941";
- Content = new ListView
- {
- HasUnevenRows = true,
- ItemsSource = list,
- AutomationId = "ListView"
- };
- }
-
- ~ContentPage43941()
- {
- Interlocked.Decrement(ref LandingPage43941.Counter);
- System.Diagnostics.Debug.WriteLine("Page: " + LandingPage43941.Counter);
- }
- }
-
- [Preserve(AllMembers = true)]
- public class LandingPage43941 : ContentPage
- {
- public static int Counter;
- public Label Label;
-
- public LandingPage43941()
- {
- Label = new Label
- {
- Text = "Counter: " + Counter,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
-
- Content = new StackLayout
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- Spacing = 15,
- Children =
- {
- new Label
- {
- Text = "Click Push to show a ListView. When you hit the Back button, Counter will show the number of pages that have not been finalized yet."
- + " If you click GC, the counter should be 0."
- },
- Label,
- new Button
- {
- Text = "GC",
- AutomationId = "GC",
- Command = new Command(o =>
- {
- GC.Collect();
- GC.WaitForPendingFinalizers();
- GC.Collect();
- Label.Text = "Counter: " + Counter;
- })
- },
- new Button
- {
- Text = "Push",
- AutomationId = "Push",
- Command = new Command(async o =>
- {
- await Navigation.PushAsync(new ContentPage43941());
- })
- }
- }
- };
- }
-
- protected override void OnAppearing()
- {
- base.OnAppearing();
-
- if (Label != null)
- Label.Text = "Counter: " + Counter;
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs
index 85c168c2..e38da023 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs
@@ -49,13 +49,7 @@ namespace Xamarin.Forms.Controls.Issues
Debug.WriteLine($">>>>>>>> Post-GC, {_44166NavContent.Counter} {nameof(_44166NavContent)} allocated");
}
- int success = 0;
-
- //some reason there's always 1 instance around i don't know why yet, if we were leaking it should be 8 here
- if (Device.RuntimePlatform == Device.macOS)
- success = 4;
-
- if (_44166NavContent.Counter + _44166Detail.Counter + _44166Master.Counter + _44166MDP.Counter == success)
+ if (_44166NavContent.Counter + _44166Detail.Counter + _44166Master.Counter + _44166MDP.Counter == 0)
{
label.Text = "Success";
}
@@ -190,7 +184,7 @@ namespace Xamarin.Forms.Controls.Issues
{
public static int Counter;
- public _44166NavContent()
+ public _44166NavContent ()
{
Interlocked.Increment(ref Counter);
Debug.WriteLine($"++++++++ {nameof(_44166NavContent)} constructor, {Counter} allocated");
@@ -204,7 +198,7 @@ namespace Xamarin.Forms.Controls.Issues
};
}
- ~_44166NavContent()
+ ~_44166NavContent ()
{
Interlocked.Decrement(ref Counter);
Debug.WriteLine($"-------- {nameof(_44166NavContent)} destructor, {Counter} allocated");
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs
index 540ab59f..b0e30112 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs
@@ -64,10 +64,10 @@ namespace Xamarin.Forms.Controls.Issues
RunningApp.Screenshot ("Clicked Leave");
RunningApp.WaitForElement (q => q.Marked ("Bug Repro's"));
-#if !__MACOS__
+
RunningApp.ClearText(q => q.Raw("* marked:'SearchBarGo'"));
RunningApp.EnterText(q => q.Raw("* marked:'SearchBarGo'"), "G198");
-#endif
+
RunningApp.Tap (q => q.Marked ("SearchButton"));
RunningApp.Screenshot ("Navigate into gallery again");
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue206.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue206.cs
index 61f63720..cb3831a0 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue206.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue206.cs
@@ -37,11 +37,9 @@ namespace Xamarin.Forms.Controls.Issues
RunningApp.Screenshot ("All elements exist");
-#if !__MACOS__
var scrollRect = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
Xamarin.Forms.Core.UITests.Gestures.ScrollForElement (RunningApp, "* marked:'9'", new Xamarin.Forms.Core.UITests.Drag (scrollRect, Xamarin.Forms.Core.UITests.Drag.Direction.BottomToTop, Xamarin.Forms.Core.UITests.Drag.DragLength.Long));
RunningApp.Screenshot ("I see 9");
-#endif
RunningApp.Tap (q => q.Marked ("9"));
RunningApp.WaitForNoElement (q => q.Marked ("9"));
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2272.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2272.cs
index b0efc276..d084de9c 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2272.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2272.cs
@@ -31,9 +31,6 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST
[Test]
-#if __MACOS__
- [Ignore("EnterText problems in UITest Desktop")]
-#endif
public void TestFocusIsOnTheEndAfterSettingText ()
{
RunningApp.Tap (c => c.Marked ("userNameEditorEmptyString"));
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2411.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2411.cs
index 8b76e796..f3237973 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2411.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2411.cs
@@ -31,9 +31,6 @@ namespace Xamarin.Forms.Controls.Issues
#if __ANDROID__
[Ignore("Appearing event is tied to virtualization in TabbedPage for Material")]
#endif
-#if __MACOS__
- [Ignore("ScrollTo not implemented on MacOS")]
-#endif
[Issue(IssueTracker.Github, 2411, "ScrollToPosition.MakeVisible not called every time TabbedPage", PlatformAffected.Android)]
public void Issue2411ScrollToPositionMakeVisible()
{
@@ -60,9 +57,6 @@ namespace Xamarin.Forms.Controls.Issues
[Test]
[Issue(IssueTracker.Github, 2411, "ScrollToPosition.End crashing in TabbedPage", PlatformAffected.Android)]
-#if __MACOS__
- [Ignore("ScrollTo not implemented on MacOS")]
-#endif
public void Issue2411ScrollToPositionEndCrash()
{
RunningApp.Tap(q => q.Marked("Crash in ScrollToPosition.End"));
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs
index 1fda224f..6400a2ac 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs
@@ -1,5 +1,8 @@
using System;
+using System.Collections.Generic;
+using System.Text;
using System.Reflection;
+
using Xamarin.Forms.CustomAttributes;
#if UITEST
@@ -11,24 +14,18 @@ using Xamarin.UITest;
namespace Xamarin.Forms.Controls
{
internal static class AppPaths
- {
- public static string ApkPath = "../../../Xamarin.Forms.ControlGallery.Android/bin/Debug/AndroidControlGallery.AndroidControlGallery-Signed.apk";
-
- public static string MacOSPath = "../../../Xamarin.Forms.ControlGallery.MacOS/bin/Debug/Xamarin.Forms.ControlGallery.MacOS.app";
-
- // Have to continue using the old BundleId for now; Test Cloud doesn't like
- // when you change the BundleId
- public static string BundleId = "com.xamarin.quickui.controlgallery";
+ {
+ public static string ApkPath = "../../../Xamarin.Forms.ControlGallery.Android/bin/Debug/AndroidControlGallery.AndroidControlGallery-Signed.apk";
// Have to continue using the old BundleId for now; Test Cloud doesn't like
// when you change the BundleId
- public static string MacOSBundleId = "com.xamarin.xamarin-forms-controlgallery-macos";
- }
+ public static string BundleId = "com.xamarin.quickui.controlgallery";
+ }
#if UITEST
internal static class AppSetup
{
- static IApp InitializeApp()
+ static IApp InitializeApp ()
{
IApp app = null;
#if __ANDROID__
@@ -38,13 +35,9 @@ namespace Xamarin.Forms.Controls
#elif __IOS__
app = InitializeiOSApp();
-
-#elif __MACOS__
- Xamarin.UITest.Desktop.TestAgent.Start();
- app = InitializeMacOSApp();
#endif
if (app == null)
- throw new NullReferenceException("App was not initialized.");
+ throw new NullReferenceException ("App was not initialized.");
// Wrap the app in ScreenshotConditional so it only takes screenshots if the SCREENSHOTS symbol is specified
return new ScreenshotConditionalApp(app);
@@ -76,38 +69,22 @@ namespace Xamarin.Forms.Controls
}
#endif
-#if __MACOS__
- static IApp InitializeMacOSApp()
+ public static void NavigateToIssue (Type type, IApp app)
{
- // Running on a device
- var configurator = new Xamarin.UITest.Desktop.CocoaAppConfigurator();
- var app = configurator
- //.AppBundle("/Users/rmarinho/Xamarin/Xamarin.Forms/Xamarin.Forms.ControlGallery.MacOS/bin/Debug/Xamarin.Forms.ControlGallery.MacOS.app")
- .AppBundle(AppPaths.MacOSPath)
- .BundleId(AppPaths.MacOSBundleId)
- .StartApp();
- return new Xamarin.Forms.Core.macOS.UITests.MacOSApp(app);
- }
-#endif
-
- public static void NavigateToIssue(Type type, IApp app)
- {
- var typeIssueAttribute = type.GetTypeInfo().GetCustomAttribute<IssueAttribute>();
+ var typeIssueAttribute = type.GetTypeInfo ().GetCustomAttribute <IssueAttribute> ();
string cellName = "";
- if (typeIssueAttribute.IssueTracker.ToString() != "None" &&
+ if (typeIssueAttribute.IssueTracker.ToString () != "None" &&
typeIssueAttribute.IssueNumber != 1461 &&
- typeIssueAttribute.IssueNumber != 342)
- {
- cellName = typeIssueAttribute.IssueTracker.ToString().Substring(0, 1) + typeIssueAttribute.IssueNumber.ToString();
- }
- else {
+ typeIssueAttribute.IssueNumber != 342) {
+ cellName = typeIssueAttribute.IssueTracker.ToString ().Substring(0, 1) + typeIssueAttribute.IssueNumber.ToString ();
+ } else {
cellName = typeIssueAttribute.Description;
}
int maxAttempts = 2;
int attempts = 0;
-
+
while (attempts < maxAttempts)
{
attempts += 1;
@@ -174,20 +151,17 @@ namespace Xamarin.Forms.Controls
}
}
- public static IApp Setup(Type pageType = null)
+ public static IApp Setup (Type pageType = null)
{
IApp runningApp = null;
- try
- {
- runningApp = InitializeApp();
+ try {
+ runningApp = InitializeApp ();
+ } catch (Exception e) {
+ Assert.Inconclusive ($"App did not start for some reason: {e}");
}
- catch (Exception e)
- {
- Assert.Inconclusive($"App did not start for some reason: {e}");
- }
-
+
if (pageType != null)
- NavigateToIssue(pageType, runningApp);
+ NavigateToIssue (pageType, runningApp);
return runningApp;
}
@@ -259,10 +233,10 @@ namespace Xamarin.Forms.Controls
protected virtual bool Isolate => false;
#endif
- protected TestPage()
+ protected TestPage ()
{
#if APP
- Init();
+ Init ();
#endif
}
@@ -293,7 +267,7 @@ namespace Xamarin.Forms.Controls
}
#endif
- protected abstract void Init();
+ protected abstract void Init ();
}
@@ -305,16 +279,16 @@ namespace Xamarin.Forms.Controls
protected virtual bool Isolate => false;
#endif
- protected TestContentPage()
+ protected TestContentPage ()
{
#if APP
- Init();
+ Init ();
#endif
}
#if UITEST
[SetUp]
- public void Setup()
+ public void Setup ()
{
if (Isolate)
{
@@ -339,7 +313,7 @@ namespace Xamarin.Forms.Controls
}
#endif
- protected abstract void Init();
+ protected abstract void Init ();
}
public abstract class TestCarouselPage : CarouselPage
@@ -350,10 +324,10 @@ namespace Xamarin.Forms.Controls
protected virtual bool Isolate => false;
#endif
- protected TestCarouselPage()
+ protected TestCarouselPage ()
{
#if APP
- Init();
+ Init ();
#endif
}
@@ -384,7 +358,7 @@ namespace Xamarin.Forms.Controls
}
#endif
- protected abstract void Init();
+ protected abstract void Init ();
}
public abstract class TestMasterDetailPage : MasterDetailPage
@@ -395,10 +369,10 @@ namespace Xamarin.Forms.Controls
protected virtual bool Isolate => false;
#endif
- protected TestMasterDetailPage()
+ protected TestMasterDetailPage ()
{
#if APP
- Init();
+ Init ();
#endif
}
@@ -429,7 +403,7 @@ namespace Xamarin.Forms.Controls
}
#endif
- protected abstract void Init();
+ protected abstract void Init ();
}
public abstract class TestNavigationPage : NavigationPage
@@ -440,10 +414,10 @@ namespace Xamarin.Forms.Controls
protected virtual bool Isolate => false;
#endif
- protected TestNavigationPage()
+ protected TestNavigationPage ()
{
#if APP
- Init();
+ Init ();
#endif
}
@@ -474,7 +448,7 @@ namespace Xamarin.Forms.Controls
}
#endif
- protected abstract void Init();
+ protected abstract void Init ();
}
public abstract class TestTabbedPage : TabbedPage
@@ -485,10 +459,10 @@ namespace Xamarin.Forms.Controls
protected virtual bool Isolate => false;
#endif
- protected TestTabbedPage()
+ protected TestTabbedPage ()
{
#if APP
- Init();
+ Init ();
#endif
}
@@ -519,7 +493,7 @@ namespace Xamarin.Forms.Controls
}
#endif
- protected abstract void Init();
+ protected abstract void Init ();
}
}
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
index b8e45b44..fab19248 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
@@ -51,7 +51,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla31964.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla32033.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla32034.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Bugzilla32206.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla32776.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla32842.xaml.cs">
<DependentUpon>Bugzilla32842.xaml</DependentUpon>
@@ -127,7 +126,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla41415.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla41418.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla41424.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Bugzilla41619.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42069.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42069_Page.xaml.cs">
<DependentUpon>Bugzilla42069_Page.xaml</DependentUpon>
@@ -141,11 +139,8 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43313.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43469.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43941.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43663.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43867.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43735.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43783.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44453.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla51536.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44944.cs" />
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs b/Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs
deleted file mode 100644
index e2354153..00000000
--- a/Xamarin.Forms.Controls/ControlGalleryPages/AccessibilityGallery.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-
-namespace Xamarin.Forms.Controls
-{
- public class AccessibilityGallery : ContentPage
- {
- public AccessibilityGallery()
- {
- // https://developer.xamarin.com/guides/android/advanced_topics/accessibility/
- // https://developer.xamarin.com/guides/ios/advanced_topics/accessibility/
- // https://msdn.microsoft.com/en-us/windows/uwp/accessibility/basic-accessibility-information
-
- string screenReader = "";
- string scrollFingers = "";
- string explore = "";
-
- switch (Device.RuntimePlatform)
- {
- case Device.iOS:
- screenReader = "VoiceOver";
- scrollFingers = "three fingers";
- explore = "Use two fingers to swipe up or down the screen to read all of the elements on this page.";
- break;
- case Device.Android:
- screenReader = "TalkBack";
- scrollFingers = "two fingers";
- explore = "Drag one finger across the screen to read each element on the page.";
- break;
- case Device.Windows:
- case Device.WinPhone:
- screenReader = "Narrator";
- scrollFingers = "two fingers";
- break;
- default:
- screenReader = "the native screen reader";
- break;
- }
-
- var instructions = new Label { Text = $"Please enable {screenReader}. {explore} Use {scrollFingers} to scroll the view. Tap an element once to hear the description. Double tap anywhere on the screen to activate the selected element. Swipe left or right with one finger to switch to the previous or next element." };
-
- const string EntryPlaceholder = "Your name";
- const string EntryHint = "Type your name.";
-
- var instructions2 = new Label { Text = $"The following Entry should read aloud \"{EntryPlaceholder}. {EntryHint}\", plus native instructions on how to use an entry element. Note that Android will NOT read the Hint if a Placeholder is provided." };
- var entry = new Entry { Placeholder = EntryPlaceholder };
- entry.SetAccessibilityHint(EntryHint);
-
-
- var activityIndicator = new ActivityIndicator();
- activityIndicator.SetAccessibilityName("Progress indicator");
-
-
- const string ButtonText = "Update progress";
- var instructions3 = new Label { Text = $"The following Button should read aloud \"{ButtonText}\", plus native instructions on how to use a button." };
- var button = new Button { Text = ButtonText };
- button.Clicked += (sender, e) =>
- {
- activityIndicator.IsRunning = !activityIndicator.IsRunning;
- activityIndicator.SetAccessibilityHint(activityIndicator.IsRunning ? "Running." : "Not running");
- };
-
-
- const string ImageHint = "Tap to show an alert.";
- var instructions4 = new Label { Text = $"The following Image should read aloud \"{ImageHint}\". You should be able to tap the image and hear an alert box." };
- var image = new Image { Source = "photo.jpg" };
- image.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => DisplayAlert("Success", "You tapped the image", "OK")) });
- image.SetAccessibilityHint(ImageHint);
- // images are ignored by default on iOS (at least, Forms images are);
- // make accessible in order to enable the gesture and narration
- image.SetIsInAccessibleTree(true);
-
-
- var instructions5 = new Label { Text = $"The following Button should NOT be read aloud, nor should you be able to interact with it while {screenReader} is active." };
- var button2 = new Button { Text = "I am not accessible" };
- // setting this to false seems to have no effect on any platform
- button2.SetIsInAccessibleTree(false);
-
-
- var boxView = new BoxView { Color = Color.Purple };
- boxView.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => DisplayAlert("Success", "You tapped the box", "OK")) });
- boxView.SetAccessibilityName("Box");
- boxView.SetAccessibilityHint("Shows a purple box.");
- //boxView.SetIsInAccessibleTree(true);
-
- var stack = new StackLayout
- {
- Children =
- {
- instructions,
- instructions2,
- entry,
- instructions3,
- button,
- activityIndicator,
- instructions4,
- image,
- instructions5,
- button2,
- boxView
- }
- };
-
- var scrollView = new ScrollView { Content = stack };
-
- // TODO: Test Pan/Pinch gestures
- // TODO: Test CarouselView
-
- Content = scrollView;
- }
-
- }
-
-
- public static class AccessibilityExtensions
- {
- public static void SetAccessibilityName(this VisualElement element, string name)
- {
- element.SetValue(Accessibility.NameProperty, name);
- }
-
- public static string GetAccessibilityName(this VisualElement element)
- {
- return (string)element.GetValue(Accessibility.NameProperty);
- }
-
- public static void SetAccessibilityHint(this VisualElement element, string hint)
- {
- element.SetValue(Accessibility.HintProperty, hint);
- }
-
- public static string GetAccessibilityHint(this VisualElement element)
- {
- return (string)element.GetValue(Accessibility.HintProperty);
- }
-
- public static void SetIsInAccessibleTree(this VisualElement element, bool value)
- {
- element.SetValue(Accessibility.IsInAccessibleTreeProperty, value);
- }
-
- public static bool GetIsInAccessibleTree(this VisualElement element)
- {
- return (bool)element.GetValue(Accessibility.IsInAccessibleTreeProperty);
- }
- }
-}
diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/ToolbarItems.cs b/Xamarin.Forms.Controls/ControlGalleryPages/ToolbarItems.cs
index b3b3521e..3e98fc88 100644
--- a/Xamarin.Forms.Controls/ControlGalleryPages/ToolbarItems.cs
+++ b/Xamarin.Forms.Controls/ControlGalleryPages/ToolbarItems.cs
@@ -7,49 +7,43 @@ namespace Xamarin.Forms.Controls
public class ToolbarItems : ContentPage
{
bool _isEnable = false;
- public ToolbarItems()
+ public ToolbarItems ()
{
+ var label = new Label { Text = "Hello ContentPage", AutomationId ="label_id" };
- var label = new Label { Text = "Hello ContentPage", AutomationId = "label_id" };
-
- var command = new Command((obj) =>
- {
- label.Text = "tb4";
- }, (obj) => _isEnable);
- var tb1 = new ToolbarItem("tb1", "menuIcon.png", () =>
- {
+ var tb1 = new ToolbarItem ("tb1", "menuIcon.png", () => {
label.Text = "tb1";
}, ToolbarItemOrder.Primary);
tb1.IsEnabled = _isEnable;
tb1.AutomationId = "toolbaritem_primary";
+ tb1.IsEnabled = _isEnable;
- var tb2 = new ToolbarItem("tb2", null, () =>
- {
+ var tb2 = new ToolbarItem ("tb2", null, () => {
label.Text = "tb2";
}, ToolbarItemOrder.Primary);
tb2.AutomationId = "toolbaritem_primary2";
- var tb3 = new ToolbarItem("tb3", "bank.png", () =>
- {
+ var tb3 = new ToolbarItem ("tb3", "bank.png", () => {
label.Text = "tb3";
- _isEnable = !_isEnable;
- command.ChangeCanExecute();
}, ToolbarItemOrder.Secondary);
tb3.AutomationId = "toolbaritem_secondary";
- var tb4 = new ToolbarItem();
+ var tb4 = new ToolbarItem ();
tb4.Text = "tb4";
tb4.Order = ToolbarItemOrder.Secondary;
- tb4.Command = command;
+ tb4.Command = new Command( (obj)=> {
+ _isEnable = true;
+ label.Text = "tb4";
+ (tb4.Command as Command).ChangeCanExecute();
+ },(obj) => _isEnable);
tb4.AutomationId = "toolbaritem_secondary2";
-
+
ToolbarItems.Add(tb1);
ToolbarItems.Add(tb2);
ToolbarItems.Add(tb3);
ToolbarItems.Add(tb4);
- Content = new StackLayout
- {
+ Content = new StackLayout {
Children = {
label
}
diff --git a/Xamarin.Forms.Controls/CoreGallery.cs b/Xamarin.Forms.Controls/CoreGallery.cs
index 924d4129..83d8ec6c 100644
--- a/Xamarin.Forms.Controls/CoreGallery.cs
+++ b/Xamarin.Forms.Controls/CoreGallery.cs
@@ -212,7 +212,6 @@ namespace Xamarin.Forms.Controls
}
};
#endif
- SetValue(Accessibility.NameProperty, "SwapRoot");
}
}
@@ -236,16 +235,9 @@ namespace Xamarin.Forms.Controls
public Func<Page> Realize { get; set; }
public string Title { get; set; }
-
- public override string ToString()
- {
- // a11y: let Narrator read a friendly string instead of the default ToString()
- return Title;
- }
}
List<GalleryPageFactory> _pages = new List<GalleryPageFactory> {
- new GalleryPageFactory(() => new AccessibilityGallery(), "Accessibility"),
new GalleryPageFactory(() => new PlatformSpecificsGallery(), "Platform Specifics"),
new GalleryPageFactory(() => new NativeBindingGalleryPage(), "Native Binding Controls Gallery"),
new GalleryPageFactory(() => new XamlNativeViews(), "Xaml Native Views Gallery"),
@@ -376,8 +368,6 @@ namespace Xamarin.Forms.Controls
SelectedItem = null;
};
-
- SetValue(Accessibility.NameProperty, "Core Pages");
}
NavigationBehavior navigationBehavior;
diff --git a/Xamarin.Forms.Controls/GalleryPages/MacOSTestGallery.cs b/Xamarin.Forms.Controls/GalleryPages/MacOSTestGallery.cs
deleted file mode 100644
index 3b44683f..00000000
--- a/Xamarin.Forms.Controls/GalleryPages/MacOSTestGallery.cs
+++ /dev/null
@@ -1,401 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Controls
-{
- public class MacOSTestGallery : ContentPage
- {
- public MacOSTestGallery()
- {
- mainDemoStack.Children.Add(MakeNewStackLayout());
- var items = new List<MyItem1>();
- for (int i = 0; i < 5000; i++)
- {
- items.Add(new MyItem1 { Reference = "Hello this is a big text " + i.ToString(), ShowButton = i % 2 == 0, Image = "bank.png" });
- }
-
- var header = new Label { Text = "HELLO HEADER ", FontSize = 40, BackgroundColor = Color.Pink };
- var lst4 = new ListView { Header = header, ItemTemplate = new DataTemplate(typeof(DemoViewCell)), BackgroundColor = Color.Yellow, HeightRequest = 300, RowHeight = 50, ItemsSource = items, };
-
- var lst = new ListView { ItemTemplate = new DataTemplate(typeof(DemoEntryCell)), BackgroundColor = Color.Yellow, HeightRequest = 300, RowHeight = 50, ItemsSource = items, };
- var lst1 = new ListView { ItemTemplate = new DataTemplate(typeof(DemoTextCell)), BackgroundColor = Color.Yellow, HeightRequest = 300, RowHeight = 50, ItemsSource = items, };
- var lst2 = new ListView { ItemTemplate = new DataTemplate(typeof(DemoSwitchCell)), BackgroundColor = Color.Yellow, HeightRequest = 300, RowHeight = 50, ItemsSource = items, };
- var lst3 = new ListView { ItemTemplate = new DataTemplate(typeof(DemoImageCell)), BackgroundColor = Color.Yellow, HeightRequest = 300, RowHeight = 50, ItemsSource = items, };
-
- var bigbUtton = new Button { WidthRequest = 200, HeightRequest = 300, Image = "bank.png" };
-
- var picker = new DatePicker();
-
- var timePicker = new TimePicker { Format = "T", Time = TimeSpan.FromHours(2) };
-
- var editor = new Editor { Text = "Edit this text on editor", HeightRequest = 100, TextColor = Color.Yellow, BackgroundColor = Color.Gray };
-
- var entry = new Entry { Placeholder = "Edit this text on entry", PlaceholderColor = Color.Pink, TextColor = Color.Yellow, BackgroundColor = Color.Green };
-
- var frame = new Frame { HasShadow = true, BackgroundColor = Color.Maroon, OutlineColor = Color.Lime, MinimumHeightRequest = 100 };
-
-
- var image = new Image { HeightRequest = 100, Source = "crimson.jpg" };
-
- var picker1 = new Picker { Title = "Select a team player", TextColor = Color.Pink, BackgroundColor = Color.Silver };
- picker1.Items.Add("Rui");
- picker1.Items.Add("Jason");
- picker1.Items.Add("Ez");
- picker1.Items.Add("Stephane");
- picker1.Items.Add("Samantha");
- picker1.Items.Add("Paul");
-
- picker1.SelectedIndex = 1;
-
- var progress = new ProgressBar { BackgroundColor = Color.Purple, Progress = 0.5, HeightRequest = 50 };
-
- picker1.SelectedIndexChanged += (sender, e) =>
- {
- entry.Text = $"Selected {picker1.Items[picker1.SelectedIndex]}";
-
- progress.Progress += 0.1;
- };
-
- var searchBar = new SearchBar { BackgroundColor = Color.Olive, TextColor = Color.Maroon, CancelButtonColor = Color.Pink };
- searchBar.Placeholder = "Please search";
- searchBar.PlaceholderColor = Color.Orange;
- searchBar.SearchButtonPressed += (sender, e) =>
- {
- searchBar.Text = "Search was pressed";
- };
-
- var slider = new Slider { BackgroundColor = Color.Lime, Value = 0.5 };
-
- slider.ValueChanged += (sender, e) =>
- {
- editor.Text = $"Slider value changed {slider.Value}";
- };
-
- var stepper = new Stepper { BackgroundColor = Color.Yellow, Maximum = 100, Minimum = 0, Value = 10, Increment = 0.5 };
-
- stepper.ValueChanged += (sender, e) =>
- {
- editor.Text = $"Stepper value changed {stepper.Value}";
- };
-
- var labal = new Label { Text = "This is a Switch" };
- var switchR = new Switch { BackgroundColor = Color.Fuchsia, IsToggled = true };
- switchR.Toggled += (sender, e) =>
- {
- entry.Text = $"switchR is toogle {switchR.IsToggled}";
- };
- var layoutSwitch = new StackLayout { Orientation = StackOrientation.Horizontal, BackgroundColor = Color.Green };
- layoutSwitch.Children.Add(labal);
- layoutSwitch.Children.Add(switchR);
-
- var webView = new WebView { HeightRequest = 200, Source = "http://google.pt" };
-
- var mainStck = new StackLayout
- {
- Spacing = 10,
- BackgroundColor = Color.Blue,
- VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.Center,
- Children =
- {
- lst4,
- lst,
- lst1,
- lst2,
- lst3,
- webView,
- layoutSwitch,
- stepper,
- slider,
- searchBar,
- progress,
- picker1,
- image,
- frame,
- entry,
- editor,
- picker,
- timePicker,
- bigbUtton,
- new Button { Text = "Click Me", BackgroundColor = Color.Gray },
- new Button { Image = "bank.png", BackgroundColor = Color.Gray },
- CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 10)),
- CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Top, 10)),
- CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 10)),
- CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Right, 10)),
- mainDemoStack
- }
- };
- var lbl = new Label { Text = "Second label", TextColor = Color.White, VerticalTextAlignment = TextAlignment.Start, HorizontalTextAlignment = TextAlignment.Center };
- mainStck.Children.Add(new Label { Text = "HELLO XAMARIN FORMS MAC", TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Center });
- mainStck.Children.Add(lbl);
- mainStck.Children.Add(new BoxView { Color = Color.Pink, HeightRequest = 200 });
-
- var scroller = new ScrollView { BackgroundColor = Color.Yellow, HorizontalOptions = LayoutOptions.Center };
-
- scroller.Scrolled += (sender, e) =>
- {
- lbl.Text = $"Current postion {scroller.ScrollY}";
- };
-
- scroller.Content = mainStck;
-
- var actv = new ActivityIndicator { BackgroundColor = Color.White, Color = Color.Fuchsia, IsRunning = true };
- mainStck.Children.Add(actv);
-
- bigbUtton.Clicked += async (sender, e) =>
- {
- await scroller.ScrollToAsync(actv, ScrollToPosition.Center, true);
- actv.Color = Color.Default;
- };
-
- Content = scroller;
- }
-
- public static ContentPage MacDemoContentPage()
- {
- return new MacOSTestGallery();
- }
-
- public static NavigationPage MacDemoNavigationPage()
- {
- var np = new NavigationPage(GetNewPage()) { BarTextColor = Color.Red, BarBackgroundColor = Color.Yellow };
-
- np.Pushed += (sender, e) => System.Diagnostics.Debug.WriteLine("Pushed + " + np.CurrentPage.Title);
-
- np.Popped += (sender, e) => System.Diagnostics.Debug.WriteLine("Popped");
-
- np.PoppedToRoot += (sender, e) => System.Diagnostics.Debug.WriteLine("Popped to root");
-
- return np;
- }
-
- public static TabbedPage MacDemoTabbedPage()
- {
-
- var btnGo = new Button { Text = "Change Title" };
- var btnGo1 = new Button { Text = "Change Icon" };
-
- var lyout = new StackLayout();
- lyout.Children.Add(btnGo);
- //lyout.Children.Add(btnGo1);
-
- var tp = new TabbedPage { BarTextColor = Color.Red, BarBackgroundColor = Color.Yellow };
-
- var master = new ContentPage { Icon = "bank.png", BackgroundColor = Color.Red, Title = "Master", Content = lyout };
-
- var detail = new ContentPage { Icon = "bank.png", BackgroundColor = Color.Blue, Title = "Detail", Content = new Label { Text = "This is Detail Page" } };
-
- tp.Children.Add(master);
- tp.Children.Add(detail);
-
- tp.CurrentPage = detail;
-
- tp.CurrentPageChanged += (sender, e) =>
- {
- System.Diagnostics.Debug.WriteLine(tp.CurrentPage.Title);
- };
-
- btnGo.Clicked += (sender, e) =>
- {
- tp.CurrentPage.Title = "Tile changed";
- tp.CurrentPage.Icon = null;
- };
-
- btnGo1.Clicked += (sender, e) =>
- {
-
- };
- return tp;
- }
-
- public static MasterDetailPage MacDemoMasterDetailPage()
- {
- var mdp = new MasterDetailPage();
-
- var master = new ContentPage { BackgroundColor = Color.Red, Title = "Master", Content = new Label { Text = "This is Master Page" } };
-
- var detail = new ContentPage { BackgroundColor = Color.Blue, Title = "Detail", Content = new Label { Text = "This is Detail Page" } };
-
- mdp.Master = master;
- mdp.Detail = detail;
-
- return mdp;
- }
-
- public static CarouselPage MacDemoCarouselPage()
- {
-
- var carouselPage = new CarouselPage { BackgroundColor = Color.Yellow };
-
- var btnGo = new Button { Text = "Goto To Page 1 " };
- var btnGo1 = new Button { Text = "Goto To Page 3 " };
- var stck = new StackLayout();
- stck.Children.Add(btnGo);
- stck.Children.Add(btnGo1);
- var page = new ContentPage { Title = "Page1", BackgroundColor = Color.Red, Content = new Label { Text = "Page 1 label", TextColor = Color.White, VerticalTextAlignment = TextAlignment.Start, HorizontalTextAlignment = TextAlignment.Center } };
- var page2 = new ContentPage { Title = "Page2", BackgroundColor = Color.Blue, Content = stck };
- var page3 = new ContentPage { Title = "Page3", BackgroundColor = Color.Green, Content = new Label { Text = "Page 3 label" } };
-
- carouselPage.Children.Add(page);
- carouselPage.Children.Add(page2);
- carouselPage.Children.Add(page3);
-
- carouselPage.CurrentPage = page2;
-
- btnGo.Clicked += (sender, e) =>
- {
- carouselPage.CurrentPage = page;
- };
-
- btnGo1.Clicked += (sender, e) =>
- {
- carouselPage.CurrentPage = page3;
- };
-
- carouselPage.CurrentPageChanged += (sender, e) =>
- {
- System.Diagnostics.Debug.WriteLine(carouselPage.CurrentPage.Title);
- };
- return carouselPage;
- }
-
- static int _pageID;
-
- static StackLayout mainDemoStack = new StackLayout { BackgroundColor = Color.Blue };
-
- static ContentPage GetNewPage()
- {
- var label = new Label { Text = $"Page {_pageID}" };
- var btnGo = new Button { Text = "Push Page" };
- var btnGo1 = new Button { Text = "Pop Page" };
- var lyout = new StackLayout();
- lyout.Children.Add(label);
- lyout.Children.Add(btnGo);
- lyout.Children.Add(btnGo1);
-
- btnGo.Clicked += async (sender, e) =>
- {
- _pageID++;
- await (lyout.Parent as Page).Navigation?.PushAsync(GetNewPage());
-
- };
-
- btnGo1.Clicked += async (sender, e) =>
- {
- _pageID--;
- await (lyout.Parent as Page).Navigation?.PopAsync();
-
- };
-
- return new ContentPage { Icon = "bank.png", BackgroundColor = _pageID % 2 == 0 ? Color.Blue : Color.Green, Title = label.Text, Content = lyout };
- }
-
- static StackLayout MakeNewStackLayout()
- {
- var count = 0;
- var stacklayout = new StackLayout { BackgroundColor = Color.Red };
-
- stacklayout.Children.Add(new Label { Text = $"HEllO {count}" });
- stacklayout.Children.Add(new Button
- {
- Text = "Change layout",
- Command = new Command(() =>
- {
- count += 2;
- stacklayout.Children.RemoveAt(2);
-
- var ll = new StackLayout();
- ll.Children.Add(new Label { Text = $"HEllO {count}" });
- ll.Children.Add(new Label { Text = $"HEllO {count + 1}" });
- stacklayout.Children.Add(ll);
- })
- });
- stacklayout.Children.Add(new Label { Text = $"HEllO {count + 1}" });
- count += 2;
- return stacklayout;
- }
-
-
-
- static Button CreateButton(Button.ButtonContentLayout layout)
- {
- return new Button
- {
- Text = "Click Me On Mac",
- Image = "bank.png",
- Font = Font.OfSize("Helvetica", 14),
- ContentLayout = layout,
- BackgroundColor = Color.Black,
- TextColor = Color.White
- };
- }
-
- class DemoSwitchCell : SwitchCell
- {
- public DemoSwitchCell()
- {
- SetBinding(TextProperty, new Binding("Reference"));
- SetBinding(OnProperty, new Binding("ShowButton"));
- }
- }
-
- class DemoImageCell : ImageCell
- {
- public DemoImageCell()
- {
- SetBinding(TextProperty, new Binding("Reference"));
- SetBinding(DetailProperty, new Binding("ShowButton"));
- SetBinding(ImageSourceProperty, new Binding("Image"));
- }
- }
-
- class DemoTextCell : TextCell
- {
- public DemoTextCell()
- {
- SetBinding(TextProperty, new Binding("Reference"));
- SetBinding(DetailProperty, new Binding("ShowButton"));
- }
- }
-
- class DemoEntryCell : EntryCell
- {
- public DemoEntryCell()
- {
- SetBinding(LabelProperty, new Binding("Reference"));
- SetBinding(TextProperty, new Binding("ShowButton"));
- LabelColor = Color.Red;
- Placeholder = "This is a entry cell";
- }
- }
-
- class DemoViewCell : ViewCell
- {
- public DemoViewCell()
- {
- var box = new Image { BackgroundColor = Color.Pink, WidthRequest = 100, HeightRequest = 40, Source = "bank.png" };
- var label = new Label { TextColor = Color.White };
- var labelDetail = new Label { TextColor = Color.White };
-
- label.SetBinding(Label.TextProperty, new Binding("Reference"));
- labelDetail.SetBinding(Label.TextProperty, new Binding("ShowButton"));
-
- var grid = new Grid { BackgroundColor = Color.Black };
-
- grid.Children.Add(box, 0, 1, 0, 1);
- grid.Children.Add(label, 1, 0);
- grid.Children.Add(labelDetail, 1, 1);
-
- View = grid;
- }
- }
-
- public class MyItem1
- {
- public string Reference { get; set; }
- public string Image { get; set; }
- public bool ShowButton { get; set; }
- }
- }
-}
diff --git a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
index 717f31e0..fa6da678 100644
--- a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
+++ b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
@@ -1,366 +1,365 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{CB9C96CE-125C-4A68-B6A1-C3FF1FBF93E1}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Xamarin.Forms.Controls</RootNamespace>
- <AssemblyName>Xamarin.Forms.Controls</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- <NuGetPackageImportStamp>
- </NuGetPackageImportStamp>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>TRACE;DEBUG;PERF;APP</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429</NoWarn>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE;APP</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429</NoWarn>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Turkey\</OutputPath>
- <DefineConstants>TRACE;DEBUG;PERF;APP</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- <WarningLevel>4</WarningLevel>
- <Optimize>false</Optimize>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429</NoWarn>
- </PropertyGroup>
- <ItemGroup>
- <!-- A reference to the entire .NET Framework is automatically included -->
- <ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
- <Project>{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}</Project>
- <Name>Xamarin.Forms.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\Xamarin.Forms.Build.Tasks\Xamarin.Forms.Build.Tasks.csproj">
- <Project>{96D89208-4EB9-4451-BE73-8A9DF3D9D7B7}</Project>
- <Name>Xamarin.Forms.Build.Tasks</Name>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\Xamarin.Forms.CustomAttributes\Xamarin.Forms.CustomAttributes.csproj">
- <Project>{4dcd0420-1168-4b77-86db-6196ee4bd491}</Project>
- <Name>Xamarin.Forms.CustomAttributes</Name>
- </ProjectReference>
- <ProjectReference Include="..\Xamarin.Forms.Maps\Xamarin.Forms.Maps.csproj">
- <Project>{7d13bac2-c6a4-416a-b07e-c169b199e52b}</Project>
- <Name>Xamarin.Forms.Maps</Name>
- </ProjectReference>
- <ProjectReference Include="..\Xamarin.Forms.Pages\Xamarin.Forms.Pages.csproj">
- <Project>{d6133dbd-6c60-4bd5-bea2-07e0a3927c31}</Project>
- <Name>Xamarin.Forms.Pages</Name>
- </ProjectReference>
- <ProjectReference Include="..\Xamarin.Forms.Xaml\Xamarin.Forms.Xaml.csproj">
- <Project>{9db2f292-8034-4e06-89ad-98bbda4306b9}</Project>
- <Name>Xamarin.Forms.Xaml</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="App.cs" />
- <Compile Include="AppLifeCycle.cs" />
- <Compile Include="Bugzilla44596SplashPage.cs" />
- <Compile Include="ControlGalleryPages\AccessibilityGallery.cs" />
- <Compile Include="ControlGalleryPages\CellForceUpdateSizeGalleryPage.cs" />
- <Compile Include="ControlGalleryPages\LayoutAddPerformance.xaml.cs">
- <DependentUpon>LayoutAddPerformance.xaml</DependentUpon>
- </Compile>
- <Compile Include="ControlGalleryPages\ListScrollTo.cs" />
- <Compile Include="ControlGalleryPages\NavBarTitleTestPage.cs" />
- <Compile Include="ControlGalleryPages\NestedNativeControlGalleryPage.cs" />
- <Compile Include="ControlGalleryPages\PanGestureGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\KeyboardCoreGalleryPage.cs" />
- <Compile Include="GalleryPages\BackgroundImageGallery.cs" />
- <Compile Include="GalleryPages\ControlTemplatePage.cs" />
- <Compile Include="GalleryPages\ControlTemplateXamlPage.xaml.cs">
- <DependentUpon>ControlTemplateXamlPage.xaml</DependentUpon>
- </Compile>
- <Compile Include="GalleryPages\LayoutPerformanceGallery.cs" />
- <Compile Include="GalleryPages\NavigationPropertiesGallery.cs" />
- <Compile Include="ControlGalleryPages\ListViewSelectionColor.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\ApplicationAndroid.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\EntryPageiOS.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\MasterDetailPageiOS.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\MasterDetailPageWindows.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\NavigationPageiOS.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\NavigationPageWindows.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\TabbedPageAndroid.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\TabbedPageiOS.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\TabbedPageWindows.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\VisualElementiOS.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGalleries\WindowsPlatformSpecificsGalleryHelpers.cs" />
- <Compile Include="GalleryPages\PlatformSpecificsGallery.cs" />
- <Compile Include="LegacyRepro\Page1.xaml.cs">
- <DependentUpon>Page1.xaml</DependentUpon>
- </Compile>
- <Compile Include="MainPageLifeCycleTests.cs" />
- <Compile Include="NavReproApp.cs" />
- <Compile Include="RootPages\RootContentPage.cs" />
- <Compile Include="RootPages\SwapHierachyStackLayout.cs" />
- <Compile Include="GalleryPages\EditableList.cs" />
- <Compile Include="CoreGalleryPages\EditorCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\EntryCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\FrameCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\ImageCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\LabelCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\ListViewCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\OpenGLViewCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\PickerCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\ProgressBarCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\SearchBarCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\SliderCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\StepperCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\SwitchCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\TableViewCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\TimePickerCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\WebViewCoreGalleryPage.cs" />
- <Compile Include="LegacyRepro\SampleViewCell.xaml.cs">
- <DependentUpon>SampleViewCell.xaml</DependentUpon>
- </Compile>
- <Compile Include="SimpleApp.cs" />
- <Compile Include="ViewContainers\EventViewContainer.cs" />
- <Compile Include="ViewContainers\LayeredViewContainer.cs" />
- <Compile Include="ViewContainers\MultiBindingHack.cs" />
- <Compile Include="ViewContainers\StateViewContainer.cs" />
- <Compile Include="ViewContainers\ValueViewContainer.cs" />
- <Compile Include="ViewContainers\ViewContainer.cs" />
- <Compile Include="CoreGalleryPages\ActivityIndicatorCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\CoreBoxViewGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\ButtonCoreGalleryPage.cs" />
- <Compile Include="CoreGallery.cs" />
- <Compile Include="CoreGalleryPages\DatePickerCoreGalleryPage.cs" />
- <Compile Include="CoreGalleryPages\CoreGalleryPage.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="TestCases.cs" />
- <Compile Include="GalleryPages\GridGallery.cs" />
- <Compile Include="GalleryPages\PickerGallery.cs" />
- <Compile Include="GalleryPages\ImageLoadingGallery.cs" />
- <Compile Include="GalleryPages\CarouselPageGallery.cs" />
- <Compile Include="GalleryPages\StepperGallery.cs" />
- <Compile Include="GalleryPages\ScaleRotate.cs" />
- <Compile Include="GalleryPages\LineBreakModeGallery.cs" />
- <Compile Include="GalleryPages\ActionSheetGallery.cs" />
- <Compile Include="GalleryPages\XamlPage.xaml.cs">
- <DependentUpon>XamlPage.xaml</DependentUpon>
- </Compile>
- <Compile Include="RootPages\RootTabbedContentPage.cs" />
- <Compile Include="RootPages\RootTabbedNavigationContentPage.cs" />
- <Compile Include="RootPages\RootNavigationContentPage.cs" />
- <Compile Include="RootPages\RootNavigationTabbedContentPage.cs" />
- <Compile Include="RootPages\RootMDPNavigationContentPage.cs" />
- <Compile Include="RootPages\RootTabbedMDPNavigationContentPage.cs" />
- <Compile Include="RootPages\RootTabbedManyNavigationContentPage.cs" />
- <Compile Include="RootPages\RootNavigationManyTabbedPage.cs" />
- <Compile Include="ControlGalleryPages\BehaviorsAndTriggers.xaml.cs">
- <DependentUpon>BehaviorsAndTriggers.xaml</DependentUpon>
- </Compile>
- <Compile Include="GalleryPages\CellsGalleries\EntryCellListPage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\EntryCellTablePage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\ImageCellListPage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\ImageCellTablePage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\ProductViewCell.cs" />
- <Compile Include="GalleryPages\CellsGalleries\SwitchCellListPage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\SwitchCellTablePage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\TextCellListPage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\TextCellTablePage.cs" />
- <Compile Include="GalleryPages\CellsGalleries\UnEvenViewCellGallery.cs" />
- <Compile Include="GalleryPages\CellsGalleries\ViewCellGallery.cs" />
- <Compile Include="GalleryPages\AbsoluteLayoutGallery.cs" />
- <Compile Include="GalleryPages\BoundContentPage.cs" />
- <Compile Include="GalleryPages\ButtonGallery.cs" />
- <Compile Include="GalleryPages\CellTypeList.cs" />
- <Compile Include="GalleryPages\ClipToBoundsGallery.cs" />
- <Compile Include="GalleryPages\DisposeGallery.cs" />
- <Compile Include="GalleryPages\EditorGallery.cs" />
- <Compile Include="GalleryPages\EntryGallery.cs" />
- <Compile Include="GalleryPages\FrameGallery.cs" />
- <Compile Include="GalleryPages\GroupedListActionsGallery.cs" />
- <Compile Include="GalleryPages\GroupedListContactsGallery.cs" />
- <Compile Include="GalleryPages\ImageGallery.cs" />
- <Compile Include="GalleryPages\InputIntentGallery.cs" />
- <Compile Include="GalleryPages\LabelGallery.cs" />
- <Compile Include="GalleryPages\LayoutOptionsGallery.cs" />
- <Compile Include="GalleryPages\ListPage.cs" />
- <Compile Include="GalleryPages\ListViewDemoPage.cs" />
- <Compile Include="GalleryPages\MapGallery.cs" />
- <Compile Include="GalleryPages\MinimumSizeGallery.cs" />
- <Compile Include="GalleryPages\MultiGallery.cs" />
- <Compile Include="GalleryPages\NavigationBarGallery.cs" />
- <Compile Include="GalleryPages\NavigationMenuGallery.cs" />
- <Compile Include="GalleryPages\OpenGLGallery.cs" />
- <Compile Include="GalleryPages\ProgressBarGallery.cs" />
- <Compile Include="GalleryPages\RelativeLayoutGallery.cs" />
- <Compile Include="GalleryPages\ScrollGallery.cs" />
- <Compile Include="GalleryPages\SearchBarGallery.cs" />
- <Compile Include="GalleryPages\SettingsPage.cs" />
- <Compile Include="GalleryPages\SliderGallery.cs" />
- <Compile Include="GalleryPages\StackLayoutGallery.cs" />
- <Compile Include="GalleryPages\SwitchGallery.cs" />
- <Compile Include="GalleryPages\TableViewGallery.cs" />
- <Compile Include="GalleryPages\TemplatedCarouselGallery.cs" />
- <Compile Include="GalleryPages\TemplatedTabbedGallery.cs" />
- <Compile Include="GalleryPages\UnevenListGallery.cs" />
- <Compile Include="GalleryPages\WebViewGallery.cs" />
- <Compile Include="GalleryPages\StyleGallery.cs" />
- <Compile Include="GalleryPages\StyleXamlGallery.xaml.cs">
- <DependentUpon>StyleXamlGallery.xaml</DependentUpon>
- </Compile>
- <Compile Include="GalleryPages\MasterDetailPageTabletPage.cs" />
- <Compile Include="Helpers\ITestCloudService.cs" />
- <Compile Include="ControlGalleryPages\ToolbarItems.cs" />
- <Compile Include="GalleryPages\AlertGallery.cs" />
- <Compile Include="RootPages\RootMDPNavigationTabbedContentPage.cs" />
- <Compile Include="Controls\Issue3076Button.cs" />
- <Compile Include="ControlGalleryPages\ListRefresh.cs" />
- <Compile Include="ControlGalleryPages\PinchGestureTestPage.cs" />
- <Compile Include="ControlGalleryPages\AppearingGalleryPage.cs" />
- <Compile Include="ControlGalleryPages\AutomationIDGallery.cs" />
- <Compile Include="GalleryPages\AppLinkPageGallery.cs" />
- <Compile Include="ControlGalleryPages\NativeBindingGalleryPage.cs" />
- <Compile Include="GalleryPages\XamlNativeViews.xaml.cs">
- <DependentUpon>XamlNativeViews.xaml</DependentUpon>
- </Compile>
- <Compile Include="HanselForms\BaseView.cs" />
- <Compile Include="HanselForms\HBaseViewModel.cs" />
- <Compile Include="HanselForms\RootPage.cs" />
- <Compile Include="HanselForms\WebsiteView.cs" />
- <Compile Include="HanselForms\BlogPage.xaml.cs">
- <DependentUpon>BlogPage.xaml</DependentUpon>
- </Compile>
- <Compile Include="HanselForms\MyAbout.xaml.cs">
- <DependentUpon>MyAbout.xaml</DependentUpon>
- </Compile>
- <Compile Include="HanselForms\TwitterPage.xaml.cs">
- <DependentUpon>TwitterPage.xaml</DependentUpon>
- </Compile>
- <Compile Include="GalleryPages\MacTwitterDemo.xaml.cs">
- <DependentUpon>MacTwitterDemo.xaml</DependentUpon>
- </Compile>
- </ItemGroup>
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
- <Import Project="..\.nuspec\Xamarin.Forms.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{CB9C96CE-125C-4A68-B6A1-C3FF1FBF93E1}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Xamarin.Forms.Controls</RootNamespace>
+ <AssemblyName>Xamarin.Forms.Controls</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;PERF;APP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <NoWarn>0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;APP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <NoWarn>0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\Turkey\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;PERF;APP</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <WarningLevel>4</WarningLevel>
+ <Optimize>false</Optimize>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <NoWarn>0114;0108;0109;4014;0649;0169;0472;0414;0168;0219;0429</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .NET Framework is automatically included -->
+ <ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
+ <Project>{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}</Project>
+ <Name>Xamarin.Forms.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Xamarin.Forms.Build.Tasks\Xamarin.Forms.Build.Tasks.csproj">
+ <Project>{96D89208-4EB9-4451-BE73-8A9DF3D9D7B7}</Project>
+ <Name>Xamarin.Forms.Build.Tasks</Name>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Xamarin.Forms.CustomAttributes\Xamarin.Forms.CustomAttributes.csproj">
+ <Project>{4dcd0420-1168-4b77-86db-6196ee4bd491}</Project>
+ <Name>Xamarin.Forms.CustomAttributes</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Xamarin.Forms.Maps\Xamarin.Forms.Maps.csproj">
+ <Project>{7d13bac2-c6a4-416a-b07e-c169b199e52b}</Project>
+ <Name>Xamarin.Forms.Maps</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Xamarin.Forms.Pages\Xamarin.Forms.Pages.csproj">
+ <Project>{d6133dbd-6c60-4bd5-bea2-07e0a3927c31}</Project>
+ <Name>Xamarin.Forms.Pages</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Xamarin.Forms.Xaml\Xamarin.Forms.Xaml.csproj">
+ <Project>{9db2f292-8034-4e06-89ad-98bbda4306b9}</Project>
+ <Name>Xamarin.Forms.Xaml</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App.cs" />
+ <Compile Include="AppLifeCycle.cs" />
+ <Compile Include="Bugzilla44596SplashPage.cs" />
+ <Compile Include="ControlGalleryPages\CellForceUpdateSizeGalleryPage.cs" />
+ <Compile Include="ControlGalleryPages\LayoutAddPerformance.xaml.cs">
+ <DependentUpon>LayoutAddPerformance.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="ControlGalleryPages\ListScrollTo.cs" />
+ <Compile Include="ControlGalleryPages\NavBarTitleTestPage.cs" />
+ <Compile Include="ControlGalleryPages\NestedNativeControlGalleryPage.cs" />
+ <Compile Include="ControlGalleryPages\PanGestureGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\KeyboardCoreGalleryPage.cs" />
+ <Compile Include="GalleryPages\BackgroundImageGallery.cs" />
+ <Compile Include="GalleryPages\ControlTemplatePage.cs" />
+ <Compile Include="GalleryPages\ControlTemplateXamlPage.xaml.cs">
+ <DependentUpon>ControlTemplateXamlPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GalleryPages\LayoutPerformanceGallery.cs" />
+ <Compile Include="GalleryPages\NavigationPropertiesGallery.cs" />
+ <Compile Include="ControlGalleryPages\ListViewSelectionColor.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\ApplicationAndroid.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\EntryPageiOS.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\MasterDetailPageiOS.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\MasterDetailPageWindows.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\NavigationPageiOS.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\NavigationPageWindows.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\TabbedPageAndroid.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\TabbedPageiOS.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\TabbedPageWindows.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\VisualElementiOS.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGalleries\WindowsPlatformSpecificsGalleryHelpers.cs" />
+ <Compile Include="GalleryPages\PlatformSpecificsGallery.cs" />
+ <Compile Include="LegacyRepro\Page1.xaml.cs">
+ <DependentUpon>Page1.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainPageLifeCycleTests.cs" />
+ <Compile Include="NavReproApp.cs" />
+ <Compile Include="RootPages\RootContentPage.cs" />
+ <Compile Include="RootPages\SwapHierachyStackLayout.cs" />
+ <Compile Include="GalleryPages\EditableList.cs" />
+ <Compile Include="CoreGalleryPages\EditorCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\EntryCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\FrameCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\ImageCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\LabelCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\ListViewCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\OpenGLViewCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\PickerCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\ProgressBarCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\SearchBarCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\SliderCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\StepperCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\SwitchCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\TableViewCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\TimePickerCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\WebViewCoreGalleryPage.cs" />
+ <Compile Include="LegacyRepro\SampleViewCell.xaml.cs">
+ <DependentUpon>SampleViewCell.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="SimpleApp.cs" />
+ <Compile Include="ViewContainers\EventViewContainer.cs" />
+ <Compile Include="ViewContainers\LayeredViewContainer.cs" />
+ <Compile Include="ViewContainers\MultiBindingHack.cs" />
+ <Compile Include="ViewContainers\StateViewContainer.cs" />
+ <Compile Include="ViewContainers\ValueViewContainer.cs" />
+ <Compile Include="ViewContainers\ViewContainer.cs" />
+ <Compile Include="CoreGalleryPages\ActivityIndicatorCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\CoreBoxViewGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\ButtonCoreGalleryPage.cs" />
+ <Compile Include="CoreGallery.cs" />
+ <Compile Include="CoreGalleryPages\DatePickerCoreGalleryPage.cs" />
+ <Compile Include="CoreGalleryPages\CoreGalleryPage.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="TestCases.cs" />
+ <Compile Include="GalleryPages\GridGallery.cs" />
+ <Compile Include="GalleryPages\PickerGallery.cs" />
+ <Compile Include="GalleryPages\ImageLoadingGallery.cs" />
+ <Compile Include="GalleryPages\CarouselPageGallery.cs" />
+ <Compile Include="GalleryPages\StepperGallery.cs" />
+ <Compile Include="GalleryPages\ScaleRotate.cs" />
+ <Compile Include="GalleryPages\LineBreakModeGallery.cs" />
+ <Compile Include="GalleryPages\ActionSheetGallery.cs" />
+ <Compile Include="GalleryPages\XamlPage.xaml.cs">
+ <DependentUpon>XamlPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="RootPages\RootTabbedContentPage.cs" />
+ <Compile Include="RootPages\RootTabbedNavigationContentPage.cs" />
+ <Compile Include="RootPages\RootNavigationContentPage.cs" />
+ <Compile Include="RootPages\RootNavigationTabbedContentPage.cs" />
+ <Compile Include="RootPages\RootMDPNavigationContentPage.cs" />
+ <Compile Include="RootPages\RootTabbedMDPNavigationContentPage.cs" />
+ <Compile Include="RootPages\RootTabbedManyNavigationContentPage.cs" />
+ <Compile Include="RootPages\RootNavigationManyTabbedPage.cs" />
+ <Compile Include="ControlGalleryPages\BehaviorsAndTriggers.xaml.cs">
+ <DependentUpon>BehaviorsAndTriggers.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GalleryPages\CellsGalleries\EntryCellListPage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\EntryCellTablePage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\ImageCellListPage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\ImageCellTablePage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\ProductViewCell.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\SwitchCellListPage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\SwitchCellTablePage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\TextCellListPage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\TextCellTablePage.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\UnEvenViewCellGallery.cs" />
+ <Compile Include="GalleryPages\CellsGalleries\ViewCellGallery.cs" />
+ <Compile Include="GalleryPages\AbsoluteLayoutGallery.cs" />
+ <Compile Include="GalleryPages\BoundContentPage.cs" />
+ <Compile Include="GalleryPages\ButtonGallery.cs" />
+ <Compile Include="GalleryPages\CellTypeList.cs" />
+ <Compile Include="GalleryPages\ClipToBoundsGallery.cs" />
+ <Compile Include="GalleryPages\DisposeGallery.cs" />
+ <Compile Include="GalleryPages\EditorGallery.cs" />
+ <Compile Include="GalleryPages\EntryGallery.cs" />
+ <Compile Include="GalleryPages\FrameGallery.cs" />
+ <Compile Include="GalleryPages\GroupedListActionsGallery.cs" />
+ <Compile Include="GalleryPages\GroupedListContactsGallery.cs" />
+ <Compile Include="GalleryPages\ImageGallery.cs" />
+ <Compile Include="GalleryPages\InputIntentGallery.cs" />
+ <Compile Include="GalleryPages\LabelGallery.cs" />
+ <Compile Include="GalleryPages\LayoutOptionsGallery.cs" />
+ <Compile Include="GalleryPages\ListPage.cs" />
+ <Compile Include="GalleryPages\ListViewDemoPage.cs" />
+ <Compile Include="GalleryPages\MapGallery.cs" />
+ <Compile Include="GalleryPages\MinimumSizeGallery.cs" />
+ <Compile Include="GalleryPages\MultiGallery.cs" />
+ <Compile Include="GalleryPages\NavigationBarGallery.cs" />
+ <Compile Include="GalleryPages\NavigationMenuGallery.cs" />
+ <Compile Include="GalleryPages\OpenGLGallery.cs" />
+ <Compile Include="GalleryPages\ProgressBarGallery.cs" />
+ <Compile Include="GalleryPages\RelativeLayoutGallery.cs" />
+ <Compile Include="GalleryPages\ScrollGallery.cs" />
+ <Compile Include="GalleryPages\SearchBarGallery.cs" />
+ <Compile Include="GalleryPages\SettingsPage.cs" />
+ <Compile Include="GalleryPages\SliderGallery.cs" />
+ <Compile Include="GalleryPages\StackLayoutGallery.cs" />
+ <Compile Include="GalleryPages\SwitchGallery.cs" />
+ <Compile Include="GalleryPages\TableViewGallery.cs" />
+ <Compile Include="GalleryPages\TemplatedCarouselGallery.cs" />
+ <Compile Include="GalleryPages\TemplatedTabbedGallery.cs" />
+ <Compile Include="GalleryPages\UnevenListGallery.cs" />
+ <Compile Include="GalleryPages\WebViewGallery.cs" />
+ <Compile Include="GalleryPages\StyleGallery.cs" />
+ <Compile Include="GalleryPages\StyleXamlGallery.xaml.cs">
+ <DependentUpon>StyleXamlGallery.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GalleryPages\MasterDetailPageTabletPage.cs" />
+ <Compile Include="Helpers\ITestCloudService.cs" />
+ <Compile Include="ControlGalleryPages\ToolbarItems.cs" />
+ <Compile Include="GalleryPages\AlertGallery.cs" />
+ <Compile Include="RootPages\RootMDPNavigationTabbedContentPage.cs" />
+ <Compile Include="Controls\Issue3076Button.cs" />
+ <Compile Include="ControlGalleryPages\ListRefresh.cs" />
+ <Compile Include="ControlGalleryPages\PinchGestureTestPage.cs" />
+ <Compile Include="ControlGalleryPages\AppearingGalleryPage.cs" />
+ <Compile Include="ControlGalleryPages\AutomationIDGallery.cs" />
+ <Compile Include="GalleryPages\AppLinkPageGallery.cs" />
+ <Compile Include="ControlGalleryPages\NativeBindingGalleryPage.cs" />
+ <Compile Include="GalleryPages\XamlNativeViews.xaml.cs">
+ <DependentUpon>XamlNativeViews.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="HanselForms\BaseView.cs" />
+ <Compile Include="HanselForms\HBaseViewModel.cs" />
+ <Compile Include="HanselForms\RootPage.cs" />
+ <Compile Include="HanselForms\WebsiteView.cs" />
+ <Compile Include="HanselForms\BlogPage.xaml.cs">
+ <DependentUpon>BlogPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="HanselForms\MyAbout.xaml.cs">
+ <DependentUpon>MyAbout.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="HanselForms\TwitterPage.xaml.cs">
+ <DependentUpon>TwitterPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="GalleryPages\MacTwitterDemo.xaml.cs">
+ <DependentUpon>MacTwitterDemo.xaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Import Project="..\.nuspec\Xamarin.Forms.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
- <ItemGroup>
- <EmbeddedResource Include="GalleryPages\crimson.jpg" />
- <EmbeddedResource Include="GalleryPages\XamlPage.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="ControlGalleryPages\BehaviorsAndTriggers.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="GalleryPages\StyleXamlGallery.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="GalleryPages\XamlNativeViews.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="GalleryPages\MacTwitterDemo.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="HanselForms\MyAbout.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="HanselForms\BlogPage.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="HanselForms\TwitterPage.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- </ItemGroup>
- <Import Project="..\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
- <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
- <Import Project="..\packages\Xamarin.Insights.1.11.1\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.11.1\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
- <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
- <PropertyGroup>
- <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
- </PropertyGroup>
- <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
- </Target>
- <ItemGroup>
- <EmbeddedResource Include="ControlGalleryPages\LayoutAddPerformance.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="GalleryPages\ControlTemplateXamlPage.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- <EmbeddedResource Include="controlgallery.config" />
- <None Include="packages.config" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="LegacyRepro\Page1.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="LegacyRepro\SampleViewCell.xaml">
- <Generator>MSBuild:UpdateDeisgnTimeXaml</Generator>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <Reference Include="PCLStorage, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
- <HintPath>..\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="PCLStorage.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
- <HintPath>..\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.Abstractions.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="Xamarin.Insights">
- <HintPath>..\packages\Xamarin.Insights.1.12.3\lib\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.dll</HintPath>
- </Reference>
- <Reference Include="System.Net.Http">
- <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll</HintPath>
- </Reference>
- <Reference Include="System.Net.Http.Extensions">
- <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll</HintPath>
- </Reference>
- <Reference Include="System.Net.Http.Primitives">
- <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Target Name="BeforeBuild">
- <CreateItem Include="blank.config">
- <Output TaskParameter="Include" ItemName="ConfigFile" />
- </CreateItem>
- <Copy SourceFiles="@(ConfigFile)" DestinationFiles="controlgallery.config" Condition="!Exists('controlgallery.config')" />
- </Target>
- <Import Project="..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
+ <ItemGroup>
+ <EmbeddedResource Include="GalleryPages\crimson.jpg" />
+ <EmbeddedResource Include="GalleryPages\XamlPage.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ControlGalleryPages\BehaviorsAndTriggers.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="GalleryPages\StyleXamlGallery.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="GalleryPages\XamlNativeViews.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="GalleryPages\MacTwitterDemo.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="HanselForms\MyAbout.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="HanselForms\BlogPage.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="HanselForms\TwitterPage.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="..\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
+ <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Import Project="..\packages\Xamarin.Insights.1.11.1\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.11.1\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
+ </Target>
+ <ItemGroup>
+ <EmbeddedResource Include="ControlGalleryPages\LayoutAddPerformance.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="GalleryPages\ControlTemplateXamlPage.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ <EmbeddedResource Include="controlgallery.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="LegacyRepro\Page1.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="LegacyRepro\SampleViewCell.xaml">
+ <Generator>MSBuild:UpdateDeisgnTimeXaml</Generator>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="PCLStorage, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
+ <HintPath>..\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="PCLStorage.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
+ <HintPath>..\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.Abstractions.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Xamarin.Insights">
+ <HintPath>..\packages\Xamarin.Insights.1.12.3\lib\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http">
+ <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.Extensions">
+ <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http.Primitives">
+ <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <Target Name="BeforeBuild">
+ <CreateItem Include="blank.config">
+ <Output TaskParameter="Include" ItemName="ConfigFile" />
+ </CreateItem>
+ <Copy SourceFiles="@(ConfigFile)" DestinationFiles="controlgallery.config" Condition="!Exists('controlgallery.config')" />
+ </Target>
+ <Import Project="..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
</Project> \ No newline at end of file
diff --git a/Xamarin.Forms.Core.UnitTests/ButtonUnitTest.cs b/Xamarin.Forms.Core.UnitTests/ButtonUnitTest.cs
index eef9dfc9..d590f8c3 100644
--- a/Xamarin.Forms.Core.UnitTests/ButtonUnitTest.cs
+++ b/Xamarin.Forms.Core.UnitTests/ButtonUnitTest.cs
@@ -35,7 +35,7 @@ namespace Xamarin.Forms.Core.UnitTests
}
[Test]
- public void TestClickedvent ()
+ public void TestTappedEvent ()
{
var view = new Button ();
@@ -47,32 +47,6 @@ namespace Xamarin.Forms.Core.UnitTests
Assert.True (activated);
}
- [Test]
- public void TestPressedEvent ()
- {
- var view = new Button();
-
- bool pressed = false;
- view.Pressed += (sender, e) => pressed = true;
-
- ((IButtonController)view).SendPressed();
-
- Assert.True(pressed);
- }
-
- [Test]
- public void TestReleasedEvent ()
- {
- var view = new Button();
-
- bool released = false;
- view.Released += (sender, e) => released = true;
-
- ((IButtonController)view).SendReleased();
-
- Assert.True(released);
- }
-
protected override Button CreateSource()
{
return new Button();
diff --git a/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs b/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs
index 2107513d..3cd91ed7 100644
--- a/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs
+++ b/Xamarin.Forms.Core.UnitTests/MessagingCenterTests.cs
@@ -246,7 +246,7 @@ namespace Xamarin.Forms.Core.UnitTests
GC.Collect();
GC.WaitForPendingFinalizers();
-
+
Assert.IsTrue(wr.IsAlive); // The closure in Subscribe should be keeping the subscriber alive
Assert.IsNotNull(wr.Target as TestSubcriber);
@@ -272,10 +272,10 @@ namespace Xamarin.Forms.Core.UnitTests
MessagingCenter.Subscribe<TestPublisher>(subscriber, "test", p => subscriber.SetSuccess());
})();
- Assert.IsNotNull(wr.Target as TestSubcriber);
+ Assert.IsNotNull(wr.Target as TestSubcriber);
MessagingCenter.Unsubscribe<TestPublisher>(wr.Target, "test");
-
+
GC.Collect();
GC.WaitForPendingFinalizers();
@@ -309,12 +309,12 @@ namespace Xamarin.Forms.Core.UnitTests
var source = new MessagingCenterTestsCallbackSource();
MessagingCenter.Subscribe<TestPublisher>(_subscriber, "test", p => source.SuccessCallback(ref success));
-
+
GC.Collect();
GC.WaitForPendingFinalizers();
var pub = new TestPublisher();
- pub.Test();
+ pub.Test();
Assert.True(success); // TestCallbackSource.SuccessCallback() should be invoked to make success == true
}
@@ -372,70 +372,5 @@ namespace Xamarin.Forms.Core.UnitTests
i = i + 1;
}
}
-
- [Test(Description = "This is a demonstration of what a test with a fake/mock/substitute IMessagingCenter might look like")]
- public void TestMessagingCenterSubstitute()
- {
- var mc = new FakeMessagingCenter();
-
- // In the real world, you'd construct this with `new ComponentWithMessagingDependency(MessagingCenter.Instance);`
- var component = new ComponentWithMessagingDependency(mc);
- component.DoAThing();
-
- Assert.IsTrue(mc.WasSubscribeCalled, "ComponentWithMessagingDependency should have subscribed in its constructor");
- Assert.IsTrue(mc.WasSendCalled, "The DoAThing method should send a message");
- }
-
- class ComponentWithMessagingDependency
- {
- readonly IMessagingCenter _messagingCenter;
-
- public ComponentWithMessagingDependency(IMessagingCenter messagingCenter)
- {
- _messagingCenter = messagingCenter;
- _messagingCenter.Subscribe<ComponentWithMessagingDependency>(this, "test", dependency => Console.WriteLine("test"));
- }
-
- public void DoAThing()
- {
- _messagingCenter.Send(this, "test");
- }
- }
-
- internal class FakeMessagingCenter : IMessagingCenter
- {
- public bool WasSubscribeCalled { get; private set; }
- public bool WasSendCalled { get; private set; }
-
- public void Send<TSender, TArgs>(TSender sender, string message, TArgs args) where TSender : class
- {
- WasSendCalled = true;
- }
-
- public void Send<TSender>(TSender sender, string message) where TSender : class
- {
- WasSendCalled = true;
- }
-
- public void Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source = default(TSender)) where TSender : class
- {
- WasSubscribeCalled = true;
- }
-
- public void Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source = default(TSender)) where TSender : class
- {
- WasSubscribeCalled = true;
- }
-
- public void Unsubscribe<TSender, TArgs>(object subscriber, string message) where TSender : class
- {
-
- }
-
- public void Unsubscribe<TSender>(object subscriber, string message) where TSender : class
- {
-
- }
- }
}
}
diff --git a/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs b/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs
index fb68d14e..1cc3ac6a 100644
--- a/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs
+++ b/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs
@@ -14,7 +14,6 @@ namespace Xamarin.Forms.Core.UnitTests
{
NavigationPage nav = new NavigationPage ();
- Assert.IsNull(nav.RootPage);
Assert.IsNull (nav.CurrentPage);
Label child = new Label {Text = "Label"};
@@ -22,9 +21,7 @@ namespace Xamarin.Forms.Core.UnitTests
await nav.Navigation.PushAsync (childRoot);
- Assert.AreSame(childRoot, nav.RootPage);
- Assert.AreSame(childRoot, nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
+ Assert.AreSame (childRoot, nav.CurrentPage);
}
[Test]
@@ -43,26 +40,16 @@ namespace Xamarin.Forms.Core.UnitTests
bool fired = false;
nav.Popped += (sender, e) => fired = true;
-
- Assert.AreSame(childRoot, nav.RootPage);
- Assert.AreNotSame(childRoot2, nav.RootPage);
- Assert.AreNotSame(nav.RootPage, nav.CurrentPage);
-
var popped = await nav.Navigation.PopAsync ();
Assert.True (fired);
- Assert.AreSame(childRoot, nav.RootPage);
- Assert.AreSame(childRoot, nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
+ Assert.AreSame (childRoot, nav.CurrentPage);
Assert.AreEqual (childRoot2, popped);
await nav.PopAsync ();
var last = await nav.Navigation.PopAsync ();
Assert.IsNull (last);
- Assert.IsNotNull(nav.RootPage);
- Assert.IsNotNull(nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
}
[Test]
@@ -70,7 +57,6 @@ namespace Xamarin.Forms.Core.UnitTests
{
NavigationPage nav = new NavigationPage ();
- Assert.IsNull(nav.RootPage);
Assert.IsNull (nav.CurrentPage);
Label child = new Label {Text = "Label"};
@@ -78,9 +64,7 @@ namespace Xamarin.Forms.Core.UnitTests
await nav.PushAsync (childRoot);
- Assert.AreSame (childRoot, nav.RootPage);
- Assert.AreSame(childRoot, nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
+ Assert.AreSame (childRoot, nav.CurrentPage);
}
[Test]
@@ -112,15 +96,10 @@ namespace Xamarin.Forms.Core.UnitTests
bool fired = false;
nav.Pushed += (sender, e) => fired = true;
- Assert.AreSame(childRoot, nav.RootPage);
- Assert.AreSame(childRoot, nav.CurrentPage);
-
await nav.PushAsync (childRoot);
Assert.False (fired);
- Assert.AreSame(childRoot, nav.RootPage);
- Assert.AreSame(childRoot, nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
+ Assert.AreEqual (childRoot, nav.CurrentPage);
}
[Test]
@@ -205,9 +184,7 @@ namespace Xamarin.Forms.Core.UnitTests
nav.PopToRootAsync ();
Assert.True (signaled);
- Assert.AreSame (root, nav.RootPage);
- Assert.AreSame(root, nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
+ Assert.AreEqual (root, nav.CurrentPage);
}
[Test]
@@ -232,100 +209,32 @@ namespace Xamarin.Forms.Core.UnitTests
Assert.AreEqual (2, poppedChildren.Count);
Assert.Contains (child1, poppedChildren);
Assert.Contains (child2, poppedChildren);
- Assert.AreSame(root, nav.RootPage);
- Assert.AreSame(root, nav.CurrentPage);
- Assert.AreSame(nav.RootPage, nav.CurrentPage);
- }
-
- [Test]
- public async Task PeekOne()
- {
- var nav = new NavigationPage();
-
- bool signaled = false;
- nav.PoppedToRoot += (sender, args) => signaled = true;
-
- var root = new ContentPage { Content = new View() };
- var child1 = new ContentPage { Content = new View() };
- var child2 = new ContentPage { Content = new View() };
-
- await nav.PushAsync(root);
- await nav.PushAsync(child1);
- await nav.PushAsync(child2);
-
- Assert.AreEqual(((INavigationPageController)nav).Peek(1), child1);
+ Assert.AreEqual (root, nav.CurrentPage);
}
[Test]
- public async Task PeekZero()
+ public async Task TestStackCopy ()
{
- var nav = new NavigationPage();
-
- bool signaled = false;
- nav.PoppedToRoot += (sender, args) => signaled = true;
-
- var root = new ContentPage { Content = new View() };
- var child1 = new ContentPage { Content = new View() };
- var child2 = new ContentPage { Content = new View() };
-
- await nav.PushAsync(root);
- await nav.PushAsync(child1);
- await nav.PushAsync(child2);
-
- Assert.AreEqual(((INavigationPageController)nav).Peek(0), child2);
- Assert.AreEqual(((INavigationPageController)nav).Peek(), child2);
- }
-
- [Test]
- public async Task PeekPastStackDepth()
- {
- var nav = new NavigationPage();
-
- bool signaled = false;
- nav.PoppedToRoot += (sender, args) => signaled = true;
-
- var root = new ContentPage { Content = new View() };
- var child1 = new ContentPage { Content = new View() };
- var child2 = new ContentPage { Content = new View() };
-
- await nav.PushAsync(root);
- await nav.PushAsync(child1);
- await nav.PushAsync(child2);
-
- Assert.AreEqual(((INavigationPageController)nav).Peek(3), null);
- }
-
- [Test]
- public async Task PeekShallow()
- {
- var nav = new NavigationPage();
+ var nav = new NavigationPage ();
bool signaled = false;
nav.PoppedToRoot += (sender, args) => signaled = true;
- var root = new ContentPage { Content = new View() };
- var child1 = new ContentPage { Content = new View() };
- var child2 = new ContentPage { Content = new View() };
-
- await nav.PushAsync(root);
- await nav.PushAsync(child1);
- await nav.PushAsync(child2);
-
- Assert.AreEqual(((INavigationPageController)nav).Peek(-1), null);
- }
+ var root = new ContentPage {Content = new View ()};
+ var child1 = new ContentPage {Content = new View ()};
+ var child2 = new ContentPage {Content = new View ()};
- [Test]
- public async Task PeekEmpty([Range(0, 3)] int depth)
- {
- var nav = new NavigationPage();
+ await nav.PushAsync (root);
+ await nav.PushAsync (child1);
+ await nav.PushAsync (child2);
- bool signaled = false;
- nav.PoppedToRoot += (sender, args) => signaled = true;
+ var copy = ((INavigationPageController)nav).StackCopy;
- Assert.AreEqual(((INavigationPageController)nav).Peek(depth), null);
+ Assert.AreEqual (child2, copy.Pop ());
+ Assert.AreEqual (child1, copy.Pop ());
+ Assert.AreEqual (root, copy.Pop ());
}
-
[Test]
public void ConstructWithRoot ()
{
@@ -483,72 +392,6 @@ namespace Xamarin.Forms.Core.UnitTests
Assert.False (result);
}
- [Test]
- public void TestInsertPage()
- {
- var root = new ContentPage { Title = "Root" };
- var newPage = new ContentPage();
- var navPage = new NavigationPage(root);
-
- navPage.Navigation.InsertPageBefore(newPage, navPage.RootPage);
-
- Assert.AreSame(newPage, navPage.RootPage);
- Assert.AreNotSame(newPage, navPage.CurrentPage);
- Assert.AreNotSame(navPage.RootPage, navPage.CurrentPage);
- Assert.AreSame(root, navPage.CurrentPage);
-
- Assert.Throws<ArgumentException>(() =>
- {
- navPage.Navigation.InsertPageBefore(new ContentPage(), new ContentPage());
- });
-
- Assert.Throws<ArgumentException>(() =>
- {
- navPage.Navigation.InsertPageBefore(navPage.RootPage, navPage.CurrentPage);
- });
-
- Assert.Throws<ArgumentNullException>(() =>
- {
- navPage.Navigation.InsertPageBefore(null, navPage.CurrentPage);
- });
-
- Assert.Throws<ArgumentNullException>(() =>
- {
- navPage.Navigation.InsertPageBefore(new ContentPage(), null);
- });
- }
-
- [Test]
- public async void TestRemovePage()
- {
- var root = new ContentPage { Title = "Root" };
- var newPage = new ContentPage();
- var navPage = new NavigationPage(root);
- await navPage.PushAsync(newPage);
-
- navPage.Navigation.RemovePage(root);
-
- Assert.AreSame(newPage, navPage.RootPage);
- Assert.AreSame(newPage, navPage.CurrentPage);
- Assert.AreSame(navPage.RootPage, navPage.CurrentPage);
- Assert.AreNotSame(root, navPage.CurrentPage);
-
- Assert.Throws<ArgumentException>(() =>
- {
- navPage.Navigation.RemovePage(root);
- });
-
- Assert.Throws<InvalidOperationException>(() =>
- {
- navPage.Navigation.RemovePage(newPage);
- });
-
- Assert.Throws<ArgumentNullException>(() =>
- {
- navPage.Navigation.RemovePage(null);
- });
- }
-
[Test (Description = "CurrentPage should not be set to null when you attempt to pop the last page")]
[Property ("Bugzilla", 28335)]
public async Task CurrentPageNotNullPoppingRoot()
diff --git a/Xamarin.Forms.Core.UnitTests/RelativeLayoutTests.cs b/Xamarin.Forms.Core.UnitTests/RelativeLayoutTests.cs
index fdbcdfc0..96b3dfc8 100644
--- a/Xamarin.Forms.Core.UnitTests/RelativeLayoutTests.cs
+++ b/Xamarin.Forms.Core.UnitTests/RelativeLayoutTests.cs
@@ -75,47 +75,6 @@ namespace Xamarin.Forms.Core.UnitTests
}
[Test]
- public void LayoutIsUpdatedWhenConstraintsChange()
- {
- var relativeLayout = new RelativeLayout
- {
- Platform = new UnitPlatform(),
- IsPlatformEnabled = true
- };
-
- var child = new View
- {
- IsPlatformEnabled = true
- };
-
- relativeLayout.Children.Add(child,
- Constraint.Constant(30),
- Constraint.Constant(20),
- Constraint.RelativeToParent(parent => parent.Height / 2),
- Constraint.RelativeToParent(parent => parent.Height / 4));
-
- relativeLayout.Layout(new Rectangle(0, 0, 100, 100));
-
- Assert.AreEqual(new Rectangle(30, 20, 50, 25), child.Bounds);
-
- RelativeLayout.SetXConstraint(child, Constraint.Constant(40));
-
- Assert.AreEqual(new Rectangle(40, 20, 50, 25), child.Bounds);
-
- RelativeLayout.SetYConstraint(child, Constraint.Constant(10));
-
- Assert.AreEqual(new Rectangle(40, 10, 50, 25), child.Bounds);
-
- RelativeLayout.SetWidthConstraint(child, Constraint.RelativeToParent(parent => parent.Height / 4));
-
- Assert.AreEqual(new Rectangle(40, 10, 25, 25), child.Bounds);
-
- RelativeLayout.SetHeightConstraint(child, Constraint.RelativeToParent(parent => parent.Height / 2));
-
- Assert.AreEqual(new Rectangle(40, 10, 25, 50), child.Bounds);
- }
-
- [Test]
public void SimpleExpressionLayout ()
{
var relativeLayout = new RelativeLayout {
diff --git a/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs b/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs
index 9a2c6f01..e5b8b60d 100644
--- a/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs
+++ b/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs
@@ -292,19 +292,5 @@ namespace Xamarin.Forms.Core.UnitTests
Assert.True(rd0.TryGetMergedValue("foo", out _));
Assert.AreEqual("Foo", _);
}
-
- [Test]
- public void ThrowOnDuplicateKey()
- {
- var rd0 = new ResourceDictionary();
- rd0.Add("foo", "Foo");
- try {
- rd0.Add("foo", "Bar");
- } catch (ArgumentException ae) {
- Assert.AreEqual("A resource with the key 'foo' is already present in the ResourceDictionary.", ae.Message);
- Assert.Pass();
- }
- Assert.Fail();
- }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj b/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
index f297b073..0758b8bd 100644
--- a/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
+++ b/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
@@ -209,9 +209,6 @@
<Name>Xamarin.Forms.Platform</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
<Import Project="..\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs b/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs
index b0fc8f79..1c9d6c49 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs
@@ -78,17 +78,11 @@ namespace Xamarin.Forms.Core.UITests
}
- while (true)
- {
-#if __MACOS__
- var result = App.Query(o => o.Raw(ViewQuery));
-#else
+ while (true) {
var result = App.Query (o => o.Raw(ContainerQuery));
-#endif
-
- if (result.Any())
+ if (result.Any ())
break;
- App.Tap(o => o.Raw("* marked:'MoveNextButton'"));
+ App.Tap (o => o.Raw ("* marked:'MoveNextButton'"));
}
//Assert.True (App.ScrollForElement (
@@ -145,33 +139,13 @@ namespace Xamarin.Forms.Core.UITests
#if __ANDROID__
isEdgeCase = (formProperty == View.ScaleProperty);
#endif
- if (!isEdgeCase)
- {
- found =
- MaybeGetProperty<string>(App, query, propertyPath, out prop) ||
- MaybeGetProperty<float>(App, query, propertyPath, out prop) ||
- MaybeGetProperty<bool>(App, query, propertyPath, out prop) ||
- MaybeGetProperty<object>(App, query, propertyPath, out prop);
- }
-#if __MACOS__
- if (!found)
- {
-
- if (formProperty == View.IsEnabledProperty)
- {
- var view = App.Query((arg) => arg.Raw(query)).FirstOrDefault();
- found = view != null;
- prop = view.Enabled;
- }
-
- if (formProperty == Button.TextProperty)
- {
- var view = App.Query((arg) => arg.Raw(query)).FirstOrDefault();
- found = view != null;
- prop = view.Text;
- }
- }
-#endif
+ if (!isEdgeCase) {
+ found =
+ MaybeGetProperty<string> (App, query, propertyPath, out prop) ||
+ MaybeGetProperty<float> (App, query, propertyPath, out prop) ||
+ MaybeGetProperty<bool> (App, query, propertyPath, out prop) ||
+ MaybeGetProperty<object> (App, query, propertyPath, out prop);
+ }
#if __ANDROID__
if (formProperty == View.ScaleProperty) {
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs
index 88d280e5..0f74d6de 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs
@@ -1,4 +1,7 @@
using NUnit.Framework;
+using Xamarin.UITest;
+using System;
+using System.Threading;
using Xamarin.UITest.Queries;
namespace Xamarin.Forms.Core.UITests
@@ -9,157 +12,158 @@ namespace Xamarin.Forms.Core.UITests
{
AppRect screenSize;
- protected override void NavigateToGallery()
+ public ActionSheetUITests ()
{
- App.NavigateToGallery(GalleryQueries.ActionSheetGallery);
+
}
- static void CheckExtras()
+ protected override void NavigateToGallery ()
+ {
+ App.NavigateToGallery (GalleryQueries.ActionSheetGallery);
+ }
+
+ static void CheckExtras ()
{
App.WaitForElement(c => c.Marked("Extra One"));
App.WaitForElement(c => c.Marked("Extra Six"));
}
- protected override void TestSetup()
+ protected override void TestSetup ()
{
- base.TestSetup();
-#if !__MACOS__
- screenSize = App.Query(q => q.Marked("ActionSheetPage"))[0].Rect;
-#endif
+ base.TestSetup ();
+ screenSize = App.Query (q => q.Marked ("ActionSheetPage"))[0].Rect;
}
[Test]
- public void TestDisplayActionSheet()
+ public void TestDisplayActionSheet ()
{
- ScrollAndTap("ActionSheet Extras");
- CheckExtras();
- App.Tap(c => c.Marked("Extra One"));
+ ScrollAndTap ("ActionSheet Extras");
+ CheckExtras ();
+ App.Tap (c => c.Marked ("Extra One"));
}
-
+
[Test]
- public void TestDisplayActionSheetCancel()
+ public void TestDisplayActionSheetCancel ()
{
- ScrollAndTap("ActionSheet Cancel");
+ ScrollAndTap ("ActionSheet Cancel");
// iPad does not have a Cancel button for action sheet
- if (App.Query(q => q.Marked("Cancel")).Length > 0)
- App.Tap(c => c.Marked("Cancel"));
+ if (App.Query (q => q.Marked ("Cancel")).Length > 0)
+ App.Tap (c => c.Marked ("Cancel"));
else
- App.TapCoordinates(20, screenSize.Height / 2);
+ App.TapCoordinates (20, screenSize.Height / 2);
}
[Test]
- public void TestDisplayActionSheetCancelDestruction()
+ public void TestDisplayActionSheetCancelDestruction ()
{
- ScrollAndTap("ActionSheet Cancel Destruction");
- App.WaitForNoElement(c => c.Marked("Extra One"));
- App.WaitForElement(c => c.Marked("Destruction"));
- if (App.Query(q => q.Marked("Cancel")).Length > 0)
- App.Tap(c => c.Marked("Cancel"));
+ ScrollAndTap ("ActionSheet Cancel Destruction");
+ App.WaitForNoElement (c => c.Marked ("Extra One"));
+ App.WaitForElement (c => c.Marked ("Destruction"));
+ if (App.Query (q => q.Marked ("Cancel")).Length > 0)
+ App.Tap (c => c.Marked ("Cancel"));
else
- App.TapCoordinates(20, screenSize.Height / 2);
+ App.TapCoordinates (20, screenSize.Height / 2);
}
[Test]
- public void TestDisplayActionSheetCancelExtras()
+ public void TestDisplayActionSheetCancelExtras ()
{
- ScrollAndTap("ActionSheet Cancel Extras");
- CheckExtras();
- if (App.Query(q => q.Marked("Cancel")).Length > 0)
- App.Tap(c => c.Marked("Cancel"));
+ ScrollAndTap ("ActionSheet Cancel Extras");
+ CheckExtras ();
+ if (App.Query (q => q.Marked ("Cancel")).Length > 0)
+ App.Tap (c => c.Marked ("Cancel"));
else
- App.TapCoordinates(20, screenSize.Height / 2);
+ App.TapCoordinates (20, screenSize.Height / 2);
}
[Test]
- public void TestDisplayActionSheetCancelExtrasDestruction()
+ public void TestDisplayActionSheetCancelExtrasDestruction ()
{
- ScrollAndTap("ActionSheet Cancel Destruction Extras");
- CheckExtras();
- App.WaitForElement(c => c.Marked("Destruction"));
- if (App.Query(q => q.Marked("Cancel")).Length > 0)
- App.Tap(c => c.Marked("Cancel"));
+ ScrollAndTap ("ActionSheet Cancel Destruction Extras");
+ CheckExtras ();
+ App.WaitForElement (c => c.Marked ("Destruction"));
+ if (App.Query (q => q.Marked ("Cancel")).Length > 0)
+ App.Tap (c => c.Marked ("Cancel"));
else
- App.TapCoordinates(20, screenSize.Height / 2);
+ App.TapCoordinates (20, screenSize.Height / 2);
}
[Test]
- public void TestDisplayActionSheetDestruction()
+ public void TestDisplayActionSheetDestruction ()
{
- ScrollAndTap("ActionSheet Destruction");
- App.WaitForNoElement(c => c.Marked("Extra One"));
- App.Tap(c => c.Marked("Destruction"));
+ ScrollAndTap ("ActionSheet Destruction");
+ App.WaitForNoElement (c => c.Marked ("Extra One"));
+ App.Tap (c => c.Marked ("Destruction"));
}
[Test]
- public void TestDisplayActionSheetDestructionExtras()
+ public void TestDisplayActionSheetDestructionExtras ()
{
- ScrollAndTap("ActionSheet Destruction Extras");
- CheckExtras();
- App.Tap(c => c.Marked("Extra One"));
+ ScrollAndTap ("ActionSheet Destruction Extras");
+ CheckExtras ();
+ App.Tap (c => c.Marked ("Extra One"));
}
[Test]
- public void TestDisplayActionSheetTitleCancel()
+ public void TestDisplayActionSheetTitleCancel ()
{
- ScrollAndTap("ActionSheet Title Cancel");
- App.WaitForElement(c => c.Marked("Title"));
- if (App.Query(q => q.Marked("Cancel")).Length > 0)
- App.Tap(c => c.Marked("Cancel"));
+ ScrollAndTap ("ActionSheet Title Cancel");
+ App.WaitForElement (c => c.Marked ("Title"));
+ if (App.Query (q => q.Marked ("Cancel")).Length > 0)
+ App.Tap (c => c.Marked ("Cancel"));
else
- App.TapCoordinates(20, screenSize.Height / 2);
+ App.TapCoordinates (20, screenSize.Height / 2);
}
[Test]
- public void TestDisplayActionSheetTitleCancelDestruction()
+ public void TestDisplayActionSheetTitleCancelDestruction ()
{
- ScrollAndTap("ActionSheet Title Cancel Destruction");
- App.WaitForElement(c => c.Marked("Title"));
- App.WaitForNoElement(c => c.Marked("Extra One"));
- App.Tap(c => c.Marked("Destruction"));
+ ScrollAndTap ("ActionSheet Title Cancel Destruction");
+ App.WaitForElement (c => c.Marked ("Title"));
+ App.WaitForNoElement (c => c.Marked ("Extra One"));
+ App.Tap (c => c.Marked ("Destruction"));
}
[Test]
- public void TestDisplayActionSheetTitleCancelDestructionExtras()
+ public void TestDisplayActionSheetTitleCancelDestructionExtras ()
{
- ScrollAndTap("ActionSheet Title Cancel Destruction Extras");
- App.WaitForElement(c => c.Marked("Title"));
- CheckExtras();
- App.Tap(c => c.Marked("Destruction"));
+ ScrollAndTap ("ActionSheet Title Cancel Destruction Extras");
+ App.WaitForElement (c => c.Marked ("Title"));
+ CheckExtras ();
+ App.Tap (c => c.Marked ("Destruction"));
}
[Test]
- public void TestDisplayActionSheetTitleDestruction()
+ public void TestDisplayActionSheetTitleDestruction ()
{
- ScrollAndTap("ActionSheet Title Destruction");
- App.WaitForElement(c => c.Marked("Title"));
- App.WaitForNoElement(c => c.Marked("Extra One"));
- App.Tap(c => c.Marked("Destruction"));
+ ScrollAndTap ("ActionSheet Title Destruction");
+ App.WaitForElement (c => c.Marked ("Title"));
+ App.WaitForNoElement (c => c.Marked ("Extra One"));
+ App.Tap (c => c.Marked ("Destruction"));
}
[Test]
- public void TestDisplayActionSheetTitleDestructionExtras()
+ public void TestDisplayActionSheetTitleDestructionExtras ()
{
- ScrollAndTap("ActionSheet Title Destruction Extras");
- App.WaitForElement(c => c.Marked("Title"));
- CheckExtras();
- App.Tap(c => c.Marked("Destruction"));
+ ScrollAndTap ("ActionSheet Title Destruction Extras");
+ App.WaitForElement (c => c.Marked ("Title"));
+ CheckExtras ();
+ App.Tap (c => c.Marked ("Destruction"));
}
[Test]
- public void TestDisplayActionSheetTitleExtras()
+ public void TestDisplayActionSheetTitleExtras ()
{
- ScrollAndTap("ActionSheet Title Extras");
- CheckExtras();
- App.Tap(c => c.Marked("Extra One"));
+ ScrollAndTap ("ActionSheet Title Extras");
+ CheckExtras ();
+ App.Tap (c => c.Marked ("Extra One"));
}
- void ScrollAndTap(string actionSheet)
+ void ScrollAndTap(string actionSheet)
{
-#if !__MACOS__
App.ScrollForElement(string.Format("* text:'{0}'", actionSheet), new Drag(App.Query(q => q.Marked("ActionSheetPage"))[0].Rect, Drag.Direction.BottomToTop, Drag.DragLength.Long));
-#endif
- App.Tap(q => q.Raw(string.Format("* text:'{0}'", actionSheet)));
+ App.Tap(q=>q.Raw(string.Format("* text:'{0}'", actionSheet)));
}
}
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs
index 86d0d750..36dd3a14 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs
@@ -47,14 +47,11 @@ namespace Xamarin.Forms.Core.UITests
[UiTest (typeof(ActivityIndicator), "IsRunning")]
public void IsRunning ()
{
- var remote = new ViewContainerRemote(App, Test.ActivityIndicator.IsRunning, PlatformViewType);
- remote.GoTo();
-#if __MACOS__
- Assert.Inconclusive("Not tested yet");
-#else
+ var remote = new ViewContainerRemote (App, Test.ActivityIndicator.IsRunning, PlatformViewType);
+ remote.GoTo ();
+
var isRunning = remote.GetProperty<bool> (ActivityIndicator.IsRunningProperty);
Assert.IsTrue (isRunning);
-#endif
}
protected override void FixtureTeardown ()
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs
index 568663ab..1e624611 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs
@@ -3,9 +3,6 @@ using NUnit.Framework;
namespace Xamarin.Forms.Core.UITests
{
-#if __MACOS__
- [Ignore("Not tested on the MAC")]
-#endif
[Category(UITestCategories.LifeCycle)]
internal class AppearingUITests : BaseTestFixture
{
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs
index 9b814a92..4aeb5cc7 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs
@@ -3,7 +3,6 @@ using Xamarin.UITest;
using System;
using System.Threading;
using Xamarin.UITest.Queries;
-using System.Threading.Tasks;
namespace Xamarin.Forms.Core.UITests
{
@@ -42,9 +41,8 @@ namespace Xamarin.Forms.Core.UITests
[Test]
- public async void Test2()
+ public void Test2 ()
{
- await Task.Delay(1000);
App.WaitForElement(c => c.Marked("btnTest2"));
App.Tap (c => c.Marked ("btnTest2"));
App.WaitForElement (c => c.Marked ("imgHello"));
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs
index 6def5ed0..fa9cdc29 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs
@@ -17,9 +17,6 @@ using Xamarin.UITest.iOS;
namespace Xamarin.Forms.Core.UITests
{
[TestFixture]
-#if __MACOS__
- [Ignore("Not tested on the MAC")]
-#endif
[Category(UITestCategories.BoxView)]
internal class BoxViewUITests : _ViewUITests
{
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs
index 89994a98..83c9cccd 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs
@@ -127,8 +127,6 @@ namespace Xamarin.Forms.Core.UITests
#if __ANDROID__
var isBold = remote.GetProperty<bool> (Button.FontProperty);
Assert.True (isBold);
-#elif __MACOS__
- Assert.Inconclusive("needs testing");
#else
var font = remote.GetProperty<Font> (Button.FontProperty);
Assert.True (font.FontAttributes.HasFlag (FontAttributes.Bold));
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs
index cd0b3643..d681d476 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs
@@ -31,7 +31,7 @@ namespace Xamarin.Forms.Core.UITests
const string mark = "Mark";
-#if __ANDROID__ || __MACOS__
+#if __ANDROID__
[Test]
public void ContextActionsShow ()
{
@@ -81,6 +81,7 @@ namespace Xamarin.Forms.Core.UITests
}
#endif
}
+
[TestFixture]
[Category(UITestCategories.Cells)]
internal class ContextActionsTableUITests : BaseTestFixture
@@ -102,7 +103,7 @@ namespace Xamarin.Forms.Core.UITests
const string mark = "Mark";
const string cellWithNoContextActions = "I have no ContextActions";
-#if __ANDROID__ || __MACOS__
+#if __ANDROID__
[Test]
public void ContextActionsShowAndReset ()
{
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs
index 338d6fed..035e3f70 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs
@@ -16,9 +16,6 @@ using Xamarin.UITest.iOS;
namespace Xamarin.Forms.Core.UITests
{
-#if __MACOS__
- [Ignore("Not tested on the MAC")]
-#endif
[TestFixture]
[Category(UITestCategories.Frame)]
internal class FrameUITests : _ViewUITests
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs
index 24732519..f89f5714 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs
@@ -12,9 +12,6 @@ using Xamarin.UITest.Queries;
namespace Xamarin.Forms.Core.UITests
{
-#if __MACOS__
- [Ignore("Not tested on the MAC")]
-#endif
[TestFixture]
[Category(UITestCategories.Cells)]
internal class CellsGalleryTests : BaseTestFixture
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs
index 0231ca57..30cabffd 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs
@@ -1,7 +1,8 @@
-using NUnit.Framework;
+using System;
+using NUnit.Framework;
using Xamarin.Forms.CustomAttributes;
-
-using Xamarin.UITest.Queries;
+using Xamarin.UITest.Android;
+using Xamarin.UITest.iOS;
namespace Xamarin.Forms.Core.UITests
{
@@ -14,29 +15,28 @@ namespace Xamarin.Forms.Core.UITests
#if __ANDROID__
static bool isSecondaryMenuOpen = false;
#endif
- static void ShouldShowMenu()
+ static void ShouldShowMenu ()
{
#if __ANDROID__
isSecondaryMenuOpen = true;
//show secondary menu
- App.Tap(c => c.Class("android.support.v7.widget.ActionMenuPresenter$OverflowMenuButton"));
+ App.Tap (c => c.Class ("android.support.v7.widget.ActionMenuPresenter$OverflowMenuButton"));
#endif
}
- static void ShouldHideMenu()
+ static void ShouldHideMenu ()
{
#if __ANDROID__
- if (isSecondaryMenuOpen)
- {
+ if (isSecondaryMenuOpen) {
isSecondaryMenuOpen = false;
- App.Back();
+ App.Back ();
}
#endif
}
- protected override void NavigateToGallery()
+ protected override void NavigateToGallery ()
{
- App.NavigateToGallery(GalleryQueries.ToolbarItemGallery);
+ App.NavigateToGallery (GalleryQueries.ToolbarItemGallery);
#if __IOS__
btn1Id = "menuIcon";
btn4Id = "tb4";
@@ -44,105 +44,59 @@ namespace Xamarin.Forms.Core.UITests
}
[Test]
- public void ToolbarButtonsClick()
+ public void ToolbarButtonsClick ()
{
- ShouldHideMenu();
-#if __MACOS__
- App.Tap(c => c.Button().Index(4));
-#else
- App.Tap(c => c.Marked(btn1Id));
-#endif
- var textLabel = App.Query((arg) => arg.Marked("label_id"))[0];
- Assert.False(textLabel.Text == "tb1");
- Assert.True(textLabel.Text == "Hello ContentPage");
+ ShouldHideMenu ();
+ App.Tap (c => c.Marked (btn1Id));
}
[Test]
- public void ToolbarButtonsCommand()
+ public void ToolbarButtonsCommand ()
{
- ShouldShowMenu();
+ ShouldShowMenu ();
#if __ANDROID__
//App.Query (c => c.Marked (btn4Id))[0];
#else
- App.Tap(c => c.Marked(btn4Id));
- var textLabel = App.Query((arg) => arg.Marked("label_id"))[0];
- Assert.False(textLabel.Text == "tb4");
-#if __MACOS__
- App.Tap(c => c.Button().Index(6));
-#else
- App.Tap(c => c.Marked("tb3"));
-#endif
- App.Tap(c => c.Marked(btn4Id));
- textLabel = App.Query((arg) => arg.Marked("label_id"))[0];
- Assert.IsTrue(textLabel.Text == "tb4");
-#if __MACOS__
- App.Tap(c => c.Button().Index(6));
-#else
- App.Tap(c => c.Marked("tb3"));
-#endif
+ App.Tap (c => c.Marked (btn4Id));
#endif
}
[Test]
- public void ToolbarButtonsDisable()
+ public void ToolbarButtonsDisable ()
{
- ShouldHideMenu();
-#if __MACOS__
- var result = App.Query(c => c.Button());
- var btn1 = result[4];
- var btn2 = App.Query(c => c.Marked(btn4Id))[0];
- Assert.False(btn2.Enabled, "Toolbar Item should be disable");
-#else
- var btn1 = App.Query(c => c.Marked(btn1Id))[0];
- ShouldShowMenu();
- //var btn2 = App.Query (c => c.Marked (btn4Id)) [0];
+ ShouldHideMenu ();
+ var btn1 = App.Query (c => c.Marked (btn1Id)) [0];
+ ShouldShowMenu ();
+ //var btn2 = App.Query (c => c.Marked (btn4Id)) [0];
+ Assert.False (btn1.Enabled, "Toolbar Item should be disable");
//TODO: how to check Enable for the textview
//Assert.False (btn2.Enabled, "Toolbar Item should be disable");
-#endif
- Assert.False(btn1.Enabled, "Toolbar Item should be disable");
}
[Test]
- public void ToolbarButtonsExist()
+ public void ToolbarButtonsExist ()
{
- ShouldHideMenu();
-#if __MACOS__
- var existsPrimary = App.Query(c => c.Button())[4];
- Assert.True(existsPrimary != null, "Toolbar Item 1 no name, not found");
-#else
- var existsPrimary = App.Query(c => c.Marked(btn1Id)).Length;
- Assert.True(existsPrimary > 0, "Toolbar Item 1 no name, not found");
-#endif
- var existsPrimary2 = App.Query(c => c.Marked("tb2")).Length;
- Assert.True(existsPrimary2 > 0, "Toolbar Item 2, not found");
- ShouldShowMenu();
-
-#if __MACOS__
- var existsSecondary = App.Query(c => c.Button())[7];
- Assert.True(existsSecondary != null, "Toolbar Item 3 no name, not found");
-#else
- var existsSecondary = App.Query(c => c.Marked("tb3")).Length;
- Assert.True(existsSecondary > 0, "Toolbar Item 1 no name, not found");
-#endif
- var existsSecondary2 = App.Query(c => c.Marked(btn4Id)).Length;
- Assert.True(existsSecondary2 > 0, "Toolbar Item 4, not found");
+ ShouldHideMenu ();
+ var existsPrimary = App.Query (c => c.Marked (btn1Id)).Length;
+ var existsPrimary2 = App.Query (c => c.Marked ("tb2")).Length;
+ ShouldShowMenu ();
+ var existsSecondary = App.Query (c => c.Marked ("tb3")).Length;
+ var existsSecondary2 = App.Query (c => c.Marked (btn4Id)).Length;
+ Assert.True (existsPrimary > 0, "Toolbar Item 1 no name, not found");
+ Assert.True (existsPrimary2 > 0, "Toolbar Item 2, not found");
+ Assert.True (existsSecondary > 0, "Toolbar Item 1 no name, not found");
+ Assert.True (existsSecondary2 > 0, "Toolbar Item 1, not found");
}
[Test]
- public void ToolbarButtonsOrder()
+ public void ToolbarButtonsOrder ()
{
- ShouldHideMenu();
-#if __MACOS__
- var btn1 = App.Query(c => c.Button())[4];
-#else
- var btn1 = App.Query(c => c.Marked(btn1Id))[0];
-#endif
- ShouldShowMenu();
- var btn2 = App.Query(c => c.Marked("tb4"))[0];
+ ShouldHideMenu ();
+ var btn1 = App.Query (c => c.Marked (btn1Id)) [0];
+ ShouldShowMenu ();
+ var btn2 = App.Query (c => c.Marked ("tb4")) [0];
#if __IOS__
- Assert.True(btn1.Rect.CenterY < btn2.Rect.CenterY);
-#elif __MACOS__
- Assert.True(btn1.Rect.CenterX < btn2.Rect.CenterX);
+ Assert.True (btn1.Rect.CenterY < btn2.Rect.CenterY);
#endif
}
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs
index 9029f2aa..a7a13017 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs
@@ -11,7 +11,6 @@ using Xamarin.UITest.iOS;
namespace Xamarin.Forms.Core.UITests
{
- [Category("ViewBaseTests")]
internal abstract class _ViewUITests : BaseTestFixture
{
/* Under score prefixes ensure inherited properties run first in test suite */
@@ -118,11 +117,7 @@ namespace Xamarin.Forms.Core.UITests
var viewPre = remote.GetViews ();
-#if __MACOS__
- Assert.GreaterOrEqual(viewPre.Length, 1);
-#else
Assert.AreEqual (1, viewPre.Length);
-#endif
remote.TapStateButton ();
@@ -141,15 +136,12 @@ namespace Xamarin.Forms.Core.UITests
[UiTest (typeof (VisualElement), "Opacity")]
public virtual void _Opacity ()
{
- var remote = new ViewContainerRemote(App, Test.VisualElement.Opacity, PlatformViewType);
- remote.GoTo();
-#if __MACOS__
- Assert.Inconclusive("needs testing");
-#else
+ var remote = new ViewContainerRemote (App, Test.VisualElement.Opacity, PlatformViewType);
+ remote.GoTo ();
+
float opacity = -1f;
opacity = remote.GetProperty<float> (View.OpacityProperty);
Assert.AreEqual (0.5f, opacity);
-#endif
}
[Test]
@@ -211,15 +203,12 @@ namespace Xamarin.Forms.Core.UITests
[UiTest (typeof (VisualElement), "Scale")]
public virtual void _Scale ()
{
- var remote = new ViewContainerRemote(App, Test.VisualElement.Scale, PlatformViewType);
- remote.GoTo();
-#if __MACOS__
- Assert.Inconclusive("needs testing");
-#else
- var scaleMatrix = remote.GetProperty<Matrix>(View.ScaleProperty);
- Matrix generatedMatrix = NumericExtensions.BuildScaleMatrix(0.5f);
- Assert.AreEqual(generatedMatrix, scaleMatrix);
-#endif
+ var remote = new ViewContainerRemote (App, Test.VisualElement.Scale, PlatformViewType);
+ remote.GoTo ();
+
+ var scaleMatrix = remote.GetProperty<Matrix> (View.ScaleProperty);
+ Matrix generatedMatrix = NumericExtensions.BuildScaleMatrix (0.5f);
+ Assert.AreEqual (generatedMatrix, scaleMatrix);
}
[Test]
diff --git a/Xamarin.Forms.Core.iOS.UITests/UITestCategories.cs b/Xamarin.Forms.Core.iOS.UITests/UITestCategories.cs
index 28a6fff4..dbc298f6 100644
--- a/Xamarin.Forms.Core.iOS.UITests/UITestCategories.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/UITestCategories.cs
@@ -29,7 +29,6 @@
public const string TimePicker = "TimePicker";
public const string ToolbarItem = "ToolbarItem";
public const string WebView = "WebView";
- public const string Maps = "Maps";
public const string ManualReview = "ManualReview";
}
diff --git a/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs b/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs
index b5f52b9c..481c3a5e 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs
@@ -1,7 +1,16 @@
using System;
+using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+using NUnit.Framework;
using Xamarin.UITest;
+using Xamarin.UITest.Android;
+using Xamarin.UITest.iOS;
using Xamarin.UITest.Queries;
using System.Text.RegularExpressions;
diff --git a/Xamarin.Forms.Core/Accessibility.cs b/Xamarin.Forms.Core/Accessibility.cs
deleted file mode 100644
index e866d318..00000000
--- a/Xamarin.Forms.Core/Accessibility.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-
-namespace Xamarin.Forms
-{
- public class Accessibility
- {
- public static readonly BindableProperty HintProperty = BindableProperty.Create("Hint", typeof(string), typeof(Element), default(string));
-
- public static readonly BindableProperty IsInAccessibleTreeProperty = BindableProperty.Create("IsInAccessibleTree", typeof(bool?), typeof(Element), null);
-
- public static readonly BindableProperty LabeledByProperty = BindableProperty.Create("LabeledBy", typeof(VisualElement), typeof(Element), default(VisualElement));
-
- public static readonly BindableProperty NameProperty = BindableProperty.Create("Name", typeof(string), typeof(Element), default(string));
- }
-}
diff --git a/Xamarin.Forms.Core/Button.cs b/Xamarin.Forms.Core/Button.cs
index bcd593ed..97d774c9 100644
--- a/Xamarin.Forms.Core/Button.cs
+++ b/Xamarin.Forms.Core/Button.cs
@@ -116,18 +116,13 @@ namespace Xamarin.Forms
void IButtonController.SendClicked()
{
- Command?.Execute(CommandParameter);
- Clicked?.Invoke(this, EventArgs.Empty);
- }
-
- void IButtonController.SendPressed()
- {
- Pressed?.Invoke(this, EventArgs.Empty);
- }
+ ICommand cmd = Command;
+ if (cmd != null)
+ cmd.Execute(CommandParameter);
- void IButtonController.SendReleased()
- {
- Released?.Invoke(this, EventArgs.Empty);
+ EventHandler handler = Clicked;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
}
public FontAttributes FontAttributes
@@ -151,10 +146,6 @@ namespace Xamarin.Forms
public event EventHandler Clicked;
- public event EventHandler Pressed;
-
- public event EventHandler Released;
-
public Button()
{
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Button>>(() => new PlatformConfigurationRegistry<Button>(this));
diff --git a/Xamarin.Forms.Platform.WP8/ConcurrentDictionary.cs b/Xamarin.Forms.Core/ConcurrentDictionary.cs
index a229c6fe..a229c6fe 100644
--- a/Xamarin.Forms.Platform.WP8/ConcurrentDictionary.cs
+++ b/Xamarin.Forms.Core/ConcurrentDictionary.cs
diff --git a/Xamarin.Forms.Core/Device.cs b/Xamarin.Forms.Core/Device.cs
index 2987ea5a..506978a2 100644
--- a/Xamarin.Forms.Core/Device.cs
+++ b/Xamarin.Forms.Core/Device.cs
@@ -12,7 +12,6 @@ namespace Xamarin.Forms
public const string Android = "Android";
public const string WinPhone = "WinPhone";
public const string Windows = "Windows";
- public const string macOS = "macOS";
public const string Tizen = "Tizen";
internal static DeviceInfo info;
@@ -23,10 +22,8 @@ namespace Xamarin.Forms
[Obsolete("Use RuntimePlatform instead.")]
#pragma warning disable 0618
- public static TargetPlatform OS
- {
- get
- {
+ public static TargetPlatform OS {
+ get {
TargetPlatform platform;
if (Enum.TryParse(RuntimePlatform, out platform))
return platform;
@@ -180,4 +177,4 @@ namespace Xamarin.Forms
public static readonly Style CaptionStyle = new Style(typeof(Label)) { BaseResourceKey = CaptionStyleKey };
}
}
-}
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/IButtonController.cs b/Xamarin.Forms.Core/IButtonController.cs
index b7e3bc41..c88907b0 100644
--- a/Xamarin.Forms.Core/IButtonController.cs
+++ b/Xamarin.Forms.Core/IButtonController.cs
@@ -3,7 +3,5 @@ namespace Xamarin.Forms
public interface IButtonController : IViewController
{
void SendClicked();
- void SendPressed();
- void SendReleased();
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/INavigationPageController.cs b/Xamarin.Forms.Core/INavigationPageController.cs
index ab057510..eddbe750 100644
--- a/Xamarin.Forms.Core/INavigationPageController.cs
+++ b/Xamarin.Forms.Core/INavigationPageController.cs
@@ -7,9 +7,7 @@ namespace Xamarin.Forms
{
public interface INavigationPageController
{
- Page Peek(int depth = 0);
-
- IEnumerable<Page> Pages { get; }
+ Stack<Page> StackCopy { get; }
int StackDepth { get; }
diff --git a/Xamarin.Forms.Core/ListStringTypeConverter.cs b/Xamarin.Forms.Core/ListStringTypeConverter.cs
index 69aa53fc..647f0143 100644
--- a/Xamarin.Forms.Core/ListStringTypeConverter.cs
+++ b/Xamarin.Forms.Core/ListStringTypeConverter.cs
@@ -3,7 +3,6 @@ using System.Linq;
namespace Xamarin.Forms
{
- [Xaml.ProvideCompiled("Xamarin.Forms.Core.XamlC.ListStringTypeConverter")]
public class ListStringTypeConverter : TypeConverter
{
public override object ConvertFromInvariantString(string value)
diff --git a/Xamarin.Forms.Core/ListView.cs b/Xamarin.Forms.Core/ListView.cs
index 8f234cfd..0751e1c2 100644
--- a/Xamarin.Forms.Core/ListView.cs
+++ b/Xamarin.Forms.Core/ListView.cs
@@ -71,7 +71,7 @@ namespace Xamarin.Forms
public ListView([Parameter("CachingStrategy")] ListViewCachingStrategy cachingStrategy) : this()
{
- if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.macOS)
+ if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
CachingStrategy = cachingStrategy;
}
diff --git a/Xamarin.Forms.Core/MessagingCenter.cs b/Xamarin.Forms.Core/MessagingCenter.cs
index d5753e1d..b6a167da 100644
--- a/Xamarin.Forms.Core/MessagingCenter.cs
+++ b/Xamarin.Forms.Core/MessagingCenter.cs
@@ -2,28 +2,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+using System.Runtime.CompilerServices;
namespace Xamarin.Forms
{
- public interface IMessagingCenter
+ public static class MessagingCenter
{
- void Send<TSender, TArgs>(TSender sender, string message, TArgs args) where TSender : class;
-
- void Send<TSender>(TSender sender, string message) where TSender : class;
-
- void Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source = null) where TSender : class;
-
- void Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source = null) where TSender : class;
-
- void Unsubscribe<TSender, TArgs>(object subscriber, string message) where TSender : class;
-
- void Unsubscribe<TSender>(object subscriber, string message) where TSender : class;
- }
-
- public class MessagingCenter : IMessagingCenter
- {
- public static IMessagingCenter Instance { get; } = new MessagingCenter();
-
class Sender : Tuple<string, Type, Type>
{
public Sender(string message, Type senderType, Type argType) : base(message, senderType, argType)
@@ -35,8 +19,8 @@ namespace Xamarin.Forms
class MaybeWeakReference
{
- WeakReference DelegateWeakReference { get; }
- object DelegateStrongReference { get; }
+ WeakReference DelegateWeakReference { get; set; }
+ object DelegateStrongReference { get; set; }
readonly bool _isStrongReference;
@@ -100,16 +84,11 @@ namespace Xamarin.Forms
}
}
- readonly Dictionary<Sender, List<Subscription>> _subscriptions =
+ static readonly Dictionary<Sender, List<Subscription>> s_subscriptions =
new Dictionary<Sender, List<Subscription>>();
public static void Send<TSender, TArgs>(TSender sender, string message, TArgs args) where TSender : class
{
- Instance.Send(sender, message, args);
- }
-
- void IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args)
- {
if (sender == null)
throw new ArgumentNullException(nameof(sender));
InnerSend(message, typeof(TSender), typeof(TArgs), sender, args);
@@ -117,11 +96,6 @@ namespace Xamarin.Forms
public static void Send<TSender>(TSender sender, string message) where TSender : class
{
- Instance.Send(sender, message);
- }
-
- void IMessagingCenter.Send<TSender>(TSender sender, string message)
- {
if (sender == null)
throw new ArgumentNullException(nameof(sender));
InnerSend(message, typeof(TSender), null, sender, null);
@@ -129,11 +103,6 @@ namespace Xamarin.Forms
public static void Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source = null) where TSender : class
{
- Instance.Subscribe(subscriber, message, callback, source);
- }
-
- void IMessagingCenter.Subscribe<TSender, TArgs>(object subscriber, string message, Action<TSender, TArgs> callback, TSender source)
- {
if (subscriber == null)
throw new ArgumentNullException(nameof(subscriber));
if (callback == null)
@@ -152,11 +121,6 @@ namespace Xamarin.Forms
public static void Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source = null) where TSender : class
{
- Instance.Subscribe(subscriber, message, callback, source);
- }
-
- void IMessagingCenter.Subscribe<TSender>(object subscriber, string message, Action<TSender> callback, TSender source)
- {
if (subscriber == null)
throw new ArgumentNullException(nameof(subscriber));
if (callback == null)
@@ -175,32 +139,27 @@ namespace Xamarin.Forms
public static void Unsubscribe<TSender, TArgs>(object subscriber, string message) where TSender : class
{
- Instance.Unsubscribe<TSender, TArgs>(subscriber, message);
- }
-
- void IMessagingCenter.Unsubscribe<TSender, TArgs>(object subscriber, string message)
- {
InnerUnsubscribe(message, typeof(TSender), typeof(TArgs), subscriber);
}
public static void Unsubscribe<TSender>(object subscriber, string message) where TSender : class
{
- Instance.Unsubscribe<TSender>(subscriber, message);
+ InnerUnsubscribe(message, typeof(TSender), null, subscriber);
}
- void IMessagingCenter.Unsubscribe<TSender>(object subscriber, string message)
+ internal static void ClearSubscribers()
{
- InnerUnsubscribe(message, typeof(TSender), null, subscriber);
+ s_subscriptions.Clear();
}
- void InnerSend(string message, Type senderType, Type argType, object sender, object args)
+ static void InnerSend(string message, Type senderType, Type argType, object sender, object args)
{
if (message == null)
throw new ArgumentNullException(nameof(message));
var key = new Sender(message, senderType, argType);
- if (!_subscriptions.ContainsKey(key))
+ if (!s_subscriptions.ContainsKey(key))
return;
- List<Subscription> subcriptions = _subscriptions[key];
+ List<Subscription> subcriptions = s_subscriptions[key];
if (subcriptions == null || !subcriptions.Any())
return; // should not be reachable
@@ -219,24 +178,24 @@ namespace Xamarin.Forms
}
}
- void InnerSubscribe(object subscriber, string message, Type senderType, Type argType, object target, MethodInfo methodInfo, Filter filter)
+ static void InnerSubscribe(object subscriber, string message, Type senderType, Type argType, object target, MethodInfo methodInfo, Filter filter)
{
if (message == null)
throw new ArgumentNullException(nameof(message));
var key = new Sender(message, senderType, argType);
var value = new Subscription(subscriber, target, methodInfo, filter);
- if (_subscriptions.ContainsKey(key))
+ if (s_subscriptions.ContainsKey(key))
{
- _subscriptions[key].Add(value);
+ s_subscriptions[key].Add(value);
}
else
{
var list = new List<Subscription> { value };
- _subscriptions[key] = list;
+ s_subscriptions[key] = list;
}
}
- void InnerUnsubscribe(string message, Type senderType, Type argType, object subscriber)
+ static void InnerUnsubscribe(string message, Type senderType, Type argType, object subscriber)
{
if (subscriber == null)
throw new ArgumentNullException(nameof(subscriber));
@@ -244,19 +203,11 @@ namespace Xamarin.Forms
throw new ArgumentNullException(nameof(message));
var key = new Sender(message, senderType, argType);
- if (!_subscriptions.ContainsKey(key))
+ if (!s_subscriptions.ContainsKey(key))
return;
- _subscriptions[key].RemoveAll(sub => sub.CanBeRemoved() || sub.Subscriber.Target == subscriber);
- if (!_subscriptions[key].Any())
- _subscriptions.Remove(key);
- }
-
- // This is a bit gross; it only exists to support the unit tests in PageTests
- // because the implementations of ActionSheet, Alert, and IsBusy are all very
- // tightly coupled to the MessagingCenter singleton
- internal static void ClearSubscribers()
- {
- (Instance as MessagingCenter)?._subscriptions.Clear();
+ s_subscriptions[key].RemoveAll(sub => sub.CanBeRemoved() || sub.Subscriber.Target == subscriber);
+ if (!s_subscriptions[key].Any())
+ s_subscriptions.Remove(key);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Core/NavigationPage.cs b/Xamarin.Forms.Core/NavigationPage.cs
index 7663d1bf..7b393b9c 100644
--- a/Xamarin.Forms.Core/NavigationPage.cs
+++ b/Xamarin.Forms.Core/NavigationPage.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms.Internals;
@@ -28,10 +27,7 @@ namespace Xamarin.Forms
static readonly BindablePropertyKey CurrentPagePropertyKey = BindableProperty.CreateReadOnly("CurrentPage", typeof(Page), typeof(NavigationPage), null);
public static readonly BindableProperty CurrentPageProperty = CurrentPagePropertyKey.BindableProperty;
-
- static readonly BindablePropertyKey RootPagePropertyKey = BindableProperty.CreateReadOnly(nameof(RootPage), typeof(Page), typeof(NavigationPage), null);
- public static readonly BindableProperty RootPageProperty = RootPagePropertyKey.BindableProperty;
-
+
public NavigationPage()
{
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<NavigationPage>>(() => new PlatformConfigurationRegistry<NavigationPage>(this));
@@ -65,23 +61,17 @@ namespace Xamarin.Forms
internal Task CurrentNavigationTask { get; set; }
- Page INavigationPageController.Peek(int depth)
+ Stack<Page> INavigationPageController.StackCopy
{
- if (depth < 0)
- {
- return null;
- }
-
- if (PageController.InternalChildren.Count <= depth)
+ get
{
- return null;
+ var result = new Stack<Page>(PageController.InternalChildren.Count);
+ foreach (Page page in PageController.InternalChildren)
+ result.Push(page);
+ return result;
}
-
- return (Page)PageController.InternalChildren[PageController.InternalChildren.Count - depth - 1];
}
- IEnumerable<Page> INavigationPageController.Pages => PageController.InternalChildren.Cast<Page>();
-
int INavigationPageController.StackDepth
{
get { return PageController.InternalChildren.Count; }
@@ -95,12 +85,6 @@ namespace Xamarin.Forms
private set { SetValue(CurrentPagePropertyKey, value); }
}
- public Page RootPage
- {
- get { return (Page)GetValue(RootPageProperty); }
- private set { SetValue(RootPagePropertyKey, value); }
- }
-
public static string GetBackButtonTitle(BindableObject page)
{
return (string)page.GetValue(BackButtonTitleProperty);
@@ -313,14 +297,8 @@ namespace Xamarin.Forms
void InsertPageBefore(Page page, Page before)
{
- if (page == null)
- throw new ArgumentNullException($"{nameof(page)} cannot be null.");
-
- if (before == null)
- throw new ArgumentNullException($"{nameof(before)} cannot be null.");
-
if (!PageController.InternalChildren.Contains(before))
- throw new ArgumentException($"{nameof(before)} must be a child of the NavigationPage", nameof(before));
+ throw new ArgumentException("before must be a child of the NavigationPage", "before");
if (PageController.InternalChildren.Contains(page))
throw new ArgumentException("Cannot insert page which is already in the navigation stack");
@@ -331,9 +309,6 @@ namespace Xamarin.Forms
int index = PageController.InternalChildren.IndexOf(before);
PageController.InternalChildren.Insert(index, page);
- if (index == 0)
- RootPage = page;
-
// Shouldn't be required?
if (Width > 0 && Height > 0)
ForceLayout();
@@ -344,13 +319,15 @@ namespace Xamarin.Forms
if (((INavigationPageController)this).StackDepth == 1)
return;
- Element[] childrenToRemove = PageController.InternalChildren.Skip(1).ToArray();
- foreach (Element child in childrenToRemove)
+ var root = (Page)PageController.InternalChildren.First();
+
+ var childrenToRemove = PageController.InternalChildren.ToArray().Where(c => c != root);
+ foreach (var child in childrenToRemove)
PageController.InternalChildren.Remove(child);
- CurrentPage = RootPage;
+ CurrentPage = root;
- var args = new NavigationRequestedEventArgs(RootPage, animated);
+ var args = new NavigationRequestedEventArgs(root, animated);
EventHandler<NavigationRequestedEventArgs> requestPopToRoot = PopToRootRequestedInternal;
if (requestPopToRoot != null)
@@ -361,7 +338,8 @@ namespace Xamarin.Forms
await args.Task;
}
- PoppedToRoot?.Invoke(this, new PoppedToRootEventArgs(RootPage, childrenToRemove.OfType<Page>().ToList()));
+ if (PoppedToRoot != null)
+ PoppedToRoot(this, new PoppedToRootEventArgs(root, childrenToRemove.OfType<Page>().ToList()));
}
async Task PushAsyncInner(Page page, bool animated)
@@ -382,29 +360,24 @@ namespace Xamarin.Forms
await args.Task;
}
- Pushed?.Invoke(this, args);
+ if (Pushed != null)
+ Pushed(this, args);
}
void PushPage(Page page)
{
PageController.InternalChildren.Add(page);
- if (PageController.InternalChildren.Count == 1)
- RootPage = page;
-
CurrentPage = page;
}
void RemovePage(Page page)
{
- if (page == null)
- throw new ArgumentNullException($"{nameof(page)} cannot be null.");
-
- if (page == CurrentPage && CurrentPage == RootPage)
+ if (page == CurrentPage && ((INavigationPageController)this).StackDepth <= 1)
throw new InvalidOperationException("Cannot remove root page when it is also the currently displayed page.");
if (page == CurrentPage)
{
- Log.Warning("NavigationPage", "RemovePage called for CurrentPage object. This can result in undesired behavior, consider calling PopAsync instead.");
+ Log.Warning("NavigationPage", "RemovePage called for CurrentPage object. This can result in undesired behavior, consider called PopAsync instead.");
PopAsync();
return;
}
@@ -413,11 +386,10 @@ namespace Xamarin.Forms
throw new ArgumentException("Page to remove must be contained on this Navigation Page");
EventHandler<NavigationRequestedEventArgs> handler = RemovePageRequestedInternal;
- handler?.Invoke(this, new NavigationRequestedEventArgs(page, true));
+ if (handler != null)
+ handler(this, new NavigationRequestedEventArgs(page, true));
PageController.InternalChildren.Remove(page);
- if (RootPage == page)
- RootPage = (Page)PageController.InternalChildren.First();
}
void SafePop()
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/ExtensionPoints.cs b/Xamarin.Forms.Core/PlatformConfiguration/ExtensionPoints.cs
index fbddfeb7..b74e9b9a 100644
--- a/Xamarin.Forms.Core/PlatformConfiguration/ExtensionPoints.cs
+++ b/Xamarin.Forms.Core/PlatformConfiguration/ExtensionPoints.cs
@@ -5,5 +5,4 @@ namespace Xamarin.Forms.PlatformConfiguration
public sealed class iOS : IConfigPlatform { }
public sealed class Windows : IConfigPlatform { }
public sealed class Tizen : IConfigPlatform { }
- public sealed class macOS : IConfigPlatform { }
}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabbedPage.cs b/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabbedPage.cs
deleted file mode 100644
index 3c51805b..00000000
--- a/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabbedPage.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace Xamarin.Forms.PlatformConfiguration.macOSSpecific
-{
- using FormsElement = Forms.TabbedPage;
-
- public static class TabbedPage
- {
- #region TabsStyle
- public static readonly BindableProperty TabsStyleProperty = BindableProperty.Create("TabsStyle", typeof(TabsStyle), typeof(TabbedPage), TabsStyle.Default);
-
- public static TabsStyle GetTabsStyle(BindableObject element)
- {
- return (TabsStyle)element.GetValue(TabsStyleProperty);
- }
-
- public static void SetTabsStyle(BindableObject element, TabsStyle value)
- {
- element.SetValue(TabsStyleProperty, value);
- }
-
- public static TabsStyle GetTabsStyle(this IPlatformElementConfiguration<macOS, FormsElement> config)
- {
- return GetTabsStyle(config.Element);
- }
-
- public static IPlatformElementConfiguration<macOS, FormsElement> SetShowTabs(this IPlatformElementConfiguration<macOS, FormsElement> config, TabsStyle value)
- {
- SetTabsStyle(config.Element, value);
- return config;
- }
-
- public static IPlatformElementConfiguration<macOS, FormsElement> ShowTabsOnNavigation(this IPlatformElementConfiguration<macOS, FormsElement> config)
- {
- SetTabsStyle(config.Element, TabsStyle.OnNavigation);
- return config;
- }
-
- public static IPlatformElementConfiguration<macOS, FormsElement> ShowTabs(this IPlatformElementConfiguration<macOS, FormsElement> config)
- {
- SetTabsStyle(config.Element, TabsStyle.Default);
- return config;
- }
-
- public static IPlatformElementConfiguration<macOS, FormsElement> HideTabs(this IPlatformElementConfiguration<macOS, FormsElement> config)
- {
- SetTabsStyle(config.Element, TabsStyle.Hidden);
- return config;
- }
- #endregion
- }
-}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabsStyle.cs b/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabsStyle.cs
deleted file mode 100644
index 0b498ae5..00000000
--- a/Xamarin.Forms.Core/PlatformConfiguration/macOSSpecific/TabsStyle.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-namespace Xamarin.Forms
-{
- public enum TabsStyle
- {
- Default = 0,
- Hidden = 1,
- Icons = 2,
- OnNavigation = 3,
- OnBottom = 4
- }
-}
diff --git a/Xamarin.Forms.Core/Properties/AssemblyInfo.cs b/Xamarin.Forms.Core/Properties/AssemblyInfo.cs
index 7ba35cd3..2f686176 100644
--- a/Xamarin.Forms.Core/Properties/AssemblyInfo.cs
+++ b/Xamarin.Forms.Core/Properties/AssemblyInfo.cs
@@ -28,7 +28,7 @@ using Xamarin.Forms.Internals;
[assembly: InternalsVisibleTo("Xamarin.Forms.Platform.WinRT.Tablet")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Platform.WinRT.Phone")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Platform.WP8")]
-[assembly: InternalsVisibleTo("Xamarin.Forms.Platform.macOS")]
+[assembly: InternalsVisibleTo("Xamarin.Forms.Platform.MacOS")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Platform.Tizen")]
[assembly: InternalsVisibleTo("iOSUnitTests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Controls")]
@@ -49,7 +49,6 @@ using Xamarin.Forms.Internals;
[assembly: InternalsVisibleTo("Xamarin.Forms.Core.iOS.UITests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Core.Android.UITests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Core.Windows.UITests")]
-[assembly: InternalsVisibleTo("Xamarin.Forms.Core.macOS.UITests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.iOS.UITests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Android.UITests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Loader")]
@@ -61,4 +60,4 @@ using Xamarin.Forms.Internals;
[assembly: InternalsVisibleTo("Xamarin.Forms.CarouselView")]
[assembly: Preserve]
-[assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")]
+[assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")] \ No newline at end of file
diff --git a/Xamarin.Forms.Core/RelativeLayout.cs b/Xamarin.Forms.Core/RelativeLayout.cs
index 2b835013..b3a1b615 100644
--- a/Xamarin.Forms.Core/RelativeLayout.cs
+++ b/Xamarin.Forms.Core/RelativeLayout.cs
@@ -8,13 +8,13 @@ namespace Xamarin.Forms
{
public class RelativeLayout : Layout<View>
{
- public static readonly BindableProperty XConstraintProperty = BindableProperty.CreateAttached("XConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged);
+ public static readonly BindableProperty XConstraintProperty = BindableProperty.CreateAttached("XConstraint", typeof(Constraint), typeof(RelativeLayout), null);
- public static readonly BindableProperty YConstraintProperty = BindableProperty.CreateAttached("YConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged);
+ public static readonly BindableProperty YConstraintProperty = BindableProperty.CreateAttached("YConstraint", typeof(Constraint), typeof(RelativeLayout), null);
- public static readonly BindableProperty WidthConstraintProperty = BindableProperty.CreateAttached("WidthConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged);
+ public static readonly BindableProperty WidthConstraintProperty = BindableProperty.CreateAttached("WidthConstraint", typeof(Constraint), typeof(RelativeLayout), null);
- public static readonly BindableProperty HeightConstraintProperty = BindableProperty.CreateAttached("HeightConstraint", typeof(Constraint), typeof(RelativeLayout), null, propertyChanged: ConstraintChanged);
+ public static readonly BindableProperty HeightConstraintProperty = BindableProperty.CreateAttached("HeightConstraint", typeof(Constraint), typeof(RelativeLayout), null);
public static readonly BindableProperty BoundsConstraintProperty = BindableProperty.CreateAttached("BoundsConstraint", typeof(BoundsConstraint), typeof(RelativeLayout), null);
@@ -72,25 +72,6 @@ namespace Xamarin.Forms
}
}
- static void ConstraintChanged(BindableObject bindable, object oldValue, object newValue)
- {
- View view = bindable as View;
-
- (view?.Parent as RelativeLayout)?.UpdateBoundsConstraint(view);
- }
-
- void UpdateBoundsConstraint(View view)
- {
- if (GetBoundsConstraint(view) == null)
- return; // Bounds constraint hasn't been calculated yet, no need to update just yet
-
- CreateBoundsFromConstraints(view, GetXConstraint(view), GetYConstraint(view), GetWidthConstraint(view), GetHeightConstraint(view));
-
- _childrenInSolveOrder = null; // New constraints may have impact on solve order
-
- InvalidateLayout();
- }
-
public static BoundsConstraint GetBoundsConstraint(BindableObject bindable)
{
return (BoundsConstraint)bindable.GetValue(BoundsConstraintProperty);
@@ -121,26 +102,6 @@ namespace Xamarin.Forms
bindable.SetValue(BoundsConstraintProperty, value);
}
- public static void SetHeightConstraint(BindableObject bindable, Constraint value)
- {
- bindable.SetValue(HeightConstraintProperty, value);
- }
-
- public static void SetWidthConstraint(BindableObject bindable, Constraint value)
- {
- bindable.SetValue(WidthConstraintProperty, value);
- }
-
- public static void SetXConstraint(BindableObject bindable, Constraint value)
- {
- bindable.SetValue(XConstraintProperty, value);
- }
-
- public static void SetYConstraint(BindableObject bindable, Constraint value)
- {
- bindable.SetValue(YConstraintProperty, value);
- }
-
protected override void LayoutChildren(double x, double y, double width, double height)
{
foreach (View child in ChildrenInSolveOrder)
@@ -287,13 +248,13 @@ namespace Xamarin.Forms
static Rectangle SolveView(View view)
{
BoundsConstraint boundsConstraint = GetBoundsConstraint(view);
+ var result = new Rectangle();
if (boundsConstraint == null)
{
throw new Exception("BoundsConstraint should not be null at this point");
}
-
- var result = boundsConstraint.Compute();
+ result = boundsConstraint.Compute();
return result;
}
@@ -319,7 +280,7 @@ namespace Xamarin.Forms
public void Add(View view, Expression<Func<Rectangle>> bounds)
{
if (bounds == null)
- throw new ArgumentNullException(nameof(bounds));
+ throw new ArgumentNullException("bounds");
SetBoundsConstraint(view, BoundsConstraint.FromExpression(bounds));
base.Add(view);
@@ -347,14 +308,7 @@ namespace Xamarin.Forms
public void Add(View view, Constraint xConstraint = null, Constraint yConstraint = null, Constraint widthConstraint = null, Constraint heightConstraint = null)
{
- view.BatchBegin();
-
- RelativeLayout.SetXConstraint(view, xConstraint);
- RelativeLayout.SetYConstraint(view, yConstraint);
- RelativeLayout.SetWidthConstraint(view, widthConstraint);
- RelativeLayout.SetHeightConstraint(view, heightConstraint);
-
- view.BatchCommit();
+ Parent.CreateBoundsFromConstraints(view, xConstraint, yConstraint, widthConstraint, heightConstraint);
base.Add(view);
}
diff --git a/Xamarin.Forms.Core/ResourceDictionary.cs b/Xamarin.Forms.Core/ResourceDictionary.cs
index a213dee5..ed3ea7f5 100644
--- a/Xamarin.Forms.Core/ResourceDictionary.cs
+++ b/Xamarin.Forms.Core/ResourceDictionary.cs
@@ -72,8 +72,6 @@ namespace Xamarin.Forms
public void Add(string key, object value)
{
- if (ContainsKey(key))
- throw new ArgumentException($"A resource with the key '{key}' is already present in the ResourceDictionary.");
_innerDictionary.Add(key, value);
OnValueChanged(key, value);
}
diff --git a/Xamarin.Forms.Platform.WP8/SplitOrderedList.cs b/Xamarin.Forms.Core/SplitOrderedList.cs
index 6f423210..6f423210 100644
--- a/Xamarin.Forms.Platform.WP8/SplitOrderedList.cs
+++ b/Xamarin.Forms.Core/SplitOrderedList.cs
diff --git a/Xamarin.Forms.Core/TargetPlatform.cs b/Xamarin.Forms.Core/TargetPlatform.cs
index ff34d83a..6125695f 100644
--- a/Xamarin.Forms.Core/TargetPlatform.cs
+++ b/Xamarin.Forms.Core/TargetPlatform.cs
@@ -9,6 +9,6 @@ namespace Xamarin.Forms
iOS,
Android,
WinPhone,
- Windows
+ Windows,
}
}
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index b2c9c745..5efcf42e 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -50,7 +50,6 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="AbsoluteLayoutFlags.cs" />
- <Compile Include="Accessibility.cs" />
<Compile Include="ActionSheetArguments.cs" />
<Compile Include="AlertArguments.cs" />
<Compile Include="AnimatableKey.cs" />
@@ -244,6 +243,7 @@
<Compile Include="Properties\GlobalAssemblyInfo.cs" />
<Compile Include="PropertyChangingEventArgs.cs" />
<Compile Include="IValueConverter.cs" />
+ <Compile Include="ConcurrentDictionary.cs" />
<Compile Include="PropertyChangingEventHandler.cs" />
<Compile Include="ReadOnlyCastingList.cs" />
<Compile Include="ReadOnlyListAdapter.cs" />
@@ -265,6 +265,7 @@
<Compile Include="SeparatorVisibility.cs" />
<Compile Include="SizeRequest.cs" />
<Compile Include="Span.cs" />
+ <Compile Include="SplitOrderedList.cs" />
<Compile Include="StackOrientation.cs" />
<Compile Include="StreamWrapper.cs" />
<Compile Include="SynchronizedList.cs" />
@@ -455,8 +456,6 @@
<Compile Include="ProvideCompiledAttribute.cs" />
<Compile Include="TypedBinding.cs" />
<Compile Include="XmlnsDefinitionAttribute.cs" />
- <Compile Include="PlatformConfiguration\macOSSpecific\TabbedPage.cs" />
- <Compile Include="PlatformConfiguration\macOSSpecific\TabsStyle.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<ItemGroup>
@@ -471,7 +470,4 @@
</PostBuildEvent>
</PropertyGroup>
<ItemGroup />
- <ItemGroup>
- <Folder Include="PlatformConfiguration\macOSSpecific\" />
- </ItemGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/Xamarin.Forms.Maps.iOS/FormsMaps.cs b/Xamarin.Forms.Maps.iOS/FormsMaps.cs
index 0f5df423..19c0701e 100644
--- a/Xamarin.Forms.Maps.iOS/FormsMaps.cs
+++ b/Xamarin.Forms.Maps.iOS/FormsMaps.cs
@@ -1,18 +1,12 @@
-#if __MOBILE__
using UIKit;
using Xamarin.Forms.Maps.iOS;
-#else
-using Xamarin.Forms.Maps.MacOS;
-#endif
namespace Xamarin
{
public static class FormsMaps
{
static bool s_isInitialized;
-#if __MOBILE__
static bool? s_isiOs8OrNewer;
- static bool? s_isiOs9OrNewer;
static bool? s_isiOs10OrNewer;
internal static bool IsiOs8OrNewer
@@ -25,16 +19,6 @@ namespace Xamarin
}
}
- internal static bool IsiOs9OrNewer
- {
- get
- {
- if (!s_isiOs9OrNewer.HasValue)
- s_isiOs9OrNewer = UIDevice.CurrentDevice.CheckSystemVersion(9, 0);
- return s_isiOs9OrNewer.Value;
- }
- }
-
internal static bool IsiOs10OrNewer
{
get
@@ -44,7 +28,7 @@ namespace Xamarin
return s_isiOs10OrNewer.Value;
}
}
-#endif
+
public static void Init()
{
if (s_isInitialized)
diff --git a/Xamarin.Forms.Maps.iOS/GeocoderBackend.cs b/Xamarin.Forms.Maps.iOS/GeocoderBackend.cs
index e5d1b25c..08ffbbec 100644
--- a/Xamarin.Forms.Maps.iOS/GeocoderBackend.cs
+++ b/Xamarin.Forms.Maps.iOS/GeocoderBackend.cs
@@ -1,22 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using Contacts;
-using CoreLocation;
-
-#if __MOBILE__
using AddressBookUI;
-using CCLGeocoder = CoreLocation.CLGeocoder;
-#else
-using Xamarin.Forms.Maps.MacOS.Extra;
-using CCLGeocoder = Xamarin.Forms.Maps.MacOS.Extra.CLGeocoder;
-#endif
+using CoreLocation;
-#if __MOBILE__
namespace Xamarin.Forms.Maps.iOS
-#else
-namespace Xamarin.Forms.Maps.MacOS
-#endif
{
internal class GeocoderBackend
{
@@ -29,36 +17,21 @@ namespace Xamarin.Forms.Maps.MacOS
static Task<IEnumerable<string>> GetAddressesForPositionAsync(Position position)
{
var location = new CLLocation(position.Latitude, position.Longitude);
- var geocoder = new CCLGeocoder();
+ var geocoder = new CLGeocoder();
var source = new TaskCompletionSource<IEnumerable<string>>();
geocoder.ReverseGeocodeLocation(location, (placemarks, error) =>
{
if (placemarks == null)
placemarks = new CLPlacemark[0];
- List<string> addresses = new List<string>();
-#if __MOBILE__
- addresses = placemarks.Select(p => ABAddressFormatting.ToString(p.AddressDictionary, false)).ToList();
-#else
- foreach (var item in placemarks)
- {
- var address = new CNMutablePostalAddress();
- address.Street = item.AddressDictionary["Street"] == null ? "" : item.AddressDictionary["Street"].ToString();
- address.State = item.AddressDictionary["State"] == null ? "" : item.AddressDictionary["State"].ToString();
- address.City = item.AddressDictionary["City"] == null ? "" : item.AddressDictionary["City"].ToString();
- address.Country = item.AddressDictionary["Country"] == null ? "" : item.AddressDictionary["Country"].ToString();
- address.PostalCode = item.AddressDictionary["ZIP"] == null ? "" : item.AddressDictionary["ZIP"].ToString();
- addresses.Add(CNPostalAddressFormatter.GetStringFrom(address, CNPostalAddressFormatterStyle.MailingAddress));
- }
-#endif
+ IEnumerable<string> addresses = placemarks.Select(p => ABAddressFormatting.ToString(p.AddressDictionary, false));
source.SetResult(addresses);
-
});
return source.Task;
}
static Task<IEnumerable<Position>> GetPositionsForAddressAsync(string address)
{
- var geocoder = new CCLGeocoder();
+ var geocoder = new CLGeocoder();
var source = new TaskCompletionSource<IEnumerable<Position>>();
geocoder.GeocodeAddress(address, (placemarks, error) =>
{
diff --git a/Xamarin.Forms.Maps.iOS/MapPool.cs b/Xamarin.Forms.Maps.iOS/MapPool.cs
index 1b3823c7..dc8a9c47 100644
--- a/Xamarin.Forms.Maps.iOS/MapPool.cs
+++ b/Xamarin.Forms.Maps.iOS/MapPool.cs
@@ -1,11 +1,7 @@
using System.Collections.Concurrent;
using MapKit;
-#if __MOBILE__
namespace Xamarin.Forms.Maps.iOS
-#else
-namespace Xamarin.Forms.Maps.MacOS
-#endif
{
// A static pool of MKMapView instances we can reuse
internal class MapPool
diff --git a/Xamarin.Forms.Maps.iOS/MapRenderer.cs b/Xamarin.Forms.Maps.iOS/MapRenderer.cs
index 44d95aa6..cc9f2533 100644
--- a/Xamarin.Forms.Maps.iOS/MapRenderer.cs
+++ b/Xamarin.Forms.Maps.iOS/MapRenderer.cs
@@ -5,27 +5,21 @@ using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using CoreLocation;
+using Foundation;
using MapKit;
using ObjCRuntime;
-using RectangleF = CoreGraphics.CGRect;
-using Foundation;
-
-#if __MOBILE__
using UIKit;
using Xamarin.Forms.Platform.iOS;
+using RectangleF = CoreGraphics.CGRect;
+
namespace Xamarin.Forms.Maps.iOS
-#else
-using AppKit;
-using Xamarin.Forms.Platform.MacOS;
-namespace Xamarin.Forms.Maps.MacOS
-#endif
{
internal class MapDelegate : MKMapViewDelegate
{
// keep references alive, removing this will cause a segfault
readonly List<object> List = new List<object>();
Map _map;
- object _lastTouchedView;
+ UIView _lastTouchedView;
bool _disposed;
internal MapDelegate(Map map)
@@ -55,10 +49,9 @@ namespace Xamarin.Forms.Maps.MacOS
return mapPin;
}
-#if __MOBILE__
+
void AttachGestureToPin(MKPinAnnotationView mapPin, IMKAnnotation annotation)
{
-
UIGestureRecognizer[] recognizers = mapPin.GestureRecognizers;
if (recognizers != null)
@@ -78,33 +71,9 @@ namespace Xamarin.Forms.Maps.MacOS
List.Add(action);
List.Add(recognizer);
mapPin.AddGestureRecognizer(recognizer);
- }
-#else
- void AttachGestureToPin(MKPinAnnotationView mapPin, IMKAnnotation annotation)
- {
- NSGestureRecognizer[] recognizers = mapPin.GestureRecognizers;
-
- if (recognizers != null)
- {
- foreach (NSGestureRecognizer r in recognizers)
- {
- mapPin.RemoveGestureRecognizer(r);
- }
- }
-
- Action<NSClickGestureRecognizer> action = g => OnClick(annotation, g);
- var recognizer = new NSClickGestureRecognizer(action);
- List.Add(action);
- List.Add(recognizer);
- mapPin.AddGestureRecognizer(recognizer);
-
}
-#endif
-#if __MOBILE__
+
void OnClick(object annotationObject, UITapGestureRecognizer recognizer)
-#else
- void OnClick(object annotationObject, NSClickGestureRecognizer recognizer)
-#endif
{
// https://bugzilla.xamarin.com/show_bug.cgi?id=26416
NSObject annotation = Runtime.GetNSObject(((IMKAnnotation)annotationObject).Handle);
@@ -157,9 +126,9 @@ namespace Xamarin.Forms.Maps.MacOS
public class MapRenderer : ViewRenderer
{
- CLLocationManager _locationManager;
+ CLLocationManager _locationManager;
bool _shouldUpdateRegion;
- bool _disposed;
+ bool _disposed;
const string MoveMessageName = "MapMoveToRegion";
@@ -168,15 +137,14 @@ namespace Xamarin.Forms.Maps.MacOS
return Control.GetSizeRequest(widthConstraint, heightConstraint);
}
- // iOS 9/10 have some issues with releasing memory from map views; each one we create allocates
+ // iOS 10 has some issues with releasing memory from map views; each one we create allocates
// a bunch of memory we can never get back. Until that's fixed, we'll just reuse MKMapViews
// as much as possible to prevent creating new ones and losing more memory
// For the time being, we don't want ViewRenderer handling disposal of the MKMapView
- // if we're on iOS 9 or 10; during Dispose we'll be putting the MKMapView in a pool instead
-#if __MOBILE__
- protected override bool ManageNativeControlLifetime => !FormsMaps.IsiOs9OrNewer;
-#endif
+ // if we're on iOS 10; during Dispose we'll be putting the MKMapView in a pool instead
+ protected override bool ManageNativeControlLifetime => !FormsMaps.IsiOs10OrNewer;
+
protected override void Dispose(bool disposing)
{
if (_disposed)
@@ -201,15 +169,15 @@ namespace Xamarin.Forms.Maps.MacOS
mkMapView.Delegate.Dispose();
mkMapView.Delegate = null;
mkMapView.RemoveFromSuperview();
-#if __MOBILE__
- if (FormsMaps.IsiOs9OrNewer)
+
+ if (FormsMaps.IsiOs10OrNewer)
{
// This renderer is done with the MKMapView; we can put it in the pool
// for other rendererers to use in the future
MapPool.Add(mkMapView);
}
-#endif
- // For iOS versions < 9, the MKMapView will be disposed in ViewRenderer's Dispose method
+
+ // For iOS versions < 10, the MKMapView will be disposed in ViewRenderer's Dispose method
if (_locationManager != null)
{
@@ -239,16 +207,16 @@ namespace Xamarin.Forms.Maps.MacOS
if (Control == null)
{
MKMapView mapView = null;
-#if __MOBILE__
- if (FormsMaps.IsiOs9OrNewer)
+
+ if (FormsMaps.IsiOs10OrNewer)
{
// See if we've got an MKMapView available in the pool; if so, use it
mapView = MapPool.Get();
}
-#endif
+
if (mapView == null)
{
- // If this is iOS 8 or lower, or if there weren't any MKMapViews in the pool,
+ // If this is iOS 9 or lower, or if there weren't any MKMapViews in the pool,
// create a new one
mapView = new MKMapView(RectangleF.Empty);
}
@@ -292,22 +260,9 @@ namespace Xamarin.Forms.Maps.MacOS
_shouldUpdateRegion = true;
}
-#if __MOBILE__
public override void LayoutSubviews()
{
base.LayoutSubviews();
- UpdateRegion();
- }
-#else
- public override void Layout()
- {
- base.Layout();
- UpdateRegion();
- }
-#endif
-
- void UpdateRegion()
- {
if (_shouldUpdateRegion)
{
MoveToRegion(((Map)Element).LastMoveToRegion, false);
@@ -388,13 +343,12 @@ namespace Xamarin.Forms.Maps.MacOS
void UpdateIsShowingUser()
{
-#if __MOBILE__
if (FormsMaps.IsiOs8OrNewer && ((Map)Element).IsShowingUser)
{
_locationManager = new CLLocationManager();
_locationManager.RequestWhenInUseAuthorization();
}
-#endif
+
((MKMapView)Control).ShowsUserLocation = ((Map)Element).IsShowingUser;
}
diff --git a/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs b/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs
index 48d3c847..823a8334 100755..100644
--- a/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs
+++ b/Xamarin.Forms.Maps/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using Xamarin.Forms;
@@ -13,15 +13,14 @@ using Xamarin.Forms.Internals;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
-[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.macOS")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.iOS")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.iOS.Classic")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.Android")]
-[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.Tizen")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.WP8")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.UWP")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.WinRT.Phone")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.WinRT.Tablet")]
+[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.Tizen")]
[assembly: InternalsVisibleTo("iOSUnitTests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Core.UnitTests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Core.Android.UnitTests")]
@@ -29,4 +28,4 @@ using Xamarin.Forms.Internals;
[assembly: InternalsVisibleTo("Xamarin.Forms.Xaml.UnitTests")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Xaml")]
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.Design")]
-[assembly: Preserve] \ No newline at end of file
+[assembly: Preserve]
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs
index aef56e11..4c33df85 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs
@@ -9,14 +9,11 @@ using Android.Support.V7.Widget;
using Android.Util;
using GlobalResource = Android.Resource;
using Object = Java.Lang.Object;
-using AView = Android.Views.View;
-using AMotionEvent = Android.Views.MotionEvent;
-using AMotionEventActions = Android.Views.MotionEventActions;
using static System.String;
namespace Xamarin.Forms.Platform.Android.AppCompat
{
- public class ButtonRenderer : ViewRenderer<Button, AppCompatButton>, AView.IOnAttachStateChangeListener
+ public class ButtonRenderer : ViewRenderer<Button, AppCompatButton>, global::Android.Views.View.IOnAttachStateChangeListener
{
TextColorSwitcher _textColorSwitcher;
float _defaultFontSize;
@@ -31,12 +28,12 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
global::Android.Widget.Button NativeButton => Control;
- void IOnAttachStateChangeListener.OnViewAttachedToWindow(AView attachedView)
+ void IOnAttachStateChangeListener.OnViewAttachedToWindow(global::Android.Views.View attachedView)
{
UpdateText();
}
- void IOnAttachStateChangeListener.OnViewDetachedFromWindow(AView detachedView)
+ void IOnAttachStateChangeListener.OnViewDetachedFromWindow(global::Android.Views.View detachedView)
{
}
@@ -77,7 +74,6 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
if (Control != null)
{
Control.SetOnClickListener(null);
- Control.SetOnTouchListener(null);
Control.RemoveOnAttachStateChangeListener(this);
Control.Tag = null;
_textColorSwitcher = null;
@@ -102,7 +98,6 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
AppCompatButton button = CreateNativeControl();
button.SetOnClickListener(ButtonClickListener.Instance.Value);
- button.SetOnTouchListener(ButtonTouchListener.Instance.Value);
button.Tag = this;
_textColorSwitcher = new TextColorSwitcher(button.TextColors);
SetNativeControl(button);
@@ -297,34 +292,11 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
#endregion
- public void OnClick(AView v)
+ public void OnClick(global::Android.Views.View v)
{
var renderer = v.Tag as ButtonRenderer;
((IButtonController)renderer?.Element)?.SendClicked();
}
}
-
- class ButtonTouchListener : Object, IOnTouchListener
- {
- public static readonly Lazy<ButtonTouchListener> Instance = new Lazy<ButtonTouchListener>(() => new ButtonTouchListener());
-
- public bool OnTouch(AView v, AMotionEvent e)
- {
- var renderer = v.Tag as ButtonRenderer;
- if (renderer != null)
- {
- var buttonController = renderer.Element as IButtonController;
- if (e.Action == AMotionEventActions.Down)
- {
- buttonController?.SendPressed();
- }
- else if (e.Action == AMotionEventActions.Up)
- {
- buttonController?.SendReleased();
- }
- }
- return false;
- }
- }
}
-}
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
index 223d3a83..2fe5d5d9 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
@@ -1,7 +1,6 @@
#region
using System;
-using System.Collections.Concurrent;
using System.ComponentModel;
using System.Linq;
using Android.App;
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs
index 7c40ea80..2b657b5e 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/FrameRenderer.cs
@@ -21,7 +21,6 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
float _defaultElevation = -1f;
float _defaultCornerRadius = -1f;
- int? _defaultLabelFor;
bool _clickable;
bool _disposed;
@@ -114,14 +113,6 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
ContentDescription = Element.AutomationId;
}
- void IVisualElementRenderer.SetLabelFor(int? id)
- {
- if (_defaultLabelFor == null)
- _defaultLabelFor = LabelFor;
-
- LabelFor = (int)(id ?? _defaultLabelFor);
- }
-
VisualElementTracker IVisualElementRenderer.Tracker => _visualElementTracker;
void IVisualElementRenderer.UpdateLayout()
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs
index 85ab6b73..757a98b4 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/MasterDetailPageRenderer.cs
@@ -165,10 +165,6 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
_tracker = new VisualElementTracker(this);
}
- void IVisualElementRenderer.SetLabelFor(int? id)
- {
- }
-
VisualElementTracker IVisualElementRenderer.Tracker => _tracker;
void IVisualElementRenderer.UpdateLayout()
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
index cc474293..cab4d561 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
@@ -268,7 +268,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
navController.RemovePageRequested += OnRemovePageRequested;
// If there is already stuff on the stack we need to push it
- foreach (Page page in navController.Pages)
+ foreach (Page page in navController.StackCopy.Reverse())
{
PushViewAsync(page, false);
}
@@ -461,7 +461,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
Task<bool> OnPopViewAsync(Page page, bool animated)
{
- Page pageToShow = ((INavigationPageController)Element).Peek(1);
+ Page pageToShow = ((INavigationPageController)Element).StackCopy.Skip(1).FirstOrDefault();
if (pageToShow == null)
return Task.FromResult(false);
diff --git a/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs b/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs
index fb1fa174..0a2397d8 100644
--- a/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs
+++ b/Xamarin.Forms.Platform.Android/FormsApplicationActivity.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Concurrent;
using System.ComponentModel;
using System.Linq;
using Android.App;
diff --git a/Xamarin.Forms.Platform.Android/IVisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/IVisualElementRenderer.cs
index da565ce2..99393516 100644
--- a/Xamarin.Forms.Platform.Android/IVisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/IVisualElementRenderer.cs
@@ -17,9 +17,6 @@ namespace Xamarin.Forms.Platform.Android
SizeRequest GetDesiredSize(int widthConstraint, int heightConstraint);
void SetElement(VisualElement element);
-
- void SetLabelFor(int? id);
-
void UpdateLayout();
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
index e07a2be5..4f384b3b 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ButtonRenderer.cs
@@ -7,8 +7,6 @@ using Android.Util;
using static System.String;
using AButton = Android.Widget.Button;
using AView = Android.Views.View;
-using AMotionEvent = Android.Views.MotionEvent;
-using AMotionEventActions = Android.Views.MotionEventActions;
using Object = Java.Lang.Object;
namespace Xamarin.Forms.Platform.Android
@@ -98,7 +96,6 @@ namespace Xamarin.Forms.Platform.Android
{
button = CreateNativeControl();
button.SetOnClickListener(ButtonClickListener.Instance.Value);
- button.SetOnTouchListener(ButtonTouchListener.Instance.Value);
button.Tag = this;
SetNativeControl(button);
_textColorSwitcher = new TextColorSwitcher(button.TextColors);
@@ -306,28 +303,5 @@ namespace Xamarin.Forms.Platform.Android
((IButtonController)renderer.Element).SendClicked();
}
}
-
- class ButtonTouchListener : Object, IOnTouchListener
- {
- public static readonly Lazy<ButtonTouchListener> Instance = new Lazy<ButtonTouchListener>(() => new ButtonTouchListener());
-
- public bool OnTouch(AView v, AMotionEvent e)
- {
- var renderer = v.Tag as ButtonRenderer;
- if (renderer != null)
- {
- var buttonController = renderer.Element as IButtonController;
- if (e.Action == AMotionEventActions.Down)
- {
- buttonController?.SendPressed();
- }
- else if (e.Action == AMotionEventActions.Up)
- {
- buttonController?.SendReleased();
- }
- }
- return false;
- }
- }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.Android/Renderers/EditorEditText.cs b/Xamarin.Forms.Platform.Android/Renderers/EditorEditText.cs
index 4a6428eb..24273121 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/EditorEditText.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/EditorEditText.cs
@@ -23,12 +23,13 @@ namespace Xamarin.Forms.Platform.Android
public override bool OnKeyPreIme(Keycode keyCode, KeyEvent e)
{
- if (keyCode != Keycode.Back || e.Action != KeyEventActions.Down)
- return base.OnKeyPreIme(keyCode, e);
-
- this.HideKeyboard();
- OnBackKeyboardPressed?.Invoke(this, EventArgs.Empty);
- return true;
+ if (keyCode == Keycode.Back && e.Action == KeyEventActions.Down)
+ {
+ EventHandler handler = OnBackKeyboardPressed;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
+ }
+ return base.OnKeyPreIme(keyCode, e);
}
public override bool RequestFocus(FocusSearchDirection direction, Rect previouslyFocusedRect)
diff --git a/Xamarin.Forms.Platform.Android/Renderers/EntryEditText.cs b/Xamarin.Forms.Platform.Android/Renderers/EntryEditText.cs
index 5c0b7c0e..de03a414 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/EntryEditText.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/EntryEditText.cs
@@ -23,12 +23,13 @@ namespace Xamarin.Forms.Platform.Android
public override bool OnKeyPreIme(Keycode keyCode, KeyEvent e)
{
- if (keyCode != Keycode.Back || e.Action != KeyEventActions.Down)
- return base.OnKeyPreIme(keyCode, e);
-
- this.HideKeyboard();
- OnKeyboardBackPressed?.Invoke(this, EventArgs.Empty);
- return true;
+ if (keyCode == Keycode.Back && e.Action == KeyEventActions.Down)
+ {
+ EventHandler handler = OnKeyboardBackPressed;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
+ }
+ return base.OnKeyPreIme(keyCode, e);
}
public override bool RequestFocus(FocusSearchDirection direction, Rect previouslyFocusedRect)
diff --git a/Xamarin.Forms.Platform.Android/Renderers/MasterDetailRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/MasterDetailRenderer.cs
index d18781a7..ec9c620e 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/MasterDetailRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/MasterDetailRenderer.cs
@@ -287,10 +287,6 @@ namespace Xamarin.Forms.Platform.Android
SetDrawerLockMode(_page.IsGestureEnabled ? LockModeUnlocked : LockModeLockedClosed);
}
- void IVisualElementRenderer.SetLabelFor(int? id)
- {
- }
-
void SetLockMode(int lockMode)
{
if (_currentLockMode != lockMode)
diff --git a/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs
index bf6540b9..c02dc42b 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/NavigationRenderer.cs
@@ -109,7 +109,7 @@ namespace Xamarin.Forms.Platform.Android
newNavController.RemovePageRequested += OnRemovePageRequested;
// If there is already stuff on the stack we need to push it
- foreach (Page page in newNavController.Pages)
+ foreach(Page page in newNavController.StackCopy.Reverse())
{
PushViewAsync(page, false);
}
@@ -130,7 +130,7 @@ namespace Xamarin.Forms.Platform.Android
protected virtual Task<bool> OnPopViewAsync(Page page, bool animated)
{
- Page pageToShow = ((INavigationPageController)Element).Peek(1);
+ Page pageToShow = ((INavigationPageController)Element).StackCopy.Skip(1).FirstOrDefault();
if (pageToShow == null)
return Task.FromResult(false);
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ScrollViewRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ScrollViewRenderer.cs
index a2e3ddb3..6db51c23 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ScrollViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ScrollViewRenderer.cs
@@ -328,10 +328,6 @@ namespace Xamarin.Forms.Platform.Android
}
}
- void IVisualElementRenderer.SetLabelFor(int? id)
- {
- }
-
void UpdateBackgroundColor()
{
SetBackgroundColor(Element.BackgroundColor.ToAndroid(Color.Transparent));
diff --git a/Xamarin.Forms.Platform.Android/Renderers/SearchBarRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/SearchBarRenderer.cs
index 48bcf576..468710ca 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/SearchBarRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/SearchBarRenderer.cs
@@ -33,7 +33,7 @@ namespace Xamarin.Forms.Platform.Android
bool SearchView.IOnQueryTextListener.OnQueryTextSubmit(string query)
{
((ISearchBarController)Element).OnSearchButtonPressed();
- ClearFocus(Control);
+ Control.ClearFocus();
return true;
}
@@ -67,7 +67,7 @@ namespace Xamarin.Forms.Platform.Android
_inputType = InputTypes.ClassText | InputTypes.TextFlagAutoComplete | InputTypes.TextFlagNoSuggestions;
}
- ClearFocus(searchView);
+ searchView.ClearFocus();
UpdatePlaceholder();
UpdateText();
UpdateEnabled();
@@ -113,7 +113,7 @@ namespace Xamarin.Forms.Platform.Android
internal override void OnNativeFocusChanged(bool hasFocus)
{
if (hasFocus && !Element.IsEnabled)
- ClearFocus(Control);
+ Control.ClearFocus();
}
void UpdateAlignment()
@@ -148,7 +148,7 @@ namespace Xamarin.Forms.Platform.Android
SearchView control = Control;
if (!model.IsEnabled)
{
- ClearFocus(control);
+ control.ClearFocus();
// removes cursor in SearchView
control.SetInputType(InputTypes.Null);
}
@@ -156,18 +156,6 @@ namespace Xamarin.Forms.Platform.Android
control.SetInputType(_inputType);
}
- void ClearFocus(SearchView view)
- {
- try
- {
- view.ClearFocus();
- }
- catch (Java.Lang.UnsupportedOperationException)
- {
- // silently catch these as they happen in the previewer due to some bugs in upstread android
- }
- }
-
void UpdateFont()
{
_editText = _editText ?? Control.GetChildrenOfType<EditText>().FirstOrDefault();
diff --git a/Xamarin.Forms.Platform.Android/ViewRenderer.cs b/Xamarin.Forms.Platform.Android/ViewRenderer.cs
index 31a9c282..c4bd3fa0 100644
--- a/Xamarin.Forms.Platform.Android/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/ViewRenderer.cs
@@ -19,9 +19,6 @@ namespace Xamarin.Forms.Platform.Android
}
ViewGroup _container;
- string _defaultContentDescription;
- bool? _defaultFocusable;
- string _defaultHint;
bool _disposed;
EventHandler<VisualElement.FocusRequestArgs> _focusChangeHandler;
@@ -69,7 +66,7 @@ namespace Xamarin.Forms.Platform.Android
{
if (Control == null)
return (base.GetDesiredSize(widthConstraint, heightConstraint));
-
+
AView view = _container == this ? (AView)Control : _container;
view.Measure(widthConstraint, heightConstraint);
@@ -127,8 +124,6 @@ namespace Xamarin.Forms.Platform.Android
if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
UpdateIsEnabled();
- else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
- SetLabeledBy();
}
protected override void OnLayout(bool changed, int l, int t, int r, int b)
@@ -160,79 +155,6 @@ namespace Xamarin.Forms.Platform.Android
}
}
- protected override void SetContentDescription()
- {
- if (Control == null)
- {
- base.SetContentDescription();
- return;
- }
-
- if (Element == null)
- return;
-
- if (SetHint())
- return;
-
- if (_defaultContentDescription == null)
- _defaultContentDescription = Control.ContentDescription;
-
- var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- Control.ContentDescription = elemValue;
- else
- Control.ContentDescription = _defaultContentDescription;
- }
-
- protected override void SetFocusable()
- {
- if (Control == null)
- {
- base.SetFocusable();
- return;
- }
-
- if (Element == null)
- return;
-
- if (!_defaultFocusable.HasValue)
- _defaultFocusable = Control.Focusable;
-
- Control.Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
- }
-
- protected override bool SetHint()
- {
- if (Control == null)
- {
- return base.SetHint();
- }
-
- if (Element == null)
- return false;
-
- var textView = Control as global::Android.Widget.TextView;
- if (textView == null)
- return false;
-
- // Let the specified Title/Placeholder take precedence, but don't set the ContentDescription (won't work anyway)
- if (((Element as Picker)?.Title ?? (Element as Entry)?.Placeholder ?? (Element as EntryCell)?.Placeholder) != null)
- return true;
-
- if (_defaultHint == null)
- _defaultHint = textView.Hint;
-
- var elemValue = string.Join(". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- textView.Hint = elemValue;
- else
- textView.Hint = _defaultHint;
-
- return true;
- }
-
protected void SetNativeControl(TNativeView control)
{
SetNativeControl(control, this);
@@ -297,25 +219,6 @@ namespace Xamarin.Forms.Platform.Android
Control.OnFocusChangeListener = this;
UpdateIsEnabled();
- SetLabeledBy();
- }
-
- void SetLabeledBy()
- {
- if (Element == null || Control == null)
- return;
-
- var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
-
- if (elemValue != null)
- {
- var id = Control.Id;
- if (id == -1)
- id = Control.Id = FormsAppCompatActivity.GetUniqueId();
-
- var renderer = elemValue?.GetRenderer();
- renderer?.SetLabelFor(id);
- }
}
void UpdateIsEnabled()
diff --git a/Xamarin.Forms.Platform.Android/VisualElementExtensions.cs b/Xamarin.Forms.Platform.Android/VisualElementExtensions.cs
index 800a967e..13f2fffa 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementExtensions.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementExtensions.cs
@@ -1,19 +1,7 @@
-using System;
-
namespace Xamarin.Forms.Platform.Android
{
public static class VisualElementExtensions
{
- public static IVisualElementRenderer GetRenderer(this VisualElement self)
- {
- if (self == null)
- throw new ArgumentNullException("self");
-
- IVisualElementRenderer renderer = Platform.GetRenderer(self);
-
- return renderer;
- }
-
public static bool ShouldBeMadeClickable(this View view)
{
var shouldBeClickable = false;
diff --git a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
index 68f5d7d4..c2c96eac 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
@@ -23,10 +23,6 @@ namespace Xamarin.Forms.Platform.Android
VisualElementRendererFlags _flags = VisualElementRendererFlags.AutoPackage | VisualElementRendererFlags.AutoTrack;
- string _defaultContentDescription;
- bool? _defaultFocusable;
- string _defaultHint;
- int? _defaultLabelFor;
InnerGestureListener _gestureListener;
VisualElementPackager _packager;
PropertyChangedEventHandler _propertyChangeHandler;
@@ -213,9 +209,6 @@ namespace Xamarin.Forms.Platform.Android
if (element != null && !string.IsNullOrEmpty(element.AutomationId))
SetAutomationId(element.AutomationId);
- SetContentDescription();
- SetFocusable();
-
Performance.Stop();
}
@@ -307,12 +300,6 @@ namespace Xamarin.Forms.Platform.Android
UpdateBackgroundColor();
else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
InputTransparent = Element.InputTransparent;
- else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
- SetContentDescription();
- else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
- SetContentDescription();
- else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
- SetFocusable();
}
protected override void OnLayout(bool changed, int l, int t, int r, int b)
@@ -342,62 +329,6 @@ namespace Xamarin.Forms.Platform.Android
ContentDescription = id;
}
- protected virtual void SetContentDescription()
- {
- if (Element == null)
- return;
-
- if (SetHint())
- return;
-
- if (_defaultContentDescription == null)
- _defaultContentDescription = ContentDescription;
-
- var elemValue = string.Join(" ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- ContentDescription = elemValue;
- else
- ContentDescription = _defaultContentDescription;
- }
-
- protected virtual void SetFocusable()
- {
- if (Element == null)
- return;
-
- if (!_defaultFocusable.HasValue)
- _defaultFocusable = Focusable;
-
- Focusable = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultFocusable);
- }
-
- protected virtual bool SetHint()
- {
- if (Element == null)
- return false;
-
- var textView = this as global::Android.Widget.TextView;
- if (textView == null)
- return false;
-
- // Let the specified Title/Placeholder take precedence, but don't set the ContentDescription (won't work anyway)
- if (((Element as Picker)?.Title ?? (Element as Entry)?.Placeholder ?? (Element as EntryCell)?.Placeholder) != null)
- return true;
-
- if (_defaultHint == null)
- _defaultHint = textView.Hint;
-
- var elemValue = string.Join(". ", (string)Element.GetValue(Accessibility.NameProperty), (string)Element.GetValue(Accessibility.HintProperty));
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- textView.Hint = elemValue;
- else
- textView.Hint = _defaultHint;
-
- return true;
- }
-
protected void SetPackager(VisualElementPackager packager)
{
_packager = packager;
@@ -424,14 +355,6 @@ namespace Xamarin.Forms.Platform.Android
UpdateGestureRecognizers();
}
- void IVisualElementRenderer.SetLabelFor(int? id)
- {
- if (_defaultLabelFor == null)
- _defaultLabelFor = LabelFor;
-
- LabelFor = (int)(id ?? _defaultLabelFor);
- }
-
void SubscribeGestureRecognizers(VisualElement element)
{
var view = element as View;
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
index 5844ccf3..0faec61d 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
@@ -112,11 +112,6 @@ namespace Xamarin.Forms.Platform.UWP
return new SizeRequest(new Size(size.Width, size.Height));
}
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return Control;
- }
-
public void SetElement(VisualElement element)
{
MasterDetailPage old = Element;
diff --git a/Xamarin.Forms.Platform.UAP/NavigationPageRendererUWP.cs b/Xamarin.Forms.Platform.UAP/NavigationPageRendererUWP.cs
deleted file mode 100644
index a56ce903..00000000
--- a/Xamarin.Forms.Platform.UAP/NavigationPageRendererUWP.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using Windows.UI.Core;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Data;
-using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
-
-namespace Xamarin.Forms.Platform.UWP
-{
- public partial class NavigationPageRenderer : IToolBarForegroundBinder
- {
- SystemNavigationManager _navManager;
-
- public void BindForegroundColor(AppBar appBar)
- {
- SetAppBarForegroundBinding(appBar);
- }
-
- public void BindForegroundColor(AppBarButton button)
- {
- SetAppBarForegroundBinding(button);
- }
-
- void SetAppBarForegroundBinding(FrameworkElement element)
- {
- element.SetBinding(Control.ForegroundProperty,
- new Windows.UI.Xaml.Data.Binding { Path = new PropertyPath("TitleBrush"), Source = _container, RelativeSource = new RelativeSource { Mode = RelativeSourceMode.TemplatedParent } });
- }
-
- void UpdateToolbarPlacement()
- {
- if (_container == null)
- {
- return;
- }
-
- _container.ToolbarPlacement = Element.OnThisPlatform().GetToolbarPlacement();
- }
-
- void UpdateShowTitle()
- {
- ((ITitleProvider)this).ShowTitle = _parentTabbedPage == null && _parentMasterDetailPage == null;
- }
-
- static object GetDefaultColor()
- {
- return Windows.UI.Xaml.Application.Current.Resources["SystemControlBackgroundChromeMediumLowBrush"];
- }
-
- void UpdateBackButton()
- {
- bool showBackButton = PageController.InternalChildren.Count > 1 && NavigationPage.GetHasBackButton(_currentPage);
- _container.ShowBackButton = showBackButton;
-
- if (_navManager != null)
- {
- _navManager.AppViewBackButtonVisibility = showBackButton ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
- }
- }
-
- async void UpdateTitleOnParents()
- {
- if (Element == null)
- return;
-
- ITitleProvider render = null;
- if (_parentTabbedPage != null)
- {
- render = Platform.GetRenderer(_parentTabbedPage) as ITitleProvider;
- if (render != null)
- render.ShowTitle = (_parentTabbedPage.CurrentPage == Element) && NavigationPage.GetHasNavigationBar(_currentPage);
- }
-
- if (_parentMasterDetailPage != null)
- {
- render = Platform.GetRenderer(_parentMasterDetailPage) as ITitleProvider;
- if (render != null)
- render.ShowTitle = (_parentMasterDetailPage.Detail == Element) && NavigationPage.GetHasNavigationBar(_currentPage);
- }
-
- if (render != null && render.ShowTitle)
- {
- render.Title = _currentPage.Title;
- render.BarBackgroundBrush = GetBarBackgroundBrush();
- render.BarForegroundBrush = GetBarForegroundBrush();
- }
-
- if (_showTitle || (render != null && render.ShowTitle))
- {
- var platform = Element.Platform as Platform;
- if (platform != null)
- {
- await platform.UpdateToolbarItems();
- }
- }
- }
- }
-}
diff --git a/Xamarin.Forms.Platform.UAP/PlatformUWP.cs b/Xamarin.Forms.Platform.UAP/PlatformUWP.cs
deleted file mode 100644
index 83cb9129..00000000
--- a/Xamarin.Forms.Platform.UAP/PlatformUWP.cs
+++ /dev/null
@@ -1,257 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Windows.ApplicationModel.Core;
-using Windows.Foundation;
-using Windows.Foundation.Metadata;
-using Windows.UI;
-using Windows.UI.Core;
-using Windows.UI.ViewManagement;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-
-namespace Xamarin.Forms.Platform.UWP
-{
- public abstract partial class Platform
- {
- internal static StatusBar MobileStatusBar => ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar") ? StatusBar.GetForCurrentView() : null;
-
- IToolbarProvider _toolbarProvider;
-
- void InitializeStatusBar()
- {
- StatusBar statusBar = MobileStatusBar;
- if (statusBar != null)
- {
- statusBar.Showing += (sender, args) => UpdateBounds();
- statusBar.Hiding += (sender, args) => UpdateBounds();
-
- // UWP 14393 Bug: If RequestedTheme is Light (which it is by default), then the
- // status bar uses White Foreground with White Background.
- // UWP 10586 Bug: If RequestedTheme is Light (which it is by default), then the
- // status bar uses Black Foreground with Black Background.
- // Since the Light theme should have a Black on White status bar, we will set it explicitly.
- // This can be overriden by setting the status bar colors in App.xaml.cs OnLaunched.
-
- if (statusBar.BackgroundColor == null && statusBar.ForegroundColor == null && Windows.UI.Xaml.Application.Current.RequestedTheme == ApplicationTheme.Light)
- {
- statusBar.BackgroundColor = Colors.White;
- statusBar.ForegroundColor = Colors.Black;
- statusBar.BackgroundOpacity = 1;
- }
- }
- }
-
- void UpdateToolbarTitle(Page page)
- {
- if (_toolbarProvider == null)
- return;
-
- ((ToolbarProvider)_toolbarProvider).CommandBar.Content = page.Title;
- }
-
- async void OnPageActionSheet(Page sender, ActionSheetArguments options)
- {
- List<string> buttons = options.Buttons.ToList();
-
- var list = new Windows.UI.Xaml.Controls.ListView
- {
- Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
- ItemsSource = buttons,
- IsItemClickEnabled = true
- };
-
- var dialog = new ContentDialog
- {
- Template = (Windows.UI.Xaml.Controls.ControlTemplate)Windows.UI.Xaml.Application.Current.Resources["MyContentDialogControlTemplate"],
- Content = list,
- Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetStyle"]
- };
-
- if (options.Title != null)
- dialog.Title = options.Title;
-
- list.ItemClick += (s, e) =>
- {
- dialog.Hide();
- options.SetResult((string)e.ClickedItem);
- };
-
- TypedEventHandler<CoreWindow, CharacterReceivedEventArgs> onEscapeButtonPressed = delegate (CoreWindow window, CharacterReceivedEventArgs args)
- {
- if (args.KeyCode == 27)
- {
- dialog.Hide();
- options.SetResult(ContentDialogResult.None.ToString());
- }
- };
-
- Window.Current.CoreWindow.CharacterReceived += onEscapeButtonPressed;
-
- _actionSheetOptions = options;
-
- if (options.Cancel != null)
- dialog.SecondaryButtonText = options.Cancel;
-
- if (options.Destruction != null)
- dialog.PrimaryButtonText = options.Destruction;
-
- ContentDialogResult result = await dialog.ShowAsync();
- if (result == ContentDialogResult.Secondary)
- options.SetResult(options.Cancel);
- else if (result == ContentDialogResult.Primary)
- options.SetResult(options.Destruction);
-
- Window.Current.CoreWindow.CharacterReceived -= onEscapeButtonPressed;
- }
-
- void ClearCommandBar()
- {
- if (_toolbarProvider != null)
- {
- _toolbarProvider = null;
- if (Device.Idiom == TargetIdiom.Phone)
- _page.BottomAppBar = null;
- else
- _page.TopAppBar = null;
- }
- }
-
- CommandBar CreateCommandBar()
- {
- var bar = new FormsCommandBar();
- if (Device.Idiom != TargetIdiom.Phone)
- bar.Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["TitleToolbar"];
-
- _toolbarProvider = new ToolbarProvider(bar);
-
- if (Device.Idiom == TargetIdiom.Phone)
- _page.BottomAppBar = bar;
- else
- _page.TopAppBar = bar;
-
- return bar;
- }
-
- async Task<CommandBar> GetCommandBarAsync()
- {
- IToolbarProvider provider = GetToolbarProvider();
- if (provider == null)
- {
- return null;
- }
-
- return await provider.GetCommandBarAsync();
- }
-
- void UpdateBounds()
- {
- _bounds = new Rectangle(0, 0, _page.ActualWidth, _page.ActualHeight);
-
- StatusBar statusBar = MobileStatusBar;
- if (statusBar != null)
- {
- bool landscape = Device.Info.CurrentOrientation.IsLandscape();
- bool titleBar = CoreApplication.GetCurrentView().TitleBar.IsVisible;
- double offset = landscape ? statusBar.OccludedRect.Width : statusBar.OccludedRect.Height;
-
- _bounds = new Rectangle(0, 0, _page.ActualWidth - (landscape ? offset : 0), _page.ActualHeight - (landscape ? 0 : offset));
-
- // Even if the MainPage is a ContentPage not inside of a NavigationPage, the calculated bounds
- // assume the TitleBar is there even if it isn't visible. When UpdatePageSizes is called,
- // _container.ActualWidth is correct because it's aware that the TitleBar isn't there, but the
- // bounds aren't, and things can subsequently run under the StatusBar.
- if (!titleBar)
- {
- _bounds.Width -= (_bounds.Width - _container.ActualWidth);
- }
- }
- }
-
- internal async Task UpdateToolbarItems()
- {
- CommandBar commandBar = await GetCommandBarAsync();
- if (commandBar != null)
- {
- commandBar.PrimaryCommands.Clear();
- commandBar.SecondaryCommands.Clear();
-
- if (_page.BottomAppBar != null || _page.TopAppBar != null)
- {
- _page.BottomAppBar = null;
- _page.TopAppBar = null;
- _page.InvalidateMeasure();
- }
- }
-
- var toolBarProvider = GetToolbarProvider() as IToolBarForegroundBinder;
-
- foreach (ToolbarItem item in _toolbarTracker.ToolbarItems.OrderBy(ti => ti.Priority))
- {
- if (commandBar == null)
- commandBar = CreateCommandBar();
-
- toolBarProvider?.BindForegroundColor(commandBar);
-
- var button = new AppBarButton();
- button.SetBinding(AppBarButton.LabelProperty, "Text");
- button.SetBinding(AppBarButton.IconProperty, "Icon", _fileImageSourcePathConverter);
- button.Command = new MenuItemCommand(item);
- button.DataContext = item;
-
- ToolbarItemOrder order = item.Order == ToolbarItemOrder.Default ? ToolbarItemOrder.Primary : item.Order;
- if (order == ToolbarItemOrder.Primary)
- {
- toolBarProvider?.BindForegroundColor(button);
- commandBar.PrimaryCommands.Add(button);
- }
- else
- {
- commandBar.SecondaryCommands.Add(button);
- }
- }
-
- if (commandBar?.PrimaryCommands.Count + commandBar?.SecondaryCommands.Count == 0)
- ClearCommandBar();
- }
-
- internal IToolbarProvider GetToolbarProvider()
- {
- IToolbarProvider provider = null;
-
- Page element = _currentPage;
- while (element != null)
- {
- provider = GetRenderer(element) as IToolbarProvider;
- if (provider != null)
- break;
-
- var pageContainer = element as IPageContainer<Page>;
- element = pageContainer?.CurrentPage;
- }
-
- if (provider != null && _toolbarProvider == null)
- ClearCommandBar();
-
- return provider;
- }
-
- class ToolbarProvider : IToolbarProvider
- {
- readonly Task<CommandBar> _commandBar;
-
- public ToolbarProvider(CommandBar commandBar)
- {
- _commandBar = Task.FromResult(commandBar);
- }
-
- public CommandBar CommandBar => _commandBar.Result;
-
- public Task<CommandBar> GetCommandBarAsync()
- {
- return _commandBar;
- }
- }
- }
-}
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
index c278e394..02b73c94 100644
--- a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
@@ -122,12 +122,7 @@ namespace Xamarin.Forms.Platform.UWP
return new SizeRequest(result);
}
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return Control;
- }
-
- public void SetElement(VisualElement element)
+ public void SetElement(VisualElement element)
{
if (element != null && !(element is TabbedPage))
throw new ArgumentException("Element must be a TabbedPage", "element");
diff --git a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
index ec7bca5a..66ab6023 100644
--- a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
+++ b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
@@ -192,8 +192,6 @@
<Compile Include="IToolBarForegroundBinder.cs" />
<Compile Include="NativeBindingService.cs" />
<Compile Include="NativeValueConverterService.cs" />
- <Compile Include="NavigationPageRendererUWP.cs" />
- <Compile Include="PlatformUWP.cs" />
<Compile Include="SearchBarRenderer.cs" />
<Compile Include="..\Xamarin.Forms.Platform.WinRT\TextAlignmentToHorizontalAlignmentConverter.cs">
<Link>TextAlignmentToHorizontalAlignmentConverter.cs</Link>
diff --git a/Xamarin.Forms.Platform.WP8/ButtonRenderer.cs b/Xamarin.Forms.Platform.WP8/ButtonRenderer.cs
index e44d244c..a84a3db6 100644
--- a/Xamarin.Forms.Platform.WP8/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/ButtonRenderer.cs
@@ -2,7 +2,6 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Xamarin.Forms.Internals;
@@ -21,9 +20,7 @@ namespace Xamarin.Forms.Platform.WinPhone
base.OnElementChanged(e);
var button = new WButton();
- button.ClickMode = ClickMode.Press;
button.Click += HandleButtonClick;
- button.AddHandler(UIElement.TapEvent, new EventHandler<GestureEventArgs>(HandleButtonTap), true);
SetNativeControl(button);
UpdateContent();
@@ -63,13 +60,9 @@ namespace Xamarin.Forms.Platform.WinPhone
void HandleButtonClick(object sender, RoutedEventArgs e)
{
- ((IButtonController)Element)?.SendPressed();
- }
-
- void HandleButtonTap(object sender, GestureEventArgs e)
- {
- ((IButtonController)Element)?.SendReleased();
- ((IButtonController)Element)?.SendClicked();
+ Button buttonView = Element;
+ if (buttonView != null)
+ ((IButtonController)buttonView).SendClicked();
}
void UpdateBackground()
diff --git a/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs
index e2837f05..1637b1d0 100644
--- a/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/NavigationPageRenderer.cs
@@ -139,7 +139,7 @@ namespace Xamarin.Forms.Platform.WinPhone
var platform = Element.Platform as Platform;
if (platform != null)
{
- if (e.Page == ((INavigationPageController)Element).Pages.FirstOrDefault())
+ if (e.Page == ((INavigationPageController)Element).StackCopy.LastOrDefault())
((IPageController)e.Page).IgnoresContainerArea = true;
e.Task = platform.PushCore(e.Page, Element, e.Animated, e.Realize).ContinueWith((t, o) => true, null);
}
diff --git a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
index 005f503e..e78234f5 100644
--- a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
+++ b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
@@ -145,7 +145,6 @@
<Compile Include="BrushHelpers.cs" />
<Compile Include="CellControl.cs" />
<Compile Include="CollapseWhenEmptyConverter.cs" />
- <Compile Include="ConcurrentDictionary.cs" />
<Compile Include="Deserializer.cs" />
<Compile Include="CustomContextMenu.cs" />
<Compile Include="ElementChangedEventArgs.cs" />
@@ -198,7 +197,6 @@
<Compile Include="ScrollViewRenderer.cs" />
<Compile Include="SearchBarRenderer.cs" />
<Compile Include="SliderRenderer.cs" />
- <Compile Include="SplitOrderedList.cs" />
<Compile Include="StepperRenderer.cs" />
<Compile Include="SwitchRenderer.cs" />
<Compile Include="TabbedPageRenderer.cs" />
diff --git a/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
index fe660ff9..25c4d9ed 100644
--- a/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT.Phone/TabbedPageRenderer.cs
@@ -135,11 +135,6 @@ namespace Xamarin.Forms.Platform.WinRT
return new SizeRequest(result);
}
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return null;
- }
-
public void Dispose()
{
Dispose(true);
diff --git a/Xamarin.Forms.Platform.WinRT.Phone/WindowsPhoneResourcesProvider.cs b/Xamarin.Forms.Platform.WinRT.Phone/WindowsPhoneResourcesProvider.cs
index 7b05159c..adbe7dea 100644
--- a/Xamarin.Forms.Platform.WinRT.Phone/WindowsPhoneResourcesProvider.cs
+++ b/Xamarin.Forms.Platform.WinRT.Phone/WindowsPhoneResourcesProvider.cs
@@ -1,7 +1,9 @@
-using Windows.UI.Text;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
-using WStyle = Windows.UI.Xaml.Style;
namespace Xamarin.Forms.Platform.WinRT
{
@@ -10,50 +12,89 @@ namespace Xamarin.Forms.Platform.WinRT
{
public IResourceDictionary GetSystemResources()
{
- var prototype = new TextBlock();
-
- return new ResourceDictionary
- {
- [Device.Styles.TitleStyleKey] = GetStyle("HeaderTextBlockStyle", prototype),
- [Device.Styles.SubtitleStyleKey] = GetStyle("SubheaderTextBlockStyle", prototype),
- [Device.Styles.BodyStyleKey] = GetStyle("BodyTextBlockStyle", prototype),
- [Device.Styles.CaptionStyleKey] = GetStyle("BodyTextBlockStyle", prototype),
- [Device.Styles.ListItemTextStyleKey] = GetStyle("ListViewItemTextBlockStyle", prototype),
- [Device.Styles.ListItemDetailTextStyleKey] = GetStyle("ListViewItemContentTextBlockStyle", prototype)
- };
+ var windowsResources = Windows.UI.Xaml.Application.Current.Resources;
+
+ var resources = new ResourceDictionary ();
+ resources[Device.Styles.TitleStyleKey] = GetStyle ("HeaderTextBlockStyle");
+ resources[Device.Styles.SubtitleStyleKey] = GetStyle ("SubheaderTextBlockStyle");
+ resources[Device.Styles.BodyStyleKey] = GetStyle ("BodyTextBlockStyle");
+ resources[Device.Styles.CaptionStyleKey] = GetStyle ("BodyTextBlockStyle");
+ resources[Device.Styles.ListItemTextStyleKey] = GetStyle ("ListViewItemTextBlockStyle");
+ resources[Device.Styles.ListItemDetailTextStyleKey] = GetStyle ("ListViewItemContentTextBlockStyle");
+ return resources;
}
- static Style GetStyle(object nativeKey, TextBlock prototype)
+ Style GetStyle (object nativeKey)
{
- var style = (WStyle)Windows.UI.Xaml.Application.Current.Resources[nativeKey];
+ var style = (Windows.UI.Xaml.Style) Windows.UI.Xaml.Application.Current.Resources[nativeKey];
+ style = GetAncestorSetters(style);
- prototype.Style = style;
+ var formsStyle = new Style (typeof (Label));
+ foreach (var b in style.Setters) {
+ var setter = b as Windows.UI.Xaml.Setter;
+ if (setter == null)
+ continue;
- var formsStyle = new Style(typeof(Label));
+ // TODO: Need to implement a stealth pass-through for things we don't support
- formsStyle.Setters.Add(Label.FontSizeProperty, prototype.FontSize);
- formsStyle.Setters.Add(Label.FontFamilyProperty, prototype.FontFamily.Source);
- formsStyle.Setters.Add(Label.FontAttributesProperty, ToAttributes(prototype.FontWeight));
- formsStyle.Setters.Add(Label.LineBreakModeProperty, ToLineBreakMode(prototype.TextWrapping));
+ if (setter.Property == TextBlock.FontSizeProperty)
+ formsStyle.Setters.Add (Label.FontSizeProperty, setter.Value);
+ else if (setter.Property == TextBlock.FontFamilyProperty)
+ formsStyle.Setters.Add (Label.FontFamilyProperty, setter.Value);
+ else if (setter.Property == TextBlock.FontWeightProperty)
+ formsStyle.Setters.Add (Label.FontAttributesProperty, ToAttributes (Convert.ToUInt16 (setter.Value)));
+ else if (setter.Property == TextBlock.TextWrappingProperty)
+ formsStyle.Setters.Add (Label.LineBreakModeProperty, ToLineBreakMode ((TextWrapping) setter.Value));
+ }
return formsStyle;
}
- static FontAttributes ToAttributes(FontWeight fontWeight)
+ static Windows.UI.Xaml.Style GetAncestorSetters (Windows.UI.Xaml.Style value)
{
- if (fontWeight.Weight == FontWeights.Bold.Weight || fontWeight.Weight == FontWeights.SemiBold.Weight
- || fontWeight.Weight == FontWeights.ExtraBold.Weight)
+ var style = new Windows.UI.Xaml.Style (value.TargetType)
{
- return FontAttributes.Bold;
+ BasedOn = value.BasedOn
+ };
+ foreach (var valSetter in value.Setters)
+ {
+ style.Setters.Add(valSetter);
}
- return FontAttributes.None;
+ var ancestorStyles = new List<Windows.UI.Xaml.Style> ();
+
+ Windows.UI.Xaml.Style currStyle = style;
+ while (currStyle.BasedOn != null)
+ {
+ ancestorStyles.Add(currStyle.BasedOn);
+ currStyle = currStyle.BasedOn;
+ }
+
+ foreach (var styleParent in ancestorStyles)
+ {
+ foreach (var b in styleParent.Setters)
+ {
+ var parentSetter = b as Windows.UI.Xaml.Setter;
+ if (parentSetter == null)
+ continue;
+
+ var derviedSetter = style.Setters
+ .OfType<Windows.UI.Xaml.Setter> ()
+ .FirstOrDefault (x => x.Property == parentSetter.Property);
+
+ //Ignore any ancestor setters which a child setter has already overridden
+ if (derviedSetter != null)
+ continue;
+ else
+ style.Setters.Add (parentSetter);
+ }
+ }
+ return style;
}
- static LineBreakMode ToLineBreakMode(TextWrapping value)
+ static LineBreakMode ToLineBreakMode (TextWrapping value)
{
- switch (value)
- {
+ switch (value) {
case TextWrapping.Wrap:
return LineBreakMode.CharacterWrap;
case TextWrapping.WrapWholeWords:
@@ -63,5 +104,14 @@ namespace Xamarin.Forms.Platform.WinRT
return LineBreakMode.NoWrap;
}
}
+
+ static FontAttributes ToAttributes (ushort uweight)
+ {
+ if (uweight == FontWeights.Bold.Weight || uweight == FontWeights.SemiBold.Weight || uweight == FontWeights.ExtraBold.Weight) {
+ return FontAttributes.Bold;
+ }
+
+ return FontAttributes.None;
+ }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.WinRT.Tablet/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.WinRT.Tablet/TabbedPageRenderer.cs
index 2ac48dda..2cfc2411 100644
--- a/Xamarin.Forms.Platform.WinRT.Tablet/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT.Tablet/TabbedPageRenderer.cs
@@ -144,11 +144,6 @@ namespace Xamarin.Forms.Platform.WinRT
return new SizeRequest(result);
}
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return null;
- }
-
public void Dispose()
{
Dispose(true);
diff --git a/Xamarin.Forms.Platform.WinRT.Tablet/WindowsResourcesProvider.cs b/Xamarin.Forms.Platform.WinRT.Tablet/WindowsResourcesProvider.cs
index c4485679..64041c00 100644
--- a/Xamarin.Forms.Platform.WinRT.Tablet/WindowsResourcesProvider.cs
+++ b/Xamarin.Forms.Platform.WinRT.Tablet/WindowsResourcesProvider.cs
@@ -1,7 +1,7 @@
-using Windows.UI.Text;
+using System;
+using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
-using WStyle = Windows.UI.Xaml.Style;
#if WINDOWS_UWP
@@ -15,47 +15,60 @@ namespace Xamarin.Forms.Platform.WinRT
{
public IResourceDictionary GetSystemResources()
{
- var prototype = new TextBlock();
-
- return new ResourceDictionary
- {
- [Device.Styles.TitleStyleKey] = GetStyle("HeaderTextBlockStyle", prototype),
- [Device.Styles.SubtitleStyleKey] = GetStyle("SubheaderTextBlockStyle", prototype),
- [Device.Styles.BodyStyleKey] = GetStyle("BodyTextBlockStyle", prototype),
- [Device.Styles.CaptionStyleKey] = GetStyle("CaptionTextBlockStyle", prototype),
- [Device.Styles.ListItemDetailTextStyleKey] = GetStyle("BodyTextBlockStyle", prototype),
+ Windows.UI.Xaml.ResourceDictionary windowsResources = Windows.UI.Xaml.Application.Current.Resources;
+ var resources = new ResourceDictionary();
+ resources[Device.Styles.TitleStyleKey] = GetStyle("HeaderTextBlockStyle");
+ resources[Device.Styles.SubtitleStyleKey] = GetStyle("SubheaderTextBlockStyle");
+ resources[Device.Styles.BodyStyleKey] = GetStyle("BodyTextBlockStyle");
+ resources[Device.Styles.CaptionStyleKey] = GetStyle("CaptionTextBlockStyle");
#if WINDOWS_UWP
- [Device.Styles.ListItemTextStyleKey] = GetStyle("BaseTextBlockStyle", prototype),
+ resources[Device.Styles.ListItemTextStyleKey] = GetStyle("BaseTextBlockStyle");
#else
- [Device.Styles.ListItemTextStyleKey] = GetStyle("TitleTextBlockStyle", prototype),
+ resources[Device.Styles.ListItemTextStyleKey] = GetStyle("TitleTextBlockStyle");
#endif
- };
+ resources[Device.Styles.ListItemDetailTextStyleKey] = GetStyle("BodyTextBlockStyle");
+ return resources;
}
- Style GetStyle(object nativeKey, TextBlock prototype)
+ Style GetStyle(object nativeKey)
{
- var style = (WStyle)Windows.UI.Xaml.Application.Current.Resources[nativeKey];
-
- prototype.Style = style;
+ var style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources[nativeKey];
var formsStyle = new Style(typeof(Label));
+ foreach (SetterBase b in style.Setters)
+ {
+ var setter = b as Windows.UI.Xaml.Setter;
+ if (setter == null)
+ continue;
- formsStyle.Setters.Add(Label.FontSizeProperty, prototype.FontSize);
- formsStyle.Setters.Add(Label.FontFamilyProperty, prototype.FontFamily.Source);
- formsStyle.Setters.Add(Label.FontAttributesProperty, ToAttributes(prototype.FontWeight));
- formsStyle.Setters.Add(Label.LineBreakModeProperty, ToLineBreakMode(prototype.TextWrapping));
+ // TODO: Need to implement a stealth pass-through for things we don't support
+
+ try
+ {
+ if (setter.Property == TextBlock.FontSizeProperty)
+ formsStyle.Setters.Add(Label.FontSizeProperty, setter.Value);
+ else if (setter.Property == TextBlock.FontFamilyProperty)
+ formsStyle.Setters.Add(Label.FontFamilyProperty, setter.Value);
+ else if (setter.Property == TextBlock.FontWeightProperty)
+ formsStyle.Setters.Add(Label.FontAttributesProperty, ToAttributes(Convert.ToUInt16(setter.Value)));
+ else if (setter.Property == TextBlock.TextWrappingProperty)
+ formsStyle.Setters.Add(Label.LineBreakModeProperty, ToLineBreakMode((TextWrapping)setter.Value));
+ }
+ catch (NotImplementedException)
+ {
+ // see https://bugzilla.xamarin.com/show_bug.cgi?id=33135
+ // WinRT implementation of Windows.UI.Xaml.Setter.get_Value is not implemented.
+ }
+ }
return formsStyle;
}
- static FontAttributes ToAttributes(FontWeight fontWeight)
+ static FontAttributes ToAttributes(ushort uweight)
{
- if (fontWeight.Weight == FontWeights.Bold.Weight || fontWeight.Weight == FontWeights.SemiBold.Weight
- || fontWeight.Weight == FontWeights.ExtraBold.Weight)
- {
+ if (uweight == FontWeights.Bold.Weight || uweight == FontWeights.SemiBold.Weight || uweight == FontWeights.ExtraBold.Weight)
return FontAttributes.Bold;
- }
return FontAttributes.None;
}
diff --git a/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs b/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs
index acc41db3..aff11963 100644
--- a/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@@ -8,7 +8,6 @@ using Xamarin.Forms.Internals;
using WThickness = Windows.UI.Xaml.Thickness;
using WButton = Windows.UI.Xaml.Controls.Button;
using WImage = Windows.UI.Xaml.Controls.Image;
-using Windows.UI.Xaml.Input;
#if WINDOWS_UWP
@@ -32,7 +31,6 @@ namespace Xamarin.Forms.Platform.WinRT
{
var button = new FormsButton();
button.Click += OnButtonClick;
- button.AddHandler(PointerPressedEvent, new PointerEventHandler(OnPointerPressed), true);
SetNativeControl(button);
}
@@ -101,16 +99,12 @@ namespace Xamarin.Forms.Platform.WinRT
void OnButtonClick(object sender, RoutedEventArgs e)
{
- ((IButtonController)Element)?.SendReleased();
- ((IButtonController)Element)?.SendClicked();
+ Button buttonView = Element;
+ if (buttonView != null)
+ ((IButtonController)buttonView).SendClicked();
}
- void OnPointerPressed(object sender, RoutedEventArgs e)
- {
- ((IButtonController)Element)?.SendPressed();
- }
-
- void UpdateBackground()
+ void UpdateBackground()
{
Control.BackgroundColor = Element.BackgroundColor != Color.Default ? Element.BackgroundColor.ToBrush() : (Brush)Windows.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"];
}
diff --git a/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
index 33e09399..11f4e09d 100644
--- a/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs
@@ -70,11 +70,6 @@ namespace Xamarin.Forms.Platform.WinRT
return new SizeRequest(result);
}
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return null;
- }
-
public void SetElement(VisualElement element)
{
var newPage = element as CarouselPage;
diff --git a/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs b/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs
index 6affa169..f94f3d62 100644
--- a/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs
+++ b/Xamarin.Forms.Platform.WinRT/FrameworkElementExtensions.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
diff --git a/Xamarin.Forms.Platform.WinRT/IVisualElementRenderer.cs b/Xamarin.Forms.Platform.WinRT/IVisualElementRenderer.cs
index abae812e..4db9c1a6 100644
--- a/Xamarin.Forms.Platform.WinRT/IVisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/IVisualElementRenderer.cs
@@ -18,9 +18,6 @@ namespace Xamarin.Forms.Platform.WinRT
event EventHandler<VisualElementChangedEventArgs> ElementChanged;
SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint);
-
void SetElement(VisualElement element);
-
- UIElement GetNativeElement();
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs
index 031e2cf3..db581d52 100644
--- a/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs
@@ -77,6 +77,9 @@ namespace Xamarin.Forms.Platform.WinRT
// and prevented from bubbling up) rather than ListView.ItemClick
List.Tapped += ListOnTapped;
+ // We also want to watch for the Enter key being pressed for selection
+ List.KeyUp += OnKeyPressed;
+
List.SelectionChanged += OnControlSelectionChanged;
List.SetBinding(ItemsControl.ItemsSourceProperty, "");
@@ -138,6 +141,7 @@ namespace Xamarin.Forms.Platform.WinRT
if (List != null)
{
List.Tapped -= ListOnTapped;
+ List.KeyUp -= OnKeyPressed;
List.SelectionChanged -= OnControlSelectionChanged;
@@ -504,6 +508,17 @@ namespace Xamarin.Forms.Platform.WinRT
#endif
}
+ void OnKeyPressed(object sender, KeyRoutedEventArgs e)
+ {
+ if (e.Key == VirtualKey.Enter)
+ {
+ if (Element.SelectedItem != null && Element.SelectedItem != List.SelectedItem)
+ {
+ ((IElementController)Element).SetValueFromRenderer(ListView.SelectedItemProperty, List.SelectedItem);
+ }
+ }
+ }
+
void OnControlSelectionChanged(object sender, SelectionChangedEventArgs e)
{
RestorePreviousSelectedVisual();
@@ -525,10 +540,6 @@ namespace Xamarin.Forms.Platform.WinRT
}
}
#endif
-
- // A11y: Tapped event will not be routed when Narrator is active
- // Also handles keyboard selection
- SelectElementItem();
}
FrameworkElement FindElement(object cell)
@@ -542,15 +553,6 @@ namespace Xamarin.Forms.Platform.WinRT
return null;
}
- void SelectElementItem()
- {
- if (List.SelectedItem != null && Element.SelectedItem != List.SelectedItem)
- {
- ((IElementController)Element).SetValueFromRenderer(ListView.SelectedItemProperty, List?.SelectedItem);
- OnElementItemSelected(null, new SelectedItemChangedEventArgs(Element?.SelectedItem));
- }
- }
-
#if WINDOWS_UWP
void RestorePreviousSelectedVisual()
{
diff --git a/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs
index dcef680e..414870cd 100644
--- a/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/MasterDetailPageRenderer.cs
@@ -94,11 +94,6 @@ namespace Xamarin.Forms.Platform.WinRT
public event EventHandler<VisualElementChangedEventArgs> ElementChanged;
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return null;
- }
-
public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
{
return new SizeRequest(new Size(Device.Info.ScaledScreenSize.Width, Device.Info.ScaledScreenSize.Height));
diff --git a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
index 5229fdcb..d6f45420 100644
--- a/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
@@ -13,23 +13,35 @@ using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using Xamarin.Forms.Internals;
+using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
#if WINDOWS_UWP
+using Windows.UI.Xaml.Data;
using Windows.UI.Core;
+
+#endif
+
+#if WINDOWS_UWP
+
namespace Xamarin.Forms.Platform.UWP
#else
namespace Xamarin.Forms.Platform.WinRT
#endif
{
- public partial class NavigationPageRenderer : IVisualElementRenderer, ITitleProvider, IToolbarProvider
+ public class NavigationPageRenderer : IVisualElementRenderer, ITitleProvider, IToolbarProvider
+#if WINDOWS_UWP
+ , IToolBarForegroundBinder
+#endif
{
PageControl _container;
Page _currentPage;
Page _previousPage;
bool _disposed;
-
+#if WINDOWS_UWP
+ SystemNavigationManager _navManager;
+#endif
MasterDetailPage _parentMasterDetailPage;
TabbedPage _parentTabbedPage;
bool _showTitle = true;
@@ -137,15 +149,10 @@ namespace Xamarin.Forms.Platform.WinRT
return new SizeRequest(result);
}
- UIElement IVisualElementRenderer.GetNativeElement()
- {
- return null;
- }
-
public void SetElement(VisualElement element)
{
if (element != null && !(element is NavigationPage))
- throw new ArgumentException("Element must be a Page", nameof(element));
+ throw new ArgumentException("Element must be a Page", "element");
NavigationPage oldElement = Element;
Element = (NavigationPage)element;
@@ -206,11 +213,8 @@ namespace Xamarin.Forms.Platform.WinRT
protected void Dispose(bool disposing)
{
- if (_disposed || !disposing)
- {
+ if (!disposing || _disposed)
return;
- }
-
PageController?.SendDisappearing();
_disposed = true;
@@ -245,8 +249,11 @@ namespace Xamarin.Forms.Platform.WinRT
Brush GetBarBackgroundBrush()
{
- object defaultColor = GetDefaultColor();
-
+#if WINDOWS_UWP
+ object defaultColor = Windows.UI.Xaml.Application.Current.Resources["SystemControlBackgroundChromeMediumLowBrush"];
+#else
+ object defaultColor = Windows.UI.Xaml.Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
+#endif
if (Element.BarBackgroundColor.IsDefault && defaultColor != null)
return (Brush)defaultColor;
return Element.BarBackgroundColor.ToBrush();
@@ -260,11 +267,28 @@ namespace Xamarin.Forms.Platform.WinRT
return Element.BarTextColor.ToBrush();
}
+ // TODO EZH Why don't this and GetToolBarProvider ever get called on either platform?
+ Task<CommandBar> GetCommandBarAsync()
+ {
+ var platform = (Platform)Element.Platform;
+ IToolbarProvider toolbarProvider = platform.GetToolbarProvider();
+ if (toolbarProvider == null)
+ return Task.FromResult<CommandBar>(null);
+
+ return toolbarProvider.GetCommandBarAsync();
+ }
+
bool GetIsNavBarPossible()
{
return _showTitle;
}
+ IToolbarProvider GetToolbarProvider()
+ {
+ var platform = (Platform)Element.Platform;
+ return platform.GetToolbarProvider();
+ }
+
void LookupRelevantParents()
{
IEnumerable<Page> parentPages = Element.GetParentPages();
@@ -284,9 +308,16 @@ namespace Xamarin.Forms.Platform.WinRT
_parentTabbedPage.PropertyChanged += MultiPagePropertyChanged;
if (_parentMasterDetailPage != null)
_parentMasterDetailPage.PropertyChanged += MultiPagePropertyChanged;
+#if WINDOWS_UWP
+ ((ITitleProvider)this).ShowTitle = _parentTabbedPage == null && _parentMasterDetailPage == null;
- UpdateShowTitle();
-
+
+#else
+ if (Device.Idiom == TargetIdiom.Phone && _parentTabbedPage != null)
+ ((ITitleProvider)this).ShowTitle = false;
+ else
+ ((ITitleProvider)this).ShowTitle = true;
+#endif
UpdateTitleOnParents();
}
@@ -324,10 +355,8 @@ namespace Xamarin.Forms.Platform.WinRT
UpdateNavigationBarBackground();
else if (e.PropertyName == Page.PaddingProperty.PropertyName)
UpdatePadding();
-#if WINDOWS_UWP
- else if (e.PropertyName == PlatformConfiguration.WindowsSpecific.Page.ToolbarPlacementProperty.PropertyName)
+ else if (e.PropertyName == PlatformConfiguration.WindowsSpecific.Page.ToolbarPlacementProperty.PropertyName)
UpdateToolbarPlacement();
-#endif
}
void OnLoaded(object sender, RoutedEventArgs args)
@@ -369,7 +398,7 @@ namespace Xamarin.Forms.Platform.WinRT
void OnPopRequested(object sender, NavigationRequestedEventArgs e)
{
- var newCurrent = ((INavigationPageController)Element).Peek(1);
+ var newCurrent = (Page)PageController.InternalChildren[PageController.InternalChildren.Count - 2];
SetPage(newCurrent, e.Animated, true);
}
@@ -390,10 +419,8 @@ namespace Xamarin.Forms.Platform.WinRT
void PushExistingNavigationStack()
{
- foreach (var page in ((INavigationPageController)Element).Pages)
- {
- SetPage(page, false, false);
- }
+ for (int i = ((INavigationPageController)Element).StackCopy.Count - 1; i >= 0; i--)
+ SetPage(((INavigationPageController)Element).StackCopy.ElementAt(i), false, false);
}
void SetPage(Page page, bool isAnimated, bool isPopping)
@@ -441,6 +468,19 @@ namespace Xamarin.Forms.Platform.WinRT
_container.DataContext = page;
}
+ void UpdateBackButton()
+ {
+ bool showBackButton = PageController.InternalChildren.Count > 1 && NavigationPage.GetHasBackButton(_currentPage);
+ _container.ShowBackButton = showBackButton;
+
+#if WINDOWS_UWP
+ if (_navManager != null)
+ {
+ _navManager.AppViewBackButtonVisibility = showBackButton ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
+ }
+#endif
+ }
+
void UpdateBackButtonTitle()
{
string title = null;
@@ -485,5 +525,74 @@ namespace Xamarin.Forms.Platform.WinRT
{
(this as ITitleProvider).BarForegroundBrush = GetBarForegroundBrush();
}
+
+ void UpdateToolbarPlacement()
+ {
+#if WINDOWS_UWP
+ if (_container == null)
+ {
+ return;
+ }
+
+ _container.ToolbarPlacement = Element.OnThisPlatform().GetToolbarPlacement();
+#endif
+ }
+
+#pragma warning disable 1998 // considered for removal
+ async void UpdateTitleOnParents()
+#pragma warning restore 1998
+ {
+ if (Element == null)
+ return;
+
+ ITitleProvider render = null;
+ if (_parentTabbedPage != null)
+ {
+ render = Platform.GetRenderer(_parentTabbedPage) as ITitleProvider;
+ if (render != null)
+ render.ShowTitle = (_parentTabbedPage.CurrentPage == Element) && NavigationPage.GetHasNavigationBar(_currentPage);
+ }
+
+ if (_parentMasterDetailPage != null)
+ {
+ render = Platform.GetRenderer(_parentMasterDetailPage) as ITitleProvider;
+ if (render != null)
+ render.ShowTitle = (_parentMasterDetailPage.Detail == Element) && NavigationPage.GetHasNavigationBar(_currentPage);
+ }
+
+ if (render != null && render.ShowTitle)
+ {
+ render.Title = _currentPage.Title;
+ render.BarBackgroundBrush = GetBarBackgroundBrush();
+ render.BarForegroundBrush = GetBarForegroundBrush();
+#if WINDOWS_UWP
+ await (Element.Platform as Platform).UpdateToolbarItems();
+#endif
+ }
+ else if (_showTitle)
+ {
+#if WINDOWS_UWP
+ await (Element.Platform as Platform).UpdateToolbarItems();
+#endif
+ }
+ }
+
+#if WINDOWS_UWP
+ public void BindForegroundColor(AppBar appBar)
+ {
+ SetAppBarForegroundBinding(appBar);
+ }
+
+ public void BindForegroundColor(AppBarButton button)
+ {
+ SetAppBarForegroundBinding(button);
+ }
+
+ void SetAppBarForegroundBinding(FrameworkElement element)
+ {
+ element.SetBinding(Control.ForegroundProperty,
+ new Windows.UI.Xaml.Data.Binding { Path = new PropertyPath("TitleBrush"), Source = _container, RelativeSource = new RelativeSource { Mode = RelativeSourceMode.TemplatedParent } });
+ }
+#endif
}
-}
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.WinRT/NavigationPageRendererWinRT.cs b/Xamarin.Forms.Platform.WinRT/NavigationPageRendererWinRT.cs
deleted file mode 100644
index 1539d3aa..00000000
--- a/Xamarin.Forms.Platform.WinRT/NavigationPageRendererWinRT.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-namespace Xamarin.Forms.Platform.WinRT
-{
- public partial class NavigationPageRenderer
- {
- void UpdateShowTitle()
- {
- if (Device.Idiom == TargetIdiom.Phone && _parentTabbedPage != null)
- ((ITitleProvider)this).ShowTitle = false;
- else
- ((ITitleProvider)this).ShowTitle = true;
- }
-
- static object GetDefaultColor()
- {
- return Windows.UI.Xaml.Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
- }
-
- void UpdateBackButton()
- {
- bool showBackButton = PageController.InternalChildren.Count > 1 && NavigationPage.GetHasBackButton(_currentPage);
- _container.ShowBackButton = showBackButton;
- }
-
- void UpdateToolbarPlacement()
- {
- // Currently we don't support toolbar (CommandBar) placement on Windows 8.1
- }
-
- void UpdateTitleOnParents()
- {
- if (Element == null)
- return;
-
- ITitleProvider render = null;
- if (_parentTabbedPage != null)
- {
- render = Platform.GetRenderer(_parentTabbedPage) as ITitleProvider;
- if (render != null)
- render.ShowTitle = (_parentTabbedPage.CurrentPage == Element) && NavigationPage.GetHasNavigationBar(_currentPage);
- }
-
- if (_parentMasterDetailPage != null)
- {
- render = Platform.GetRenderer(_parentMasterDetailPage) as ITitleProvider;
- if (render != null)
- render.ShowTitle = (_parentMasterDetailPage.Detail == Element) && NavigationPage.GetHasNavigationBar(_currentPage);
- }
-
- if (render != null && render.ShowTitle)
- {
- render.Title = _currentPage.Title;
- render.BarBackgroundBrush = GetBarBackgroundBrush();
- render.BarForegroundBrush = GetBarForegroundBrush();
- }
- }
- }
-}
diff --git a/Xamarin.Forms.Platform.WinRT/Platform.cs b/Xamarin.Forms.Platform.WinRT/Platform.cs
index ec356e9a..2e30ac10 100644
--- a/Xamarin.Forms.Platform.WinRT/Platform.cs
+++ b/Xamarin.Forms.Platform.WinRT/Platform.cs
@@ -2,22 +2,39 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+
+using Windows.ApplicationModel.Core;
+using Windows.UI;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Media.Animation;
using Xamarin.Forms.Internals;
#if WINDOWS_UWP
+using Windows.Foundation;
+using Windows.Foundation.Metadata;
+using Windows.UI.Core;
+using Windows.UI.ViewManagement;
+#endif
+
+#if WINDOWS_UWP
+
namespace Xamarin.Forms.Platform.UWP
#else
+
namespace Xamarin.Forms.Platform.WinRT
#endif
{
- public abstract partial class Platform : IPlatform, INavigation, IToolbarProvider
+ public abstract class Platform : IPlatform, INavigation, IToolbarProvider
{
- internal static readonly BindableProperty RendererProperty = BindableProperty.CreateAttached("Renderer",
- typeof(IVisualElementRenderer), typeof(Platform), default(IVisualElementRenderer));
+ internal static readonly BindableProperty RendererProperty = BindableProperty.CreateAttached("Renderer", typeof(IVisualElementRenderer), typeof(Platform), default(IVisualElementRenderer));
+
+#if WINDOWS_UWP
+ internal static StatusBar MobileStatusBar => ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar") ? StatusBar.GetForCurrentView() : null;
+#endif
public static IVisualElementRenderer GetRenderer(VisualElement element)
{
@@ -33,10 +50,9 @@ namespace Xamarin.Forms.Platform.WinRT
public static IVisualElementRenderer CreateRenderer(VisualElement element)
{
if (element == null)
- throw new ArgumentNullException(nameof(element));
+ throw new ArgumentNullException("element");
- IVisualElementRenderer renderer = Registrar.Registered.GetHandler<IVisualElementRenderer>(element.GetType()) ??
- new DefaultRenderer();
+ IVisualElementRenderer renderer = Registrar.Registered.GetHandler<IVisualElementRenderer>(element.GetType()) ?? new DefaultRenderer();
renderer.SetElement(element);
return renderer;
}
@@ -44,14 +60,11 @@ namespace Xamarin.Forms.Platform.WinRT
internal Platform(Windows.UI.Xaml.Controls.Page page)
{
if (page == null)
- throw new ArgumentNullException(nameof(page));
+ throw new ArgumentNullException("page");
_page = page;
- _container = new Canvas
- {
- Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["RootContainerStyle"]
- };
+ _container = new Canvas { Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["RootContainerStyle"] };
_page.Content = _container;
@@ -71,19 +84,38 @@ namespace Xamarin.Forms.Platform.WinRT
UpdateBounds();
#if WINDOWS_UWP
- InitializeStatusBar();
+ StatusBar statusBar = MobileStatusBar;
+ if (statusBar != null)
+ {
+ statusBar.Showing += (sender, args) => UpdateBounds();
+ statusBar.Hiding += (sender, args) => UpdateBounds();
+
+ // UWP 14393 Bug: If RequestedTheme is Light (which it is by default), then the
+ // status bar uses White Foreground with White Background.
+ // UWP 10586 Bug: If RequestedTheme is Light (which it is by default), then the
+ // status bar uses Black Foreground with Black Background.
+ // Since the Light theme should have a Black on White status bar, we will set it explicitly.
+ // This can be overriden by setting the status bar colors in App.xaml.cs OnLaunched.
+
+ if (statusBar.BackgroundColor == null && statusBar.ForegroundColor == null && Windows.UI.Xaml.Application.Current.RequestedTheme == ApplicationTheme.Light)
+ {
+ statusBar.BackgroundColor = Colors.White;
+ statusBar.ForegroundColor = Colors.Black;
+ statusBar.BackgroundOpacity = 1;
+ }
+ }
#endif
}
internal void SetPage(Page newRoot)
{
if (newRoot == null)
- throw new ArgumentNullException(nameof(newRoot));
+ throw new ArgumentNullException("newRoot");
_navModel.Clear();
_navModel.Push(newRoot, null);
- SetCurrent(newRoot, true);
+ SetCurrent(newRoot, false, true);
Application.Current.NavigationProxy.Inner = this;
}
@@ -124,8 +156,7 @@ namespace Xamarin.Forms.Platform.WinRT
Task INavigation.PopToRootAsync(bool animated)
{
- throw new InvalidOperationException(
- "PopToRootAsync is not supported globally on Windows, please use a NavigationPage.");
+ throw new InvalidOperationException("PopToRootAsync is not supported globally on Windows, please use a NavigationPage.");
}
void INavigation.RemovePage(Page page)
@@ -135,8 +166,7 @@ namespace Xamarin.Forms.Platform.WinRT
void INavigation.InsertPageBefore(Page page, Page before)
{
- throw new InvalidOperationException(
- "InsertPageBefore is not supported globally on Windows, please use a NavigationPage.");
+ throw new InvalidOperationException("InsertPageBefore is not supported globally on Windows, please use a NavigationPage.");
}
Task INavigation.PushModalAsync(Page page)
@@ -152,11 +182,11 @@ namespace Xamarin.Forms.Platform.WinRT
Task INavigation.PushModalAsync(Page page, bool animated)
{
if (page == null)
- throw new ArgumentNullException(nameof(page));
+ throw new ArgumentNullException("page");
var tcs = new TaskCompletionSource<bool>();
_navModel.PushModal(page);
- SetCurrent(page, completedCallback: () => tcs.SetResult(true));
+ SetCurrent(page, animated, completedCallback: () => tcs.SetResult(true));
return tcs.Task;
}
@@ -164,7 +194,7 @@ namespace Xamarin.Forms.Platform.WinRT
{
var tcs = new TaskCompletionSource<Page>();
Page result = _navModel.PopModal();
- SetCurrent(_navModel.CurrentPage, true, () => tcs.SetResult(result));
+ SetCurrent(_navModel.CurrentPage, animated, true, () => tcs.SetResult(result));
return tcs.Task;
}
@@ -205,6 +235,128 @@ namespace Xamarin.Forms.Platform.WinRT
}
}
+ internal IToolbarProvider GetToolbarProvider()
+ {
+ IToolbarProvider provider = null;
+
+ Page element = _currentPage;
+ while (element != null)
+ {
+ provider = GetRenderer(element) as IToolbarProvider;
+ if (provider != null)
+ break;
+
+ var pageContainer = element as IPageContainer<Page>;
+ element = pageContainer?.CurrentPage;
+ }
+
+ if (provider != null && _toolbarProvider == null)
+ ClearCommandBar();
+
+ return provider;
+ }
+
+ internal async Task UpdateToolbarItems()
+ {
+ CommandBar commandBar = await GetCommandBarAsync();
+ if (commandBar != null)
+ {
+ commandBar.PrimaryCommands.Clear();
+ commandBar.SecondaryCommands.Clear();
+#if WINDOWS_UWP
+ if (_page.BottomAppBar != null || _page.TopAppBar != null)
+ {
+ _page.BottomAppBar = null;
+ _page.TopAppBar = null;
+ _page.InvalidateMeasure();
+ }
+#endif
+ }
+
+#if !WINDOWS_UWP
+ commandBar = AddOpenMasterButton(commandBar);
+#endif
+
+#if WINDOWS_UWP
+ var toolBarProvider = GetToolbarProvider() as IToolBarForegroundBinder;
+#endif
+
+ foreach (ToolbarItem item in _toolbarTracker.ToolbarItems.OrderBy(ti => ti.Priority))
+ {
+ if (commandBar == null)
+ commandBar = CreateCommandBar();
+
+#if WINDOWS_UWP
+ toolBarProvider?.BindForegroundColor(commandBar);
+#endif
+
+ var button = new AppBarButton();
+ button.SetBinding(AppBarButton.LabelProperty, "Text");
+ button.SetBinding(AppBarButton.IconProperty, "Icon", _fileImageSourcePathConverter);
+ button.Command = new MenuItemCommand(item);
+ button.DataContext = item;
+
+
+ ToolbarItemOrder order = item.Order == ToolbarItemOrder.Default ? ToolbarItemOrder.Primary : item.Order;
+
+ if (order == ToolbarItemOrder.Primary)
+ {
+#if WINDOWS_UWP
+ toolBarProvider?.BindForegroundColor(button);
+#endif
+ commandBar.PrimaryCommands.Add(button);
+ }
+ else
+ commandBar.SecondaryCommands.Add(button);
+ }
+
+ if (commandBar?.PrimaryCommands.Count + commandBar?.SecondaryCommands.Count == 0)
+ ClearCommandBar();
+ }
+
+#if !WINDOWS_UWP
+ CommandBar AddOpenMasterButton(CommandBar commandBar)
+ {
+ if (!_toolbarTracker.HaveMasterDetail)
+ {
+ return commandBar;
+ }
+
+ if (commandBar == null)
+ {
+ commandBar = CreateCommandBar();
+ }
+
+ Page target = _toolbarTracker.Target;
+ var mdp = target as MasterDetailPage;
+ while (mdp == null)
+ {
+ var container = target as IPageContainer<Page>;
+ if (container == null)
+ {
+ break;
+ }
+
+ target = container.CurrentPage;
+ mdp = container.CurrentPage as MasterDetailPage;
+ }
+
+ if (mdp == null || !mdp.ShouldShowToolbarButton())
+ {
+ return commandBar;
+ }
+
+ var openMaster = new AppBarButton { DataContext = mdp };
+ openMaster.SetBinding(AppBarButton.LabelProperty, "Master.Title");
+ openMaster.SetBinding(AppBarButton.IconProperty, "Master.Icon", _fileImageSourcePathConverter);
+ openMaster.Click += (s, a) => { mdp.IsPresented = !mdp.IsPresented; };
+
+ commandBar.PrimaryCommands.Add(openMaster);
+
+ return commandBar;
+ }
+#endif
+
Rectangle _bounds;
readonly Canvas _container;
readonly Windows.UI.Xaml.Controls.Page _page;
@@ -214,17 +366,32 @@ namespace Xamarin.Forms.Platform.WinRT
readonly ToolbarTracker _toolbarTracker = new ToolbarTracker();
readonly FileImageSourcePathConverter _fileImageSourcePathConverter = new FileImageSourcePathConverter();
+#pragma warning disable 649
+ IToolbarProvider _toolbarProvider;
+#pragma warning restore 649
+
+ class ToolbarProvider : IToolbarProvider
+ {
+ readonly Task<CommandBar> _commandBar;
+
+ public ToolbarProvider(CommandBar commandBar)
+ {
+ _commandBar = Task.FromResult(commandBar);
+ }
+
+ public CommandBar CommandBar => _commandBar.Result;
+
+ public Task<CommandBar> GetCommandBarAsync()
+ {
+ return _commandBar;
+ }
+ }
Windows.UI.Xaml.Controls.ProgressBar GetBusyIndicator()
{
if (_busyIndicator == null)
{
- _busyIndicator = new Windows.UI.Xaml.Controls.ProgressBar
- {
- IsIndeterminate = true,
- Visibility = Visibility.Collapsed,
- VerticalAlignment = VerticalAlignment.Top
- };
+ _busyIndicator = new Windows.UI.Xaml.Controls.ProgressBar { IsIndeterminate = true, Visibility = Visibility.Collapsed, VerticalAlignment = VerticalAlignment.Top };
Canvas.SetZIndex(_busyIndicator, 1);
_container.Children.Add(_busyIndicator);
@@ -250,7 +417,7 @@ namespace Xamarin.Forms.Platform.WinRT
Page removed = _navModel.PopModal();
if (removed != null)
{
- SetCurrent(_navModel.CurrentPage, true);
+ SetCurrent(_navModel.CurrentPage, true, true);
handled = true;
}
}
@@ -269,13 +436,18 @@ namespace Xamarin.Forms.Platform.WinRT
_currentActionSheet = null;
}
+ void UpdateBounds()
+ {
+ _bounds = new Rectangle(0, 0, _container.ActualWidth, _container.ActualHeight);
+ }
+
void OnRendererSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
{
UpdateBounds();
UpdatePageSizes();
}
- async void SetCurrent(Page newPage, bool popping = false, Action completedCallback = null)
+ async void SetCurrent(Page newPage, bool animated, bool popping = false, Action completedCallback = null)
{
if (newPage == _currentPage)
return;
@@ -300,22 +472,84 @@ namespace Xamarin.Forms.Platform.WinRT
pageRenderer.ContainerElement.Width = _container.ActualWidth;
pageRenderer.ContainerElement.Height = _container.ActualHeight;
- completedCallback?.Invoke();
+ if (completedCallback != null)
+ completedCallback();
_currentPage = newPage;
UpdateToolbarTracker();
-#if WINDOWS_UWP
UpdateToolbarTitle(newPage);
-#endif
await UpdateToolbarItems();
}
+ void UpdateToolbarTitle(Page page)
+ {
+ if (_toolbarProvider == null)
+ return;
+
+ ((ToolbarProvider)_toolbarProvider).CommandBar.Content = page.Title;
+ }
+
Task<CommandBar> IToolbarProvider.GetCommandBarAsync()
{
return GetCommandBarAsync();
}
+#pragma warning disable 1998 // considered for removal
+ async Task<CommandBar> GetCommandBarAsync()
+#pragma warning restore 1998
+ {
+#if !WINDOWS_UWP
+ return _page.BottomAppBar as CommandBar;
+#else
+ IToolbarProvider provider = GetToolbarProvider();
+ //var titleProvider = provider as ITitleProvider;
+ if (provider == null) // || (titleProvider != null && !titleProvider.ShowTitle))
+ return null;
+
+ return await provider.GetCommandBarAsync();
+#endif
+ }
+
+ CommandBar CreateCommandBar()
+ {
+#if !WINDOWS_UWP
+ var commandBar = new CommandBar();
+ _page.BottomAppBar = commandBar;
+ return commandBar;
+#else
+
+ var bar = new FormsCommandBar();
+ if (Device.Idiom != TargetIdiom.Phone)
+ bar.Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["TitleToolbar"];
+
+ _toolbarProvider = new ToolbarProvider(bar);
+
+ if (Device.Idiom == TargetIdiom.Phone)
+ _page.BottomAppBar = bar;
+ else
+ _page.TopAppBar = bar;
+
+ return bar;
+#endif
+ }
+
+ void ClearCommandBar()
+ {
+#if !WINDOWS_UWP
+ _page.BottomAppBar = null;
+#else
+ if (_toolbarProvider != null)
+ {
+ _toolbarProvider = null;
+ if (Device.Idiom == TargetIdiom.Phone)
+ _page.BottomAppBar = null;
+ else
+ _page.TopAppBar = null;
+ }
+#endif
+ }
+
async void OnToolbarItemsChanged(object sender, EventArgs e)
{
await UpdateToolbarItems();
@@ -331,6 +565,163 @@ namespace Xamarin.Forms.Platform.WinRT
ActionSheetArguments _actionSheetOptions;
Popup _currentActionSheet;
+#if WINDOWS_UWP
+ async void OnPageActionSheet(Page sender, ActionSheetArguments options)
+ {
+ List<string> buttons = options.Buttons.ToList();
+
+ var list = new Windows.UI.Xaml.Controls.ListView
+ {
+ Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
+ ItemsSource = buttons,
+ IsItemClickEnabled = true
+ };
+
+ var dialog = new ContentDialog
+ {
+ Template = (Windows.UI.Xaml.Controls.ControlTemplate)Windows.UI.Xaml.Application.Current.Resources["MyContentDialogControlTemplate"],
+ Content = list,
+ Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetStyle"]
+ };
+
+ if (options.Title != null)
+ dialog.Title = options.Title;
+
+ list.ItemClick += (s, e) =>
+ {
+ dialog.Hide();
+ options.SetResult((string)e.ClickedItem);
+ };
+
+ TypedEventHandler<CoreWindow, CharacterReceivedEventArgs> onEscapeButtonPressed = delegate(CoreWindow window, CharacterReceivedEventArgs args)
+ {
+ if (args.KeyCode == 27)
+ {
+ dialog.Hide();
+ options.SetResult(ContentDialogResult.None.ToString());
+ }
+ };
+
+ Window.Current.CoreWindow.CharacterReceived += onEscapeButtonPressed;
+
+ _actionSheetOptions = options;
+
+ if (options.Cancel != null)
+ dialog.SecondaryButtonText = options.Cancel;
+
+ if (options.Destruction != null)
+ dialog.PrimaryButtonText = options.Destruction;
+
+ ContentDialogResult result = await dialog.ShowAsync();
+ if (result == ContentDialogResult.Secondary)
+ options.SetResult(options.Cancel);
+ else if (result == ContentDialogResult.Primary)
+ options.SetResult(options.Destruction);
+
+ Window.Current.CoreWindow.CharacterReceived -= onEscapeButtonPressed;
+ }
+#else
+ void OnPageActionSheet(Page sender, ActionSheetArguments options)
+ {
+ var finalArguments = new List<string>();
+ if (options.Destruction != null)
+ finalArguments.Add(options.Destruction);
+ if (options.Buttons != null)
+ finalArguments.AddRange(options.Buttons);
+ if (options.Cancel != null)
+ finalArguments.Add(options.Cancel);
+
+ var list = new Windows.UI.Xaml.Controls.ListView
+ {
+ Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
+ ItemsSource = finalArguments,
+ IsItemClickEnabled = true
+ };
+
+ list.ItemClick += (s, e) =>
+ {
+ _currentActionSheet.IsOpen = false;
+ options.SetResult((string)e.ClickedItem);
+ };
+
+ _actionSheetOptions = options;
+
+ Size size = Device.Info.ScaledScreenSize;
+
+ var stack = new StackPanel
+ {
+ MinWidth = 100,
+ Children =
+ {
+ new TextBlock
+ {
+ Text = options.Title ?? string.Empty,
+ Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["TitleTextBlockStyle"],
+ Margin = new Windows.UI.Xaml.Thickness(0, 0, 0, 10),
+ Visibility = options.Title != null ? Visibility.Visible : Visibility.Collapsed
+ },
+ list
+ }
+ };
+
+ var border = new Border
+ {
+ Child = stack,
+ BorderBrush = new SolidColorBrush(Colors.White),
+ BorderThickness = new Windows.UI.Xaml.Thickness(1),
+ Padding = new Windows.UI.Xaml.Thickness(15),
+ Background = (Brush)Windows.UI.Xaml.Application.Current.Resources["AppBarBackgroundThemeBrush"]
+ };
+
+ Windows.UI.Xaml.Controls.Grid.SetRow(border, 1);
+ Windows.UI.Xaml.Controls.Grid.SetColumn(border, 1);
+
+ var container = new Windows.UI.Xaml.Controls.Grid
+ {
+ RowDefinitions =
+ {
+ new Windows.UI.Xaml.Controls.RowDefinition { Height = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) },
+ new Windows.UI.Xaml.Controls.RowDefinition { Height = new Windows.UI.Xaml.GridLength(0, Windows.UI.Xaml.GridUnitType.Auto) },
+ new Windows.UI.Xaml.Controls.RowDefinition { Height = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) }
+ },
+ ColumnDefinitions =
+ {
+ new Windows.UI.Xaml.Controls.ColumnDefinition { Width = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) },
+ new Windows.UI.Xaml.Controls.ColumnDefinition { Width = new Windows.UI.Xaml.GridLength(0, Windows.UI.Xaml.GridUnitType.Auto) },
+ new Windows.UI.Xaml.Controls.ColumnDefinition { Width = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) }
+ },
+ Height = size.Height,
+ Width = size.Width,
+ Children = { border }
+ };
+
+ var bgPopup = new Popup { Child = new Canvas { Width = size.Width, Height = size.Height, Background = new SolidColorBrush(new Windows.UI.Color { A = 128, R = 0, G = 0, B = 0 }) } };
+
+ bgPopup.IsOpen = true;
+
+ _currentActionSheet = new Popup { ChildTransitions = new TransitionCollection { new PopupThemeTransition() }, IsLightDismissEnabled = true, Child = container };
+
+ _currentActionSheet.Closed += (s, e) =>
+ {
+ bgPopup.IsOpen = false;
+ CancelActionSheet();
+ };
+
+ if (Device.Idiom == TargetIdiom.Phone)
+ {
+ double height = _page.ActualHeight;
+ stack.Height = height;
+ stack.Width = size.Width;
+ border.BorderThickness = new Windows.UI.Xaml.Thickness(0);
+
+ _currentActionSheet.Height = height;
+ _currentActionSheet.VerticalOffset = size.Height - height;
+ }
+
+ _currentActionSheet.IsOpen = true;
+ }
+#endif
+
async void OnPageAlert(Page sender, AlertArguments options)
{
string content = options.Message ?? options.Title ?? string.Empty;
@@ -368,7 +759,7 @@ namespace Xamarin.Forms.Platform.WinRT
}
}
}
-
+
// refer to http://stackoverflow.com/questions/29209954/multiple-messagedialog-app-crash for why this is used
// in order to allow for multiple MessageDialogs, or a crash occurs otherwise
public static class MessageDialogExtensions
@@ -382,8 +773,8 @@ namespace Xamarin.Forms.Platform.WinRT
await _currentDialogShowRequest.Task;
}
- TaskCompletionSource<MessageDialog> request = _currentDialogShowRequest = new TaskCompletionSource<MessageDialog>();
- IUICommand result = await dialog.ShowAsync();
+ var request = _currentDialogShowRequest = new TaskCompletionSource<MessageDialog>();
+ var result = await dialog.ShowAsync();
_currentDialogShowRequest = null;
request.SetResult(dialog);
diff --git a/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs b/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs
deleted file mode 100644
index 5e11c8d8..00000000
--- a/Xamarin.Forms.Platform.WinRT/PlatformWinRT.cs
+++ /dev/null
@@ -1,211 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Windows.UI;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Media.Animation;
-
-namespace Xamarin.Forms.Platform.WinRT
-{
- public abstract partial class Platform
- {
- CommandBar AddOpenMasterButton(CommandBar commandBar)
- {
- if (!_toolbarTracker.HaveMasterDetail)
- {
- return commandBar;
- }
-
- if (commandBar == null)
- {
- commandBar = CreateCommandBar();
- }
-
- Page target = _toolbarTracker.Target;
- var mdp = target as MasterDetailPage;
- while (mdp == null)
- {
- var container = target as IPageContainer<Page>;
- if (container == null)
- {
- break;
- }
-
- target = container.CurrentPage;
- mdp = container.CurrentPage as MasterDetailPage;
- }
-
- if (mdp == null || !mdp.ShouldShowToolbarButton())
- {
- return commandBar;
- }
-
- var openMaster = new AppBarButton { DataContext = mdp };
- openMaster.SetBinding(AppBarButton.LabelProperty, "Master.Title");
- openMaster.SetBinding(AppBarButton.IconProperty, "Master.Icon", _fileImageSourcePathConverter);
- openMaster.Click += (s, a) => { mdp.IsPresented = !mdp.IsPresented; };
-
- commandBar.PrimaryCommands.Add(openMaster);
-
- return commandBar;
- }
-
- CommandBar CreateCommandBar()
- {
- var commandBar = new CommandBar();
- _page.BottomAppBar = commandBar;
- return commandBar;
- }
-
- void UpdateBounds()
- {
- _bounds = new Rectangle(0, 0, _page.ActualWidth, _page.ActualHeight);
- }
-
- Task<CommandBar> GetCommandBarAsync()
- {
- return Task.FromResult(_page.BottomAppBar as CommandBar);
- }
-
- void ClearCommandBar()
- {
- _page.BottomAppBar = null;
- }
-
- void OnPageActionSheet(Page sender, ActionSheetArguments options)
- {
- var finalArguments = new List<string>();
- if (options.Destruction != null)
- finalArguments.Add(options.Destruction);
- if (options.Buttons != null)
- finalArguments.AddRange(options.Buttons);
- if (options.Cancel != null)
- finalArguments.Add(options.Cancel);
-
- var list = new Windows.UI.Xaml.Controls.ListView
- {
- Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["ActionSheetList"],
- ItemsSource = finalArguments,
- IsItemClickEnabled = true
- };
-
- list.ItemClick += (s, e) =>
- {
- _currentActionSheet.IsOpen = false;
- options.SetResult((string)e.ClickedItem);
- };
-
- _actionSheetOptions = options;
-
- Size size = Device.Info.ScaledScreenSize;
-
- var stack = new StackPanel
- {
- MinWidth = 100,
- Children =
- {
- new TextBlock
- {
- Text = options.Title ?? string.Empty,
- Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["TitleTextBlockStyle"],
- Margin = new Windows.UI.Xaml.Thickness(0, 0, 0, 10),
- Visibility = options.Title != null ? Visibility.Visible : Visibility.Collapsed
- },
- list
- }
- };
-
- var border = new Border
- {
- Child = stack,
- BorderBrush = new SolidColorBrush(Colors.White),
- BorderThickness = new Windows.UI.Xaml.Thickness(1),
- Padding = new Windows.UI.Xaml.Thickness(15),
- Background = (Brush)Windows.UI.Xaml.Application.Current.Resources["AppBarBackgroundThemeBrush"]
- };
-
- Windows.UI.Xaml.Controls.Grid.SetRow(border, 1);
- Windows.UI.Xaml.Controls.Grid.SetColumn(border, 1);
-
- var container = new Windows.UI.Xaml.Controls.Grid
- {
- RowDefinitions =
- {
- new Windows.UI.Xaml.Controls.RowDefinition { Height = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) },
- new Windows.UI.Xaml.Controls.RowDefinition { Height = new Windows.UI.Xaml.GridLength(0, Windows.UI.Xaml.GridUnitType.Auto) },
- new Windows.UI.Xaml.Controls.RowDefinition { Height = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) }
- },
- ColumnDefinitions =
- {
- new Windows.UI.Xaml.Controls.ColumnDefinition { Width = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) },
- new Windows.UI.Xaml.Controls.ColumnDefinition { Width = new Windows.UI.Xaml.GridLength(0, Windows.UI.Xaml.GridUnitType.Auto) },
- new Windows.UI.Xaml.Controls.ColumnDefinition { Width = new Windows.UI.Xaml.GridLength(1, Windows.UI.Xaml.GridUnitType.Star) }
- },
- Height = size.Height,
- Width = size.Width,
- Children = { border }
- };
-
- var bgPopup = new Popup { Child = new Canvas { Width = size.Width, Height = size.Height, Background = new SolidColorBrush(new Windows.UI.Color { A = 128, R = 0, G = 0, B = 0 }) } };
-
- bgPopup.IsOpen = true;
-
- _currentActionSheet = new Popup { ChildTransitions = new TransitionCollection { new PopupThemeTransition() }, IsLightDismissEnabled = true, Child = container };
-
- _currentActionSheet.Closed += (s, e) =>
- {
- bgPopup.IsOpen = false;
- CancelActionSheet();
- };
-
- if (Device.Idiom == TargetIdiom.Phone)
- {
- double height = _page.ActualHeight;
- stack.Height = height;
- stack.Width = size.Width;
- border.BorderThickness = new Windows.UI.Xaml.Thickness(0);
-
- _currentActionSheet.Height = height;
- _currentActionSheet.VerticalOffset = size.Height - height;
- }
-
- _currentActionSheet.IsOpen = true;
- }
-
- internal async Task UpdateToolbarItems()
- {
- CommandBar commandBar = await GetCommandBarAsync();
- if (commandBar != null)
- {
- commandBar.PrimaryCommands.Clear();
- commandBar.SecondaryCommands.Clear();
- }
-
- commandBar = AddOpenMasterButton(commandBar);
-
- foreach (ToolbarItem item in _toolbarTracker.ToolbarItems.OrderBy(ti => ti.Priority))
- {
- if (commandBar == null)
- commandBar = CreateCommandBar();
-
- var button = new AppBarButton();
- button.SetBinding(AppBarButton.LabelProperty, "Text");
- button.SetBinding(AppBarButton.IconProperty, "Icon", _fileImageSourcePathConverter);
- button.Command = new MenuItemCommand(item);
- button.DataContext = item;
-
- ToolbarItemOrder order = item.Order == ToolbarItemOrder.Default ? ToolbarItemOrder.Primary : item.Order;
- if (order == ToolbarItemOrder.Primary)
- commandBar.PrimaryCommands.Add(button);
- else
- commandBar.SecondaryCommands.Add(button);
- }
-
- if (commandBar?.PrimaryCommands.Count + commandBar?.SecondaryCommands.Count == 0)
- ClearCommandBar();
- }
- }
-}
diff --git a/Xamarin.Forms.Platform.WinRT/SliderRenderer.cs b/Xamarin.Forms.Platform.WinRT/SliderRenderer.cs
index 0fff1496..cf188f15 100644
--- a/Xamarin.Forms.Platform.WinRT/SliderRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/SliderRenderer.cs
@@ -24,11 +24,7 @@ namespace Xamarin.Forms.Platform.WinRT
var slider = new Windows.UI.Xaml.Controls.Slider();
SetNativeControl(slider);
- Control.Minimum = e.NewElement.Minimum;
- Control.Maximum = e.NewElement.Maximum;
- Control.Value = e.NewElement.Value;
-
- slider.ValueChanged += OnNativeValueChanged;
+ slider.ValueChanged += OnNativeValueCHanged;
// Even when using Center/CenterAndExpand, a Slider has an oddity where it looks
// off-center in its layout by a smidge. The default templates are slightly different
@@ -53,6 +49,10 @@ namespace Xamarin.Forms.Platform.WinRT
double stepping = Math.Min((e.NewElement.Maximum - e.NewElement.Minimum) / 10, 1);
Control.StepFrequency = stepping;
Control.SmallChange = stepping;
+
+ Control.Minimum = e.NewElement.Minimum;
+ Control.Maximum = e.NewElement.Maximum;
+ Control.Value = e.NewElement.Value;
}
}
@@ -71,7 +71,7 @@ namespace Xamarin.Forms.Platform.WinRT
}
}
- void OnNativeValueChanged(object sender, RangeBaseValueChangedEventArgs e)
+ void OnNativeValueCHanged(object sender, RangeBaseValueChangedEventArgs e)
{
((IElementController)Element).SetValueFromRenderer(Slider.ValueProperty, e.NewValue);
}
diff --git a/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
index 0017531f..148da1b3 100644
--- a/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/ViewRenderer.cs
@@ -1,6 +1,5 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
-using Windows.UI.Xaml.Automation.Peers;
#if WINDOWS_UWP
@@ -12,11 +11,6 @@ namespace Xamarin.Forms.Platform.WinRT
{
public class ViewRenderer<TElement, TNativeElement> : VisualElementRenderer<TElement, TNativeElement> where TElement : View where TNativeElement : FrameworkElement
{
- string _defaultAutomationPropertiesName;
- AccessibilityView? _defaultAutomationPropertiesAccessibilityView;
- string _defaultAutomationPropertiesHelpText;
- UIElement _defaultAutomationPropertiesLabeledBy;
-
protected override void OnElementChanged(ElementChangedEventArgs<TElement> e)
{
base.OnElementChanged(e);
@@ -39,97 +33,5 @@ namespace Xamarin.Forms.Platform.WinRT
Control.SetValue(AutomationProperties.AutomationIdProperty, id);
}
}
- protected override void SetAutomationPropertiesName()
- {
- if (Control == null)
- {
- base.SetAutomationPropertiesName();
- return;
- }
-
- if (Element == null)
- return;
-
- if (_defaultAutomationPropertiesName == null)
- _defaultAutomationPropertiesName = (string)Control.GetValue(AutomationProperties.NameProperty);
-
- var elemValue = (string)Element.GetValue(Accessibility.NameProperty);
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- Control.SetValue(AutomationProperties.NameProperty, elemValue);
- else
- Control.SetValue(AutomationProperties.NameProperty, _defaultAutomationPropertiesName);
- }
-
- protected override void SetAutomationPropertiesAccessibilityView()
- {
- if (Control == null)
- {
- base.SetAutomationPropertiesAccessibilityView();
- return;
- }
-
- if (Element == null)
- return;
-
- if (!_defaultAutomationPropertiesAccessibilityView.HasValue)
- _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(AutomationProperties.AccessibilityViewProperty);
-
- var newValue = _defaultAutomationPropertiesAccessibilityView;
- var elemValue = (bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty);
-
- if (elemValue == true)
- newValue = AccessibilityView.Content;
- else if (elemValue == false)
- newValue = AccessibilityView.Raw;
-
- Control.SetValue(AutomationProperties.AccessibilityViewProperty, newValue);
- }
-
- protected override void SetAutomationPropertiesHelpText()
- {
- if (Control == null)
- {
- base.SetAutomationPropertiesHelpText();
- return;
- }
-
- if (Element == null)
- return;
-
- if (_defaultAutomationPropertiesHelpText == null)
- _defaultAutomationPropertiesHelpText = (string)Control.GetValue(AutomationProperties.HelpTextProperty);
-
- var elemValue = (string)Element.GetValue(Accessibility.HintProperty);
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- Control.SetValue(AutomationProperties.HelpTextProperty, elemValue);
- else
- Control.SetValue(AutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText);
- }
-
- protected override void SetAutomationPropertiesLabeledBy()
- {
- if (Control == null)
- {
- base.SetAutomationPropertiesLabeledBy();
- return;
- }
-
- if (Element == null)
- return;
-
- if (_defaultAutomationPropertiesLabeledBy == null)
- _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(AutomationProperties.LabeledByProperty);
-
- var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
- var renderer = elemValue?.GetOrCreateRenderer();
- var nativeElement = renderer?.GetNativeElement();
-
- if (nativeElement != null)
- Control.SetValue(AutomationProperties.LabeledByProperty, nativeElement);
- else
- Control.SetValue(AutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
- }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs b/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
index 402d1da8..b81f73e3 100644
--- a/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.WinRT/VisualElementRenderer.cs
@@ -4,7 +4,6 @@ using System.ComponentModel;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
-using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
#if WINDOWS_UWP
@@ -18,10 +17,6 @@ namespace Xamarin.Forms.Platform.WinRT
public class VisualElementRenderer<TElement, TNativeElement> : Panel, IVisualElementRenderer, IDisposable, IEffectControlProvider where TElement : VisualElement
where TNativeElement : FrameworkElement
{
- string _defaultAutomationPropertiesName;
- AccessibilityView? _defaultAutomationPropertiesAccessibilityView;
- string _defaultAutomationPropertiesHelpText;
- UIElement _defaultAutomationPropertiesLabeledBy;
bool _disposed;
EventHandler<VisualElementChangedEventArgs> _elementChangedHandlers;
VisualElementTracker<TElement, TNativeElement> _tracker;
@@ -113,11 +108,6 @@ namespace Xamarin.Forms.Platform.WinRT
return new SizeRequest(result);
}
- public UIElement GetNativeElement()
- {
- return Control;
- }
-
public void SetElement(VisualElement element)
{
TElement oldElement = Element;
@@ -297,14 +287,6 @@ namespace Xamarin.Forms.Platform.WinRT
UpdateEnabled();
else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
UpdateBackgroundColor();
- else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
- SetAutomationPropertiesHelpText();
- else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
- SetAutomationPropertiesName();
- else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
- SetAutomationPropertiesAccessibilityView();
- else if (e.PropertyName == Accessibility.LabeledByProperty.PropertyName)
- SetAutomationPropertiesLabeledBy();
}
protected virtual void OnRegisterEffect(PlatformEffect effect)
@@ -318,75 +300,6 @@ namespace Xamarin.Forms.Platform.WinRT
SetValue(AutomationProperties.AutomationIdProperty, id);
}
- protected virtual void SetAutomationPropertiesName()
- {
- if (Element == null || Control == null)
- return;
-
- if (_defaultAutomationPropertiesName == null)
- _defaultAutomationPropertiesName = (string)Control.GetValue(AutomationProperties.NameProperty);
-
- var elemValue = (string)Element.GetValue(Accessibility.NameProperty);
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- Control.SetValue(AutomationProperties.NameProperty, elemValue);
- else
- Control.SetValue(AutomationProperties.NameProperty, _defaultAutomationPropertiesName);
- }
-
- protected virtual void SetAutomationPropertiesAccessibilityView()
- {
- if (Element == null || Control == null)
- return;
-
- if (!_defaultAutomationPropertiesAccessibilityView.HasValue)
- _defaultAutomationPropertiesAccessibilityView = (AccessibilityView)Control.GetValue(AutomationProperties.AccessibilityViewProperty);
-
- var newValue = _defaultAutomationPropertiesAccessibilityView;
- var elemValue = (bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty);
-
- if (elemValue == true)
- newValue = AccessibilityView.Content;
- else if (elemValue == false)
- newValue = AccessibilityView.Raw;
-
- Control.SetValue(AutomationProperties.AccessibilityViewProperty, newValue);
- }
-
- protected virtual void SetAutomationPropertiesHelpText()
- {
- if (Element == null || Control == null)
- return;
-
- if (_defaultAutomationPropertiesHelpText == null)
- _defaultAutomationPropertiesHelpText = (string)Control.GetValue(AutomationProperties.HelpTextProperty);
-
- var elemValue = (string)Element.GetValue(Accessibility.HintProperty);
-
- if (!string.IsNullOrWhiteSpace(elemValue))
- Control.SetValue(AutomationProperties.HelpTextProperty, elemValue);
- else
- Control.SetValue(AutomationProperties.HelpTextProperty, _defaultAutomationPropertiesHelpText);
- }
-
- protected virtual void SetAutomationPropertiesLabeledBy()
- {
- if (Element == null || Control == null)
- return;
-
- if (_defaultAutomationPropertiesLabeledBy == null)
- _defaultAutomationPropertiesLabeledBy = (UIElement)Control.GetValue(AutomationProperties.LabeledByProperty);
-
- var elemValue = (VisualElement)Element.GetValue(Accessibility.LabeledByProperty);
- var renderer = elemValue?.GetOrCreateRenderer();
- var nativeElement = renderer?.GetNativeElement();
-
- if (nativeElement != null)
- Control.SetValue(AutomationProperties.LabeledByProperty, nativeElement);
- else
- Control.SetValue(AutomationProperties.LabeledByProperty, _defaultAutomationPropertiesLabeledBy);
- }
-
protected void SetNativeControl(TNativeElement control)
{
TNativeElement oldControl = Control;
@@ -454,10 +367,6 @@ namespace Xamarin.Forms.Platform.WinRT
protected virtual void UpdateNativeControl()
{
UpdateEnabled();
- SetAutomationPropertiesHelpText();
- SetAutomationPropertiesName();
- SetAutomationPropertiesAccessibilityView();
- SetAutomationPropertiesLabeledBy();
}
internal virtual void OnElementFocusChangeRequested(object sender, VisualElement.FocusRequestArgs args)
diff --git a/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj b/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj
index 766fd728..22068d0b 100644
--- a/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj
+++ b/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj
@@ -68,8 +68,6 @@
</Compile>
</ItemGroup>
<ItemGroup Condition=" '$(OS)' != 'Unix' ">
- <Compile Include="NavigationPageRendererWinRT.cs" />
- <Compile Include="PlatformWinRT.cs" />
<Compile Include="BrushHelpers.cs" />
<Compile Include="NativeBindingExtensions.cs" />
<Compile Include="NativeEventWrapper.cs" />
@@ -194,4 +192,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project> \ No newline at end of file
+</Project>
diff --git a/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs b/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
index b42f69f4..e32e86cd 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/CellTableViewCell.cs
@@ -7,8 +7,8 @@ namespace Xamarin.Forms.Platform.iOS
public class CellTableViewCell : UITableViewCell, INativeElementView
{
Cell _cell;
+
public Action<object, PropertyChangedEventArgs> PropertyChanged;
- bool _disposed;
public CellTableViewCell(UITableViewCellStyle style, string key) : base(style, key)
{
@@ -95,21 +95,5 @@ namespace Xamarin.Forms.Platform.iOS
return nativeCell;
}
-
- protected override void Dispose(bool disposing)
- {
- if (_disposed)
- return;
-
- if (disposing)
- {
- PropertyChanged = null;
- _cell = null;
- }
-
- _disposed = true;
-
- base.Dispose(disposing);
- }
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
index 30c17234..8f8a92ce 100644
--- a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
@@ -48,11 +48,8 @@ namespace Xamarin.Forms.Platform.iOS
internal class ViewTableCell : UITableViewCell, INativeElementView
{
WeakReference<IVisualElementRenderer> _rendererRef;
- ViewCell _viewCell;
- Element INativeElementView.Element => ViewCell;
- internal bool SupressSeparator { get; set; }
- bool _disposed;
+ ViewCell _viewCell;
public ViewTableCell(string key) : base(UITableViewCellStyle.Default, key)
{
@@ -69,6 +66,10 @@ namespace Xamarin.Forms.Platform.iOS
}
}
+ Element INativeElementView.Element => ViewCell;
+
+ internal bool SupressSeparator { get; set; }
+
public override void LayoutSubviews()
{
//This sets the content views frame.
@@ -114,9 +115,6 @@ namespace Xamarin.Forms.Platform.iOS
protected override void Dispose(bool disposing)
{
- if (_disposed)
- return;
-
if (disposing)
{
IVisualElementRenderer renderer;
@@ -128,12 +126,8 @@ namespace Xamarin.Forms.Platform.iOS
_rendererRef = null;
}
-
- _viewCell = null;
}
- _disposed = true;
-
base.Dispose(disposing);
}
diff --git a/Xamarin.Forms.Platform.iOS/Deserializer.cs b/Xamarin.Forms.Platform.iOS/Deserializer.cs
index dcef049c..86657578 100644
--- a/Xamarin.Forms.Platform.iOS/Deserializer.cs
+++ b/Xamarin.Forms.Platform.iOS/Deserializer.cs
@@ -6,12 +6,7 @@ using System.Runtime.Serialization;
using System.Threading.Tasks;
using System.Xml;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
internal class Deserializer : IDeserializer
{
diff --git a/Xamarin.Forms.Platform.iOS/EffectUtilities.cs b/Xamarin.Forms.Platform.iOS/EffectUtilities.cs
index 6b053787..c9523479 100644
--- a/Xamarin.Forms.Platform.iOS/EffectUtilities.cs
+++ b/Xamarin.Forms.Platform.iOS/EffectUtilities.cs
@@ -1,10 +1,4 @@
-
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
internal static class EffectUtilities
{
diff --git a/Xamarin.Forms.Platform.iOS/ElementChangedEventArgs.cs b/Xamarin.Forms.Platform.iOS/ElementChangedEventArgs.cs
index 49cf85d9..560cfd1c 100644
--- a/Xamarin.Forms.Platform.iOS/ElementChangedEventArgs.cs
+++ b/Xamarin.Forms.Platform.iOS/ElementChangedEventArgs.cs
@@ -1,16 +1,10 @@
using System;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public class VisualElementChangedEventArgs : ElementChangedEventArgs<VisualElement>
{
- public VisualElementChangedEventArgs(VisualElement oldElement, VisualElement newElement)
- : base(oldElement, newElement)
+ public VisualElementChangedEventArgs(VisualElement oldElement, VisualElement newElement) : base(oldElement, newElement)
{
}
}
diff --git a/Xamarin.Forms.Platform.iOS/EventTracker.cs b/Xamarin.Forms.Platform.iOS/EventTracker.cs
index 596506a5..9c6c90e9 100644
--- a/Xamarin.Forms.Platform.iOS/EventTracker.cs
+++ b/Xamarin.Forms.Platform.iOS/EventTracker.cs
@@ -3,42 +3,27 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
-
-#if __MOBILE__
using UIKit;
-using NativeView = UIKit.UIView;
-using NativeGestureRecognizer = UIKit.UIGestureRecognizer;
-using NativeGestureRecognizerState = UIKit.UIGestureRecognizerState;
namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using NativeView = AppKit.NSView;
-using NativeGestureRecognizer = AppKit.NSGestureRecognizer;
-using NativeGestureRecognizerState = AppKit.NSGestureRecognizerState;
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public class EventTracker : IDisposable
{
readonly NotifyCollectionChangedEventHandler _collectionChangedHandler;
- readonly Dictionary<IGestureRecognizer, NativeGestureRecognizer> _gestureRecognizers = new Dictionary<IGestureRecognizer, NativeGestureRecognizer>();
+ readonly Dictionary<IGestureRecognizer, UIGestureRecognizer> _gestureRecognizers = new Dictionary<IGestureRecognizer, UIGestureRecognizer>();
readonly IVisualElementRenderer _renderer;
bool _disposed;
- NativeView _handler;
+ UIView _handler;
double _previousScale = 1.0;
-#if __MOBILE__
UITouchEventArgs _shouldReceive;
-#endif
public EventTracker(IVisualElementRenderer renderer)
{
if (renderer == null)
- throw new ArgumentNullException(nameof(renderer));
+ throw new ArgumentNullException("renderer");
_collectionChangedHandler = ModelGestureRecognizersOnCollectionChanged;
@@ -77,18 +62,18 @@ namespace Xamarin.Forms.Platform.MacOS
_handler = null;
}
- public void LoadEvents(NativeView handler)
+ public void LoadEvents(UIView handler)
{
if (_disposed)
throw new ObjectDisposedException(null);
-#if __MOBILE__
+
_shouldReceive = (r, t) => t.View is IVisualElementRenderer;
-#endif
+
_handler = handler;
OnElementChanged(this, new VisualElementChangedEventArgs(null, _renderer.Element));
}
- protected virtual NativeGestureRecognizer GetNativeRecognizer(IGestureRecognizer recognizer)
+ protected virtual UIGestureRecognizer GetNativeRecognizer(IGestureRecognizer recognizer)
{
if (recognizer == null)
return null;
@@ -99,7 +84,7 @@ namespace Xamarin.Forms.Platform.MacOS
var tapRecognizer = recognizer as TapGestureRecognizer;
if (tapRecognizer != null)
{
- var returnAction = new Action(() =>
+ var uiRecognizer = CreateTapRecognizer(1, tapRecognizer.NumberOfTapsRequired, r =>
{
var tapGestureRecognizer = weakRecognizer.Target as TapGestureRecognizer;
var eventTracker = weakEventTracker.Target as EventTracker;
@@ -108,7 +93,6 @@ namespace Xamarin.Forms.Platform.MacOS
if (tapGestureRecognizer != null && view != null)
tapGestureRecognizer.SendTapped(view);
});
- var uiRecognizer = CreateTapRecognizer(tapRecognizer.NumberOfTapsRequired, returnAction);
return uiRecognizer;
}
@@ -126,51 +110,41 @@ namespace Xamarin.Forms.Platform.MacOS
{
var oldScale = eventTracker._previousScale;
var originPoint = r.LocationInView(null);
-#if __MOBILE__
originPoint = UIApplication.SharedApplication.KeyWindow.ConvertPointToView(originPoint, eventTracker._renderer.NativeView);
-#else
- originPoint = NSApplication.SharedApplication.KeyWindow.ContentView.ConvertPointToView(originPoint, eventTracker._renderer.NativeView);
-#endif
var scaledPoint = new Point(originPoint.X / view.Width, originPoint.Y / view.Height);
switch (r.State)
{
- case NativeGestureRecognizerState.Began:
-#if __MOBILE__
+ case UIGestureRecognizerState.Began:
if (r.NumberOfTouches < 2)
return;
-#endif
pinchGestureRecognizer.SendPinchStarted(view, scaledPoint);
startingScale = view.Scale;
break;
- case NativeGestureRecognizerState.Changed:
-#if __MOBILE__
+ case UIGestureRecognizerState.Changed:
if (r.NumberOfTouches < 2 && pinchGestureRecognizer.IsPinching)
{
- r.State = NativeGestureRecognizerState.Ended;
+ r.State = UIGestureRecognizerState.Ended;
pinchGestureRecognizer.SendPinchEnded(view);
return;
}
- var scale = r.Scale;
-#else
- var scale = r.Magnification;
-#endif
+
var delta = 1.0;
- var dif = Math.Abs(scale - oldScale) * startingScale;
- if (oldScale < scale)
+ var dif = Math.Abs(r.Scale - oldScale) * startingScale;
+ if (oldScale < r.Scale)
delta = 1 + dif;
- if (oldScale > scale)
+ if (oldScale > r.Scale)
delta = 1 - dif;
pinchGestureRecognizer.SendPinch(view, delta, scaledPoint);
- eventTracker._previousScale = scale;
+ eventTracker._previousScale = r.Scale;
break;
- case NativeGestureRecognizerState.Cancelled:
- case NativeGestureRecognizerState.Failed:
+ case UIGestureRecognizerState.Cancelled:
+ case UIGestureRecognizerState.Failed:
if (pinchGestureRecognizer.IsPinching)
pinchGestureRecognizer.SendPinchCanceled(view);
break;
- case NativeGestureRecognizerState.Ended:
+ case UIGestureRecognizerState.Ended:
if (pinchGestureRecognizer.IsPinching)
pinchGestureRecognizer.SendPinchEnded(view);
eventTracker._previousScale = 1;
@@ -194,42 +168,33 @@ namespace Xamarin.Forms.Platform.MacOS
{
switch (r.State)
{
- case NativeGestureRecognizerState.Began:
-#if __MOBILE__
+ case UIGestureRecognizerState.Began:
if (r.NumberOfTouches != panRecognizer.TouchPoints)
return;
-#endif
panGestureRecognizer.SendPanStarted(view, Application.Current.PanGestureId);
break;
- case NativeGestureRecognizerState.Changed:
-#if __MOBILE__
+ case UIGestureRecognizerState.Changed:
if (r.NumberOfTouches != panRecognizer.TouchPoints)
{
- r.State = NativeGestureRecognizerState.Ended;
+ r.State = UIGestureRecognizerState.Ended;
panGestureRecognizer.SendPanCompleted(view, Application.Current.PanGestureId);
Application.Current.PanGestureId++;
return;
}
-#endif
var translationInView = r.TranslationInView(_handler);
panGestureRecognizer.SendPan(view, translationInView.X, translationInView.Y, Application.Current.PanGestureId);
break;
- case NativeGestureRecognizerState.Cancelled:
- case NativeGestureRecognizerState.Failed:
+ case UIGestureRecognizerState.Cancelled:
+ case UIGestureRecognizerState.Failed:
panGestureRecognizer.SendPanCanceled(view, Application.Current.PanGestureId);
Application.Current.PanGestureId++;
break;
- case NativeGestureRecognizerState.Ended:
-#if __MOBILE__
+ case UIGestureRecognizerState.Ended:
if (r.NumberOfTouches != panRecognizer.TouchPoints)
{
panGestureRecognizer.SendPanCompleted(view, Application.Current.PanGestureId);
Application.Current.PanGestureId++;
}
-#else
- panGestureRecognizer.SendPanCompleted(view, Application.Current.PanGestureId);
- Application.Current.PanGestureId++;
-#endif
break;
}
}
@@ -239,7 +204,7 @@ namespace Xamarin.Forms.Platform.MacOS
return null;
}
-#if __MOBILE__
+
UIPanGestureRecognizer CreatePanRecognizer(int numTouches, Action<UIPanGestureRecognizer> action)
{
var result = new UIPanGestureRecognizer(action);
@@ -253,33 +218,14 @@ namespace Xamarin.Forms.Platform.MacOS
return result;
}
- UITapGestureRecognizer CreateTapRecognizer(int numTaps, Action action, int numFingers = 1)
+ UITapGestureRecognizer CreateTapRecognizer(int numFingers, int numTaps, Action<UITapGestureRecognizer> action)
{
var result = new UITapGestureRecognizer(action);
result.NumberOfTouchesRequired = (uint)numFingers;
result.NumberOfTapsRequired = (uint)numTaps;
return result;
}
-#else
- NSPanGestureRecognizer CreatePanRecognizer(int numTouches, Action<NSPanGestureRecognizer> action)
- {
- var result = new NSPanGestureRecognizer(action);
- return result;
- }
-
- NSMagnificationGestureRecognizer CreatePinchRecognizer(Action<NSMagnificationGestureRecognizer> action)
- {
- var result = new NSMagnificationGestureRecognizer(action);
- return result;
- }
- NSClickGestureRecognizer CreateTapRecognizer(int numTaps, Action action)
- {
- var result = new NSClickGestureRecognizer(action);
- result.NumberOfClicksRequired = numTaps;
- return result;
- }
-#endif
void LoadRecognizers()
{
if (ElementGestureRecognizers == null)
@@ -293,9 +239,7 @@ namespace Xamarin.Forms.Platform.MacOS
var nativeRecognizer = GetNativeRecognizer(recognizer);
if (nativeRecognizer != null)
{
-#if __MOBILE__
nativeRecognizer.ShouldReceiveTouch = _shouldReceive;
-#endif
_handler.AddGestureRecognizer(nativeRecognizer);
_gestureRecognizers[recognizer] = nativeRecognizer;
diff --git a/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs b/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs
index 3b3ef91b..50bba17f 100644
--- a/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs
+++ b/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs
@@ -1,37 +1,29 @@
using System;
-
-#if __MOBILE__
using UIKit;
-#endif
namespace Xamarin.Forms
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class ExportRendererAttribute : HandlerAttribute
{
-#if __MOBILE__
public ExportRendererAttribute(Type handler, Type target, UIUserInterfaceIdiom idiom) : base(handler, target)
{
Idiomatic = true;
Idiom = idiom;
}
- internal UIUserInterfaceIdiom Idiom { get; }
-#endif
public ExportRendererAttribute(Type handler, Type target) : base(handler, target)
{
Idiomatic = false;
}
+ internal UIUserInterfaceIdiom Idiom { get; }
+
internal bool Idiomatic { get; }
public override bool ShouldRegister()
{
-#if __MOBILE__
return !Idiomatic || Idiom == UIDevice.CurrentDevice.UserInterfaceIdiom;
-#else
- return !Idiomatic;
-#endif
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/ColorExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/ColorExtensions.cs
index 2b8b9101..bb4342ab 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/ColorExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/ColorExtensions.cs
@@ -1,27 +1,16 @@
using System;
using CoreGraphics;
+using UIKit;
using PointF = CoreGraphics.CGPoint;
using RectangleF = CoreGraphics.CGRect;
using SizeF = CoreGraphics.CGSize;
-#if __MOBILE__
-using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using UIColor = AppKit.NSColor;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public static class ColorExtensions
{
-#if __MOBILE__
internal static readonly UIColor Black = UIColor.Black;
internal static readonly UIColor SeventyPercentGrey = new UIColor(0.7f, 0.7f, 0.7f, 1);
-#else
- internal static readonly NSColor Black = NSColor.Black;
- internal static readonly NSColor SeventyPercentGrey = NSColor.FromRgba(0.7f, 0.7f, 0.7f, 1);
-#endif
public static CGColor ToCGColor(this Color color)
{
@@ -34,15 +23,10 @@ namespace Xamarin.Forms.Platform.MacOS
nfloat green;
nfloat blue;
nfloat alpha;
-#if __MOBILE__
color.GetRGBA(out red, out green, out blue, out alpha);
-#else
- color.GetRgba(out red, out green, out blue, out alpha);
-#endif
return new Color(red, green, blue, alpha);
}
-#if __MOBILE__
public static UIColor ToUIColor(this Color color)
{
return new UIColor((float)color.R, (float)color.G, (float)color.B, (float)color.A);
@@ -63,28 +47,6 @@ namespace Xamarin.Forms.Platform.MacOS
return color.ToUIColor();
}
-#else
- public static NSColor ToNSColor(this Color color)
- {
- return NSColor.FromRgba((float)color.R, (float)color.G, (float)color.B, (float)color.A);
- }
-
- public static NSColor ToNSColor(this Color color, Color defaultColor)
- {
- if (color.IsDefault)
- return defaultColor.ToNSColor();
-
- return color.ToNSColor();
- }
-
- public static NSColor ToNSColor(this Color color, NSColor defaultColor)
- {
- if (color.IsDefault)
- return defaultColor;
-
- return color.ToNSColor();
- }
-#endif
}
public static class PointExtensions
@@ -93,11 +55,6 @@ namespace Xamarin.Forms.Platform.MacOS
{
return new Point(point.X, point.Y);
}
-
- public static PointF ToPointF(this Point point)
- {
- return new PointF(point.X, point.Y);
- }
}
public static class SizeExtensions
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/DateExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/DateExtensions.cs
index 73ca347c..bb0dfff9 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/DateExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/DateExtensions.cs
@@ -1,12 +1,7 @@
using System;
using Foundation;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public static class DateExtensions
{
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/LayoutExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/LayoutExtensions.cs
index d65caf12..823c3f30 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/LayoutExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/LayoutExtensions.cs
@@ -1,19 +1,10 @@
using System.Collections.Generic;
using CoreGraphics;
-#if __MOBILE__
using UIKit;
-using Xamarin.Forms.Platform.iOS;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using UIView = AppKit.NSView;
-using Xamarin.Forms.Platform.MacOS;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
- public delegate SizeRequest? GetDesiredSizeDelegate(
- NativeViewWrapperRenderer renderer, double widthConstraint, double heightConstraint);
+ public delegate SizeRequest? GetDesiredSizeDelegate(NativeViewWrapperRenderer renderer, double widthConstraint, double heightConstraint);
public delegate CGSize? SizeThatFitsDelegate(CGSize size);
@@ -21,15 +12,13 @@ namespace Xamarin.Forms.Platform.MacOS
public static class LayoutExtensions
{
- public static void Add(this IList<View> children, UIView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null,
- SizeThatFitsDelegate sizeThatFitsDelegate = null,
- LayoutSubviewsDelegate layoutSubViews = null)
+ public static void Add(this IList<View> children, UIView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null, SizeThatFitsDelegate sizeThatFitsDelegate = null,
+ LayoutSubviewsDelegate layoutSubViews = null)
{
children.Add(view.ToView(getDesiredSizeDelegate, sizeThatFitsDelegate, layoutSubViews));
}
- public static View ToView(this UIView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null,
- SizeThatFitsDelegate sizeThatFitsDelegate = null, LayoutSubviewsDelegate layoutSubViews = null)
+ public static View ToView(this UIView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null, SizeThatFitsDelegate sizeThatFitsDelegate = null, LayoutSubviewsDelegate layoutSubViews = null)
{
return new NativeViewWrapper(view, getDesiredSizeDelegate, sizeThatFitsDelegate, layoutSubViews);
}
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/PlatformConfigurationExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/PlatformConfigurationExtensions.cs
index f2932e3a..f61837f2 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/PlatformConfigurationExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/PlatformConfigurationExtensions.cs
@@ -1,18 +1,11 @@
-#if __MOBILE__
-using CurrentPlatform = Xamarin.Forms.PlatformConfiguration.iOS;
namespace Xamarin.Forms.Platform.iOS
-#else
-using CurrentPlatform = Xamarin.Forms.PlatformConfiguration.macOS;
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public static class PlatformConfigurationExtensions
{
- public static IPlatformElementConfiguration<CurrentPlatform, T> OnThisPlatform<T>(this T element)
+ public static IPlatformElementConfiguration<PlatformConfiguration.iOS, T> OnThisPlatform<T>(this T element)
where T : Element, IElementConfiguration<T>
{
- return (element).On<CurrentPlatform>();
+ return (element).On<PlatformConfiguration.iOS>();
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs b/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
index 8248af11..4c3eed98 100644
--- a/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
@@ -2,15 +2,10 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
-using static System.String;
-#if __MOBILE__
using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using UIView = AppKit.NSView;
+using static System.String;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public static class UIViewExtensions
{
@@ -21,28 +16,15 @@ namespace Xamarin.Forms.Platform.MacOS
return self.Subviews.Concat(self.Subviews.SelectMany(s => s.Descendants()));
}
- public static SizeRequest GetSizeRequest(this UIView self, double widthConstraint, double heightConstraint,
- double minimumWidth = -1, double minimumHeight = -1)
+ public static SizeRequest GetSizeRequest(this UIView self, double widthConstraint, double heightConstraint, double minimumWidth = -1, double minimumHeight = -1)
{
- CoreGraphics.CGSize s;
-#if __MOBILE__
- s = self.SizeThatFits(new SizeF((float)widthConstraint, (float)heightConstraint));
-#else
- var control = self as AppKit.NSControl;
- if (control != null)
- s = control.SizeThatFits(new CoreGraphics.CGSize(widthConstraint, heightConstraint));
- else
- s = self.FittingSize;
-#endif
- var request = new Size(s.Width == float.PositiveInfinity ? double.PositiveInfinity : s.Width,
- s.Height == float.PositiveInfinity ? double.PositiveInfinity : s.Height);
- var minimum = new Size(minimumWidth < 0 ? request.Width : minimumWidth,
- minimumHeight < 0 ? request.Height : minimumHeight);
+ var s = self.SizeThatFits(new SizeF((float)widthConstraint, (float)heightConstraint));
+ var request = new Size(s.Width == float.PositiveInfinity ? double.PositiveInfinity : s.Width, s.Height == float.PositiveInfinity ? double.PositiveInfinity : s.Height);
+ var minimum = new Size(minimumWidth < 0 ? request.Width : minimumWidth, minimumHeight < 0 ? request.Height : minimumHeight);
return new SizeRequest(request, minimum);
}
- public static void SetBinding(this UIView view, string propertyName, BindingBase bindingBase,
- string updateSourceEventName = null)
+ public static void SetBinding(this UIView view, string propertyName, BindingBase bindingBase, string updateSourceEventName = null)
{
var binding = bindingBase as Binding;
//This will allow setting bindings from Xaml by reusing the MarkupExtension
@@ -69,7 +51,6 @@ namespace Xamarin.Forms.Platform.MacOS
view.AddObserver(nativePropertyListener, key, Foundation.NSKeyValueObservingOptions.New, IntPtr.Zero);
}
}
-#if __MOBILE__
catch (Foundation.MonoTouchException ex)
{
nativePropertyListener = null;
@@ -80,12 +61,7 @@ namespace Xamarin.Forms.Platform.MacOS
}
throw ex;
}
-#else
- catch (Exception ex)
- {
- throw ex;
- }
-#endif
+
}
NativeBindingHelpers.SetBinding(view, propertyName, bindingBase, nativePropertyListener);
@@ -101,8 +77,7 @@ namespace Xamarin.Forms.Platform.MacOS
NativeBindingHelpers.SetValue(target, targetProperty, value);
}
- public static void SetBindingContext(this UIView target, object bindingContext,
- Func<UIView, IEnumerable<UIView>> getChildren = null)
+ public static void SetBindingContext(this UIView target, object bindingContext, Func<UIView, IEnumerable<UIView>> getChildren = null)
{
NativeBindingHelpers.SetBindingContext(target, bindingContext, getChildren);
}
@@ -132,7 +107,6 @@ namespace Xamarin.Forms.Platform.MacOS
return null;
}
-#if __MOBILE__
internal static UIView FindFirstResponder(this UIView view)
{
if (view.IsFirstResponder)
@@ -147,6 +121,5 @@ namespace Xamarin.Forms.Platform.MacOS
return null;
}
-#endif
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Forms.cs b/Xamarin.Forms.Platform.iOS/Forms.cs
index d51e1495..2c8fc6f7 100644
--- a/Xamarin.Forms.Platform.iOS/Forms.cs
+++ b/Xamarin.Forms.Platform.iOS/Forms.cs
@@ -11,18 +11,11 @@ using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using Xamarin.Forms.Internals;
+using CoreFoundation;
using Foundation;
-#if __MOBILE__
using UIKit;
+using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform.iOS;
-using TNativeView = UIKit.UIView;
-#else
-using AppKit;
-using Xamarin.Forms.Platform.MacOS;
-using TNativeView = AppKit.NSView;
-
-#endif
namespace Xamarin.Forms
{
@@ -31,11 +24,7 @@ namespace Xamarin.Forms
//Preserve GetCallingAssembly
static readonly bool nevertrue = false;
- public static bool IsInitialized { get; private set; }
-
-#if __MOBILE__
static bool? s_isiOS9OrNewer;
-#endif
static Forms()
{
@@ -43,7 +32,8 @@ namespace Xamarin.Forms
Assembly.GetCallingAssembly();
}
-#if __MOBILE__
+ public static bool IsInitialized { get; private set; }
+
internal static bool IsiOS9OrNewer
{
get
@@ -53,7 +43,6 @@ namespace Xamarin.Forms
return s_isiOS9OrNewer.Value;
}
}
-#endif
public static void Init()
{
@@ -64,22 +53,19 @@ namespace Xamarin.Forms
Log.Listeners.Add(new DelegateLogListener((c, m) => Trace.WriteLine(m, c)));
-#if __MOBILE__
- Device.Idiom = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? TargetIdiom.Tablet : TargetIdiom.Phone;
-#else
- Device.Idiom = TargetIdiom.Desktop;
-#endif
Device.PlatformServices = new IOSPlatformServices();
Device.Info = new IOSDeviceInfo();
- Registrar.RegisterAll(new[]
- { typeof(ExportRendererAttribute), typeof(ExportCellAttribute), typeof(ExportImageSourceHandlerAttribute) });
+ Registrar.RegisterAll(new[] { typeof(ExportRendererAttribute), typeof(ExportCellAttribute), typeof(ExportImageSourceHandlerAttribute) });
+
+ Device.Idiom = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? TargetIdiom.Tablet : TargetIdiom.Phone;
+
ExpressionSearch.Default = new iOSExpressionSearch();
}
public static event EventHandler<ViewInitializedEventArgs> ViewInitialized;
- internal static void SendViewInitialized(this VisualElement self, TNativeView nativeView)
+ internal static void SendViewInitialized(this VisualElement self, UIView nativeView)
{
ViewInitialized?.Invoke(self, new ViewInitializedEventArgs { View = self, NativeView = nativeView });
}
@@ -113,22 +99,16 @@ namespace Xamarin.Forms
internal class IOSDeviceInfo : DeviceInfo
{
-#if __MOBILE__
readonly NSObject _notification;
-#endif
readonly Size _scaledScreenSize;
readonly double _scalingFactor;
public IOSDeviceInfo()
{
-#if __MOBILE__
_notification = UIDevice.Notifications.ObserveOrientationDidChange((sender, args) => CurrentOrientation = UIDevice.CurrentDevice.Orientation.ToDeviceOrientation());
+
_scalingFactor = UIScreen.MainScreen.Scale;
_scaledScreenSize = new Size(UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
-#else
- _scalingFactor = NSScreen.MainScreen.BackingScaleFactor;
- _scaledScreenSize = new Size(NSScreen.MainScreen.Frame.Width, NSScreen.MainScreen.Frame.Height);
-#endif
PixelScreenSize = new Size(_scaledScreenSize.Width * _scalingFactor, _scaledScreenSize.Height * _scalingFactor);
}
@@ -140,9 +120,7 @@ namespace Xamarin.Forms
protected override void Dispose(bool disposing)
{
-#if __MOBILE__
_notification.Dispose();
-#endif
base.Dispose(disposing);
}
}
@@ -220,20 +198,11 @@ namespace Xamarin.Forms
public bool IsInvokeRequired => !NSThread.IsMain;
-#if __MOBILE__
public string RuntimePlatform => Device.iOS;
-#else
- public string RuntimePlatform => Device.macOS;
-#endif
public void OpenUriAction(Uri uri)
{
- var url = NSUrl.FromString(uri.ToString()) ?? new NSUrl(uri.Scheme, uri.Host, uri.LocalPath);
-#if __MOBILE__
- UIApplication.SharedApplication.OpenUrl(url);
-#else
- NSWorkspace.SharedWorkspace.OpenUrl(url);
-#endif
+ UIApplication.SharedApplication.OpenUrl(new NSUrl(uri.AbsoluteUri));
}
public void StartTimer(TimeSpan interval, Func<bool> callback)
@@ -248,11 +217,11 @@ namespace Xamarin.Forms
HttpClient GetHttpClient()
{
- var proxy = CoreFoundation.CFNetwork.GetSystemProxySettings();
+ var proxy = CFNetwork.GetSystemProxySettings();
var handler = new HttpClientHandler();
if (!string.IsNullOrEmpty(proxy.HTTPProxy))
{
- handler.Proxy = CoreFoundation.CFNetwork.GetDefaultProxy();
+ handler.Proxy = CFNetwork.GetDefaultProxy();
handler.UseProxy = true;
}
return new HttpClient(handler);
@@ -303,8 +272,7 @@ namespace Xamarin.Forms
public Task<Stream> OpenFileAsync(string path, FileMode mode, FileAccess access, FileShare share)
{
- Stream stream = _isolatedStorageFile.OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access,
- (System.IO.FileShare)share);
+ Stream stream = _isolatedStorageFile.OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access, (System.IO.FileShare)share);
return Task.FromResult(stream);
}
}
diff --git a/Xamarin.Forms.Platform.iOS/IVisualElementRenderer.cs b/Xamarin.Forms.Platform.iOS/IVisualElementRenderer.cs
index ffb2de29..9a2bf580 100644
--- a/Xamarin.Forms.Platform.iOS/IVisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/IVisualElementRenderer.cs
@@ -1,24 +1,15 @@
using System;
-#if __MOBILE__
using UIKit;
-using NativeView = UIKit.UIView;
-using NativeViewController = UIKit.UIViewController;
namespace Xamarin.Forms.Platform.iOS
-#else
-using NativeView = AppKit.NSView;
-using NativeViewController = AppKit.NSViewController;
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public interface IVisualElementRenderer : IDisposable, IRegisterable
{
VisualElement Element { get; }
- NativeView NativeView { get; }
+ UIView NativeView { get; }
- NativeViewController ViewController { get; }
+ UIViewController ViewController { get; }
event EventHandler<VisualElementChangedEventArgs> ElementChanged;
diff --git a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs
index acdd6523..9e20e045 100644
--- a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs
+++ b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs
@@ -1,23 +1,16 @@
using System;
-#if __MOBILE__
using UIKit;
-[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.iOS.NativeValueConverterService))]
-namespace Xamarin.Forms.Platform.iOS
-#else
-using UIView = AppKit.NSView;
-[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.MacOS.NativeValueConverterService))]
+[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.iOS.NativeValueConverterService))]
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
class NativeValueConverterService : Xaml.INativeValueConverterService
{
public bool ConvertTo(object value, Type toType, out object nativeValue)
{
nativeValue = null;
- if (typeof(UIView).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View)))
- {
+ if (typeof(UIView).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View))) {
nativeValue = ((UIView)value).ToView();
return true;
}
diff --git a/Xamarin.Forms.Platform.iOS/NativeViewPropertyListener.cs b/Xamarin.Forms.Platform.iOS/NativeViewPropertyListener.cs
index e819519a..4e6601ef 100644
--- a/Xamarin.Forms.Platform.iOS/NativeViewPropertyListener.cs
+++ b/Xamarin.Forms.Platform.iOS/NativeViewPropertyListener.cs
@@ -2,12 +2,7 @@ using System;
using System.ComponentModel;
using Foundation;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
class NativeViewPropertyListener : NSObject, INotifyPropertyChanged
{
@@ -28,4 +23,4 @@ namespace Xamarin.Forms.Platform.MacOS
base.ObserveValue(keyPath, ofObject, change, context);
}
}
-} \ No newline at end of file
+}
diff --git a/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs b/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs
index 165bc0f9..31cb186d 100644
--- a/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs
+++ b/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs
@@ -1,16 +1,10 @@
-#if __MOBILE__
-using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using UIView = AppKit.NSView;
+using UIKit;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public class NativeViewWrapper : View
{
- public NativeViewWrapper(UIView nativeView, GetDesiredSizeDelegate getDesiredSizeDelegate = null,
- SizeThatFitsDelegate sizeThatFitsDelegate = null, LayoutSubviewsDelegate layoutSubViews = null)
+ public NativeViewWrapper(UIView nativeView, GetDesiredSizeDelegate getDesiredSizeDelegate = null, SizeThatFitsDelegate sizeThatFitsDelegate = null, LayoutSubviewsDelegate layoutSubViews = null)
{
GetDesiredSizeDelegate = getDesiredSizeDelegate;
SizeThatFitsDelegate = sizeThatFitsDelegate;
diff --git a/Xamarin.Forms.Platform.iOS/NativeViewWrapperRenderer.cs b/Xamarin.Forms.Platform.iOS/NativeViewWrapperRenderer.cs
index cde9fe81..4d1252ee 100644
--- a/Xamarin.Forms.Platform.iOS/NativeViewWrapperRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/NativeViewWrapperRenderer.cs
@@ -1,13 +1,8 @@
using CoreGraphics;
-using Xamarin.Forms.Internals;
-#if __MOBILE__
using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using UIView = AppKit.NSView;
+using Xamarin.Forms.Internals;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public class NativeViewWrapperRenderer : ViewRenderer<NativeViewWrapper, UIView>
{
@@ -24,7 +19,6 @@ namespace Xamarin.Forms.Platform.MacOS
return result ?? base.GetDesiredSize(widthConstraint, heightConstraint);
}
-#if __MOBILE__
public override void LayoutSubviews()
{
if (Element?.LayoutSubViews == null)
@@ -56,26 +50,6 @@ namespace Xamarin.Forms.Platform.MacOS
// if it returns null, fall back to the default implementation
return result ?? base.SizeThatFits(size);
}
-#else
- public override void Layout()
- {
- if (Element?.LayoutSubViews == null)
- {
- ((IVisualElementController)Element)?.InvalidateMeasure(InvalidationTrigger.MeasureChanged);
- base.Layout();
- return;
- }
-
- // The user has specified a different implementation of LayoutSubviews
- var handled = Element.LayoutSubViews();
-
- if (!handled)
- {
- // If the delegate wasn't able to handle the request, fall back to the default implementation
- base.Layout();
- }
- }
-#endif
protected override void OnElementChanged(ElementChangedEventArgs<NativeViewWrapper> e)
{
diff --git a/Xamarin.Forms.Platform.iOS/PlatformEffect.cs b/Xamarin.Forms.Platform.iOS/PlatformEffect.cs
index 6a1ca494..8fb4f975 100644
--- a/Xamarin.Forms.Platform.iOS/PlatformEffect.cs
+++ b/Xamarin.Forms.Platform.iOS/PlatformEffect.cs
@@ -1,11 +1,6 @@
-#if __MOBILE__
-using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using UIView = AppKit.NSView;
+using UIKit;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public abstract class PlatformEffect : PlatformEffect<UIView, UIView>
{
diff --git a/Xamarin.Forms.Platform.iOS/RendererPool.cs b/Xamarin.Forms.Platform.iOS/RendererPool.cs
index 38fe3c02..babfa7bc 100644
--- a/Xamarin.Forms.Platform.iOS/RendererPool.cs
+++ b/Xamarin.Forms.Platform.iOS/RendererPool.cs
@@ -1,17 +1,11 @@
using System;
using System.Collections.Generic;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public sealed class RendererPool
{
- readonly Dictionary<Type, Stack<IVisualElementRenderer>> _freeRenderers =
- new Dictionary<Type, Stack<IVisualElementRenderer>>();
+ readonly Dictionary<Type, Stack<IVisualElementRenderer>> _freeRenderers = new Dictionary<Type, Stack<IVisualElementRenderer>>();
readonly VisualElement _oldElement;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
index 5eb9b777..68d4702d 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
@@ -38,10 +38,7 @@ namespace Xamarin.Forms.Platform.iOS
protected override void Dispose(bool disposing)
{
if (Control != null)
- {
Control.TouchUpInside -= OnButtonTouchUpInside;
- Control.TouchDown -= OnButtonTouchDown;
- }
base.Dispose(disposing);
}
@@ -63,7 +60,6 @@ namespace Xamarin.Forms.Platform.iOS
_buttonTextColorDefaultDisabled = Control.TitleColor(UIControlState.Disabled);
Control.TouchUpInside += OnButtonTouchUpInside;
- Control.TouchDown += OnButtonTouchDown;
}
UpdateText();
@@ -90,32 +86,11 @@ namespace Xamarin.Forms.Platform.iOS
UpdateImage();
}
- protected override void SetAccessibilityLabel()
- {
- // If we have not specified an AccessibilityLabel and the AccessibiltyLabel is current bound to the Title,
- // exit this method so we don't set the AccessibilityLabel value and break the binding.
- // This may pose a problem for users who want to explicitly set the AccessibilityLabel to null, but this
- // will prevent us from inadvertently breaking UI Tests that are using Query.Marked to get the dynamic Title
- // of the Button.
-
- var elemValue = (string)Element?.GetValue(Accessibility.NameProperty);
- if (string.IsNullOrWhiteSpace(elemValue) && Control?.AccessibilityLabel == Control?.Title(UIControlState.Normal))
- return;
-
- base.SetAccessibilityLabel();
- }
-
void OnButtonTouchUpInside(object sender, EventArgs eventArgs)
{
- ((IButtonController)Element)?.SendReleased();
((IButtonController)Element)?.SendClicked();
}
- void OnButtonTouchDown(object sender, EventArgs eventArgs)
- {
- ((IButtonController)Element)?.SendPressed();
- }
-
void UpdateBorder()
{
var uiButton = Control;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs b/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
index ba8acbe5..cbc2e625 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
@@ -1,26 +1,15 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
-using Xamarin.Forms;
-#if __MOBILE__
using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using UIFont = AppKit.NSFont;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public static class FontExtensions
{
static readonly Dictionary<ToUIFontKey, UIFont> ToUiFont = new Dictionary<ToUIFontKey, UIFont>();
-#if __MOBILE__
- public static UIFont ToUIFont(this Font self)
-#else
- public static UIFont ToNSFont(this Font self)
-#endif
+ public static UIFont ToUIFont(this Font self)
{
var size = (float)self.FontSize;
if (self.UseNamedSize)
@@ -52,7 +41,6 @@ namespace Xamarin.Forms.Platform.MacOS
{
try
{
-#if __MOBILE__
if (UIFont.FamilyNames.Contains(self.FontFamily))
{
var descriptor = new UIFontDescriptor().CreateWithFamily(self.FontFamily);
@@ -71,25 +59,6 @@ namespace Xamarin.Forms.Platform.MacOS
}
return UIFont.FromName(self.FontFamily, size);
-
-#else
-
- var descriptor = new NSFontDescriptor().FontDescriptorWithFamily(self.FontFamily);
-
- if (bold || italic)
- {
- var traits = (NSFontSymbolicTraits)0;
- if (bold)
- traits = traits | NSFontSymbolicTraits.BoldTrait;
- if (italic)
- traits = traits | NSFontSymbolicTraits.ItalicTrait;
-
- descriptor = descriptor.FontDescriptorWithSymbolicTraits(traits);
- return NSFont.FromDescription(descriptor, size);
- }
-
- return NSFont.FromFontName(self.FontFamily, size);
-#endif
}
catch
{
@@ -99,54 +68,28 @@ namespace Xamarin.Forms.Platform.MacOS
if (bold && italic)
{
var defaultFont = UIFont.SystemFontOfSize(size);
-#if __MOBILE__
var descriptor = defaultFont.FontDescriptor.CreateWithTraits(UIFontDescriptorSymbolicTraits.Bold | UIFontDescriptorSymbolicTraits.Italic);
return UIFont.FromDescriptor(descriptor, 0);
}
- if (italic)
- return UIFont.ItalicSystemFontOfSize(size);
-#else
- var descriptor = defaultFont.FontDescriptor.FontDescriptorWithSymbolicTraits(
- NSFontSymbolicTraits.BoldTrait |
- NSFontSymbolicTraits.ItalicTrait);
-
- return NSFont.FromDescription(descriptor, 0);
- }
- if (italic)
- {
- Debug.WriteLine("Italic font requested, passing regular one");
- return NSFont.UserFontOfSize(size);
- }
-#endif
-
if (bold)
return UIFont.BoldSystemFontOfSize(size);
-
+ if (italic)
+ return UIFont.ItalicSystemFontOfSize(size);
return UIFont.SystemFontOfSize(size);
}
internal static bool IsDefault(this Span self)
{
- return self.FontFamily == null && self.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) &&
- self.FontAttributes == FontAttributes.None;
+ return self.FontFamily == null && self.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) && self.FontAttributes == FontAttributes.None;
}
-#if __MOBILE__
internal static UIFont ToUIFont(this Label label)
-#else
- internal static UIFont ToNSFont(this Label label)
-#endif
{
var values = label.GetValues(Label.FontFamilyProperty, Label.FontSizeProperty, Label.FontAttributesProperty);
- return ToUIFont((string)values[0], (float)(double)values[1], (FontAttributes)values[2]) ??
- UIFont.SystemFontOfSize(UIFont.LabelFontSize);
+ return ToUIFont((string)values[0], (float)(double)values[1], (FontAttributes)values[2]) ?? UIFont.SystemFontOfSize(UIFont.LabelFontSize);
}
-#if __MOBILE__
internal static UIFont ToUIFont(this IFontElement element)
-#else
- internal static NSFont ToNSFont(this IFontElement element)
-#endif
{
return ToUIFont(element.FontFamily, (float)element.FontSize, element.FontAttributes);
}
@@ -161,7 +104,6 @@ namespace Xamarin.Forms.Platform.MacOS
try
{
UIFont result;
-#if __MOBILE__
if (UIFont.FamilyNames.Contains(family))
{
var descriptor = new UIFontDescriptor().CreateWithFamily(family);
@@ -182,26 +124,6 @@ namespace Xamarin.Forms.Platform.MacOS
}
result = UIFont.FromName(family, size);
-#else
-
- var descriptor = new NSFontDescriptor().FontDescriptorWithFamily(family);
-
- if (bold || italic)
- {
- var traits = (NSFontSymbolicTraits)0;
- if (bold)
- traits = traits | NSFontSymbolicTraits.BoldTrait;
- if (italic)
- traits = traits | NSFontSymbolicTraits.ItalicTrait;
-
- descriptor = descriptor.FontDescriptorWithSymbolicTraits(traits);
- result = NSFont.FromDescription(descriptor, size);
- if (result != null)
- return result;
- }
-
- result = NSFont.FromFontName(family, size);
-#endif
if (result != null)
return result;
}
@@ -215,27 +137,13 @@ namespace Xamarin.Forms.Platform.MacOS
{
var defaultFont = UIFont.SystemFontOfSize(size);
-#if __MOBILE__
var descriptor = defaultFont.FontDescriptor.CreateWithTraits(UIFontDescriptorSymbolicTraits.Bold | UIFontDescriptorSymbolicTraits.Italic);
return UIFont.FromDescriptor(descriptor, 0);
}
- if (italic)
- return UIFont.ItalicSystemFontOfSize(size);
-#else
- var descriptor = defaultFont.FontDescriptor.FontDescriptorWithSymbolicTraits(
- NSFontSymbolicTraits.BoldTrait |
- NSFontSymbolicTraits.ItalicTrait);
-
- return NSFont.FromDescription(descriptor, 0);
- }
- if (italic)
- {
- Debug.WriteLine("Italic font requested, passing regular one");
- return NSFont.UserFontOfSize(size);
- }
-#endif
if (bold)
return UIFont.BoldSystemFontOfSize(size);
+ if (italic)
+ return UIFont.ItalicSystemFontOfSize(size);
return UIFont.SystemFontOfSize(size);
}
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs b/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
index 825a20bd..dce86b98 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
@@ -1,13 +1,7 @@
using Foundation;
-#if __MOBILE__
using UIKit;
-namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using UIColor = AppKit.NSColor;
-namespace Xamarin.Forms.Platform.MacOS
-#endif
+namespace Xamarin.Forms.Platform.iOS
{
public static class FormattedStringExtensions
{
@@ -25,16 +19,10 @@ namespace Xamarin.Forms.Platform.MacOS
if (fgcolor.IsDefault)
fgcolor = Color.Black; // as defined by apple docs
-#if __MOBILE__
return new NSAttributedString(span.Text, font == Font.Default ? null : font.ToUIFont(), fgcolor.ToUIColor(), span.BackgroundColor.ToUIColor());
-#else
- return new NSAttributedString(span.Text, font == Font.Default ? null : font.ToNSFont(), fgcolor.ToNSColor(),
- span.BackgroundColor.ToNSColor());
-#endif
}
- public static NSAttributedString ToAttributed(this FormattedString formattedString, Font defaultFont,
- Color defaultForegroundColor)
+ public static NSAttributedString ToAttributed(this FormattedString formattedString, Font defaultFont, Color defaultForegroundColor)
{
if (formattedString == null)
return null;
@@ -55,7 +43,6 @@ namespace Xamarin.Forms.Platform.MacOS
if (span == null)
return null;
-#if __MOBILE__
UIFont targetFont;
if (span.IsDefault())
targetFont = ((IFontElement)owner).ToUIFont();
@@ -69,25 +56,9 @@ namespace Xamarin.Forms.Platform.MacOS
fgcolor = Color.Black; // as defined by apple docs
return new NSAttributedString(span.Text, targetFont, fgcolor.ToUIColor(), span.BackgroundColor.ToUIColor());
-#else
- NSFont targetFont;
- if (span.IsDefault())
- targetFont = ((IFontElement)owner).ToNSFont();
- else
- targetFont = span.ToNSFont();
-
- var fgcolor = span.ForegroundColor;
- if (fgcolor.IsDefault)
- fgcolor = defaultForegroundColor;
- if (fgcolor.IsDefault)
- fgcolor = Color.Black; // as defined by apple docs
-
- return new NSAttributedString(span.Text, targetFont, fgcolor.ToNSColor(), span.BackgroundColor.ToNSColor());
-#endif
}
- internal static NSAttributedString ToAttributed(this FormattedString formattedString, Element owner,
- Color defaultForegroundColor)
+ internal static NSAttributedString ToAttributed(this FormattedString formattedString, Element owner, Color defaultForegroundColor)
{
if (formattedString == null)
return null;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
index 82ceda81..e4967c15 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
@@ -1,21 +1,12 @@
using System;
using System.ComponentModel;
+using UIKit;
using RectangleF = CoreGraphics.CGRect;
using SizeF = CoreGraphics.CGSize;
-#if __MOBILE__
-using UIKit;
-using NativeLabel = UIKit.UILabel;
-
namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using NativeLabel = AppKit.NSTextField;
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
- public class LabelRenderer : ViewRenderer<Label, NativeLabel>
+ public class LabelRenderer : ViewRenderer<Label, UILabel>
{
SizeRequest _perfectSize;
@@ -60,16 +51,9 @@ namespace Xamarin.Forms.Platform.MacOS
return result;
}
-#if __MOBILE__
public override void LayoutSubviews()
{
base.LayoutSubviews();
-#else
- public override void Layout()
- {
- base.Layout();
-#endif
-
if (Control == null)
return;
@@ -101,12 +85,7 @@ namespace Xamarin.Forms.Platform.MacOS
{
if (Control == null)
{
- SetNativeControl(new NativeLabel(RectangleF.Empty));
-#if !__MOBILE__
- Control.Editable = false;
- Control.Bezeled = false;
- Control.DrawsBackground = false;
-#endif
+ SetNativeControl(new UILabel(RectangleF.Empty) { BackgroundColor = UIColor.Clear });
}
UpdateText();
@@ -124,7 +103,7 @@ namespace Xamarin.Forms.Platform.MacOS
if (e.PropertyName == Label.HorizontalTextAlignmentProperty.PropertyName)
UpdateAlignment();
else if (e.PropertyName == Label.VerticalTextAlignmentProperty.PropertyName)
- UpdateLayout();
+ LayoutSubviews();
else if (e.PropertyName == Label.TextColorProperty.PropertyName)
UpdateText();
else if (e.PropertyName == Label.FontProperty.PropertyName)
@@ -137,52 +116,23 @@ namespace Xamarin.Forms.Platform.MacOS
UpdateLineBreakMode();
}
-#if __MOBILE__
- protected override void SetAccessibilityLabel()
- {
- // If we have not specified an AccessibilityLabel and the AccessibiltyLabel is current bound to the Text,
- // exit this method so we don't set the AccessibilityLabel value and break the binding.
- // This may pose a problem for users who want to explicitly set the AccessibilityLabel to null, but this
- // will prevent us from inadvertently breaking UI Tests that are using Query.Marked to get the dynamic Text
- // of the Label.
-
- var elemValue = (string)Element?.GetValue(Accessibility.NameProperty);
- if (string.IsNullOrWhiteSpace(elemValue) && Control?.AccessibilityLabel == Control?.Text)
- return;
-
- base.SetAccessibilityLabel();
- }
-#endif
-
protected override void SetBackgroundColor(Color color)
{
-#if __MOBILE__
if (color == Color.Default)
BackgroundColor = UIColor.Clear;
else
BackgroundColor = color.ToUIColor();
-#else
- if (color == Color.Default)
- Layer.BackgroundColor = NSColor.Clear.CGColor;
- else
- Layer.BackgroundColor = color.ToCGColor();
-#endif
-
}
void UpdateAlignment()
{
-#if __MOBILE__
Control.TextAlignment = Element.HorizontalTextAlignment.ToNativeTextAlignment();
-#else
- Control.Alignment = Element.HorizontalTextAlignment.ToNativeTextAlignment();
-#endif
}
void UpdateLineBreakMode()
{
_perfectSizeValid = false;
-#if __MOBILE__
+
switch (Element.LineBreakMode)
{
case LineBreakMode.NoWrap:
@@ -210,35 +160,6 @@ namespace Xamarin.Forms.Platform.MacOS
Control.Lines = 1;
break;
}
-#else
- switch (Element.LineBreakMode)
- {
- case LineBreakMode.NoWrap:
- Control.LineBreakMode = NSLineBreakMode.Clipping;
- Control.MaximumNumberOfLines = 1;
- break;
- case LineBreakMode.WordWrap:
- Control.LineBreakMode = NSLineBreakMode.ByWordWrapping;
- Control.MaximumNumberOfLines = 0;
- break;
- case LineBreakMode.CharacterWrap:
- Control.LineBreakMode = NSLineBreakMode.CharWrapping;
- Control.MaximumNumberOfLines = 0;
- break;
- case LineBreakMode.HeadTruncation:
- Control.LineBreakMode = NSLineBreakMode.TruncatingHead;
- Control.MaximumNumberOfLines = 1;
- break;
- case LineBreakMode.MiddleTruncation:
- Control.LineBreakMode = NSLineBreakMode.TruncatingMiddle;
- Control.MaximumNumberOfLines = 1;
- break;
- case LineBreakMode.TailTruncation:
- Control.LineBreakMode = NSLineBreakMode.TruncatingTail;
- Control.MaximumNumberOfLines = 1;
- break;
- }
-#endif
}
void UpdateText()
@@ -246,12 +167,9 @@ namespace Xamarin.Forms.Platform.MacOS
_perfectSizeValid = false;
var values = Element.GetValues(Label.FormattedTextProperty, Label.TextProperty, Label.TextColorProperty);
- var formatted = values[0] as FormattedString;
+ var formatted = (FormattedString)values[0];
if (formatted != null)
- {
-#if __MOBILE__
Control.AttributedText = formatted.ToAttributed(Element, (Color)values[2]);
- }
else
{
Control.Text = (string)values[1];
@@ -259,28 +177,8 @@ namespace Xamarin.Forms.Platform.MacOS
Control.Font = Element.ToUIFont();
Control.TextColor = ((Color)values[2]).ToUIColor(ColorExtensions.Black);
}
-#else
- Control.AttributedStringValue = formatted.ToAttributed(Element, (Color)values[2]);
- }
- else
- {
- Control.StringValue = (string)values[1] ?? "";
- // default value of color documented to be black in iOS docs
- Control.Font = Element.ToNSFont();
- Control.TextColor = ((Color)values[2]).ToNSColor(ColorExtensions.Black);
- }
-#endif
- UpdateLayout();
- }
-
- void UpdateLayout()
- {
-#if __MOBILE__
LayoutSubviews();
-#else
- Layout();
-#endif
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
index fd0f15f6..3871c5cf 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
@@ -29,7 +29,6 @@ namespace Xamarin.Forms.Platform.iOS
IListViewController Controller => Element;
ITemplatedItemsView<Cell> TemplatedItemsView => Element;
public override UIViewController ViewController => _tableViewController;
- bool _disposed;
public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
{
@@ -91,31 +90,28 @@ namespace Xamarin.Forms.Platform.iOS
}
}
- void DisposeSubviews(UIView view)
- {
- foreach (UIView subView in view.Subviews)
- DisposeSubviews(subView);
-
- view.RemoveFromSuperview();
- view.Dispose();
- }
-
protected override void Dispose(bool disposing)
{
- if (_disposed)
- return;
-
- if (disposing)
+ // check inset tracker for null to
+ if (disposing && _insetTracker != null)
{
- if (_insetTracker != null)
+ _insetTracker.Dispose();
+ _insetTracker = null;
+
+ var viewsToLookAt = new Stack<UIView>(Subviews);
+ while (viewsToLookAt.Count > 0)
{
- _insetTracker.Dispose();
- _insetTracker = null;
+ var view = viewsToLookAt.Pop();
+ var viewCellRenderer = view as ViewCellRenderer.ViewTableCell;
+ if (viewCellRenderer != null)
+ viewCellRenderer.Dispose();
+ else
+ {
+ foreach (var child in view.Subviews)
+ viewsToLookAt.Push(child);
+ }
}
- foreach (UIView subview in Subviews)
- DisposeSubviews(subview);
-
if (Element != null)
{
var templatedItems = TemplatedItemsView.TemplatedItems;
@@ -123,28 +119,27 @@ namespace Xamarin.Forms.Platform.iOS
templatedItems.GroupedCollectionChanged -= OnGroupedCollectionChanged;
}
- if (_dataSource != null)
- {
- _dataSource.Dispose();
- _dataSource = null;
- }
-
if (_tableViewController != null)
{
_tableViewController.Dispose();
_tableViewController = null;
}
+ }
+ if (disposing)
+ {
if (_headerRenderer != null)
{
- var platform = _headerRenderer.Element?.Platform as Platform;
- platform?.DisposeModelAndChildrenRenderers(_headerRenderer.Element);
+ var platform = _headerRenderer.Element.Platform as Platform;
+ if (platform != null)
+ platform.DisposeModelAndChildrenRenderers(_headerRenderer.Element);
_headerRenderer = null;
}
if (_footerRenderer != null)
{
- var platform = _footerRenderer.Element?.Platform as Platform;
- platform?.DisposeModelAndChildrenRenderers(_footerRenderer.Element);
+ var platform = _footerRenderer.Element.Platform as Platform;
+ if (platform != null)
+ platform.DisposeModelAndChildrenRenderers(_footerRenderer.Element);
_footerRenderer = null;
}
@@ -159,8 +154,6 @@ namespace Xamarin.Forms.Platform.iOS
Control?.TableFooterView?.Dispose();
}
- _disposed = true;
-
base.Dispose(disposing);
}
@@ -421,8 +414,6 @@ namespace Xamarin.Forms.Platform.iOS
else if (_footerRenderer != null)
{
Control.TableFooterView = null;
- _footerRenderer.Element.MeasureInvalidated -= OnFooterMeasureInvalidated;
-
var platform = _footerRenderer.Element.Platform as Platform;
if (platform != null)
platform.DisposeModelAndChildrenRenderers(_footerRenderer.Element);
@@ -467,8 +458,6 @@ namespace Xamarin.Forms.Platform.iOS
else if (_headerRenderer != null)
{
Control.TableHeaderView = null;
- _headerRenderer.Element.MeasureInvalidated -= OnHeaderMeasureInvalidated;
-
var platform = _headerRenderer.Element.Platform as Platform;
if (platform != null)
platform.DisposeModelAndChildrenRenderers(_headerRenderer.Element);
@@ -609,7 +598,6 @@ namespace Xamarin.Forms.Platform.iOS
internal class UnevenListViewDataSource : ListViewDataSource
{
IVisualElementRenderer _prototype;
- bool _disposed;
public UnevenListViewDataSource(ListView list, FormsUITableViewController uiTableViewController) : base(list, uiTableViewController)
{
@@ -669,47 +657,27 @@ namespace Xamarin.Forms.Platform.iOS
{
var target = viewCell.View;
if (_prototype == null)
+ {
_prototype = Platform.CreateRenderer(target);
+ Platform.SetRenderer(target, _prototype);
+ }
else
+ {
_prototype.SetElement(target);
-
- Platform.SetRenderer(target, _prototype);
+ Platform.SetRenderer(target, _prototype);
+ }
var req = target.Measure(tableView.Frame.Width, double.PositiveInfinity, MeasureFlags.IncludeMargins);
target.ClearValue(Platform.RendererProperty);
- foreach (Element descendant in target.Descendants())
- {
- IVisualElementRenderer renderer = Platform.GetRenderer(descendant as VisualElement);
+ foreach (var descendant in target.Descendants())
descendant.ClearValue(Platform.RendererProperty);
- renderer?.Dispose();
- }
return (nfloat)req.Request.Height;
}
-
var renderHeight = cell.RenderHeight;
return renderHeight > 0 ? (nfloat)renderHeight : DefaultRowHeight;
}
-
- protected override void Dispose(bool disposing)
- {
- if (_disposed)
- return;
-
- _disposed = true;
-
- if (disposing)
- {
- if (_prototype != null)
- {
- _prototype.Dispose();
- _prototype = null;
- }
- }
-
- base.Dispose(disposing);
- }
}
internal class ListViewDataSource : UITableViewSource
@@ -717,15 +685,14 @@ namespace Xamarin.Forms.Platform.iOS
const int DefaultItemTemplateId = 1;
static int s_dataTemplateIncrementer = 2; // lets start at not 0 because
readonly nfloat _defaultSectionHeight;
- Dictionary<DataTemplate, int> _templateToId = new Dictionary<DataTemplate, int>();
- UITableView _uiTableView;
- FormsUITableViewController _uiTableViewController;
- protected ListView List;
+ readonly Dictionary<DataTemplate, int> _templateToId = new Dictionary<DataTemplate, int>();
+ readonly UITableView _uiTableView;
+ readonly FormsUITableViewController _uiTableViewController;
+ protected readonly ListView List;
IListViewController Controller => List;
protected ITemplatedItemsView<Cell> TemplatedItemsView => List;
bool _isDragging;
bool _selectionFromNative;
- bool _disposed;
public ListViewDataSource(ListViewDataSource source)
{
@@ -1045,29 +1012,6 @@ namespace Xamarin.Forms.Platform.iOS
((INotifyCollectionChanged)templatedList.ShortNames).CollectionChanged -= OnShortNamesCollectionChanged;
}
}
-
- protected override void Dispose(bool disposing)
- {
- if (_disposed)
- return;
-
- if (disposing)
- {
- if (List != null)
- {
- List.ItemSelected -= OnItemSelected;
- List = null;
- }
-
- _templateToId = null;
- _uiTableView = null;
- _uiTableViewController = null;
- }
-
- _disposed = true;
-
- base.Dispose(disposing);
- }
}
}
@@ -1083,12 +1027,11 @@ namespace Xamarin.Forms.Platform.iOS
internal class FormsUITableViewController : UITableViewController
{
- ListView _list;
+ readonly ListView _list;
IListViewController Controller => _list;
UIRefreshControl _refresh;
bool _refreshAdded;
- bool _disposed;
public FormsUITableViewController(ListView element)
{
@@ -1170,25 +1113,15 @@ namespace Xamarin.Forms.Platform.iOS
protected override void Dispose(bool disposing)
{
- if (_disposed)
- return;
+ base.Dispose(disposing);
- if (disposing)
+ if (disposing && _refresh != null)
{
- if (_refresh != null)
- {
- _refresh.ValueChanged -= OnRefreshingChanged;
- _refresh.EndRefreshing();
- _refresh.Dispose();
- _refresh = null;
- }
-
- _list = null;
+ _refresh.ValueChanged -= OnRefreshingChanged;
+ _refresh.EndRefreshing();
+ _refresh.Dispose();
+ _refresh = null;
}
-
- _disposed = true;
-
- base.Dispose(disposing);
}
void CheckContentSize()
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
index 1465b8dc..6b698f22 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
@@ -211,7 +211,7 @@ namespace Xamarin.Forms.Platform.iOS
UpdateBarTextColor();
// If there is already stuff on the stack we need to push it
- ((INavigationPageController)navPage).Pages.ForEach(async p => await PushPageAsync(p, false));
+ ((INavigationPageController)navPage).StackCopy.Reverse().ForEach(async p => await PushPageAsync(p, false));
_tracker = new VisualElementTracker(this);
@@ -617,7 +617,7 @@ namespace Xamarin.Forms.Platform.iOS
if (containerController == null)
return;
var currentChild = containerController.Child;
- var firstPage = ((INavigationPageController)Element).Pages.FirstOrDefault();
+ var firstPage = ((INavigationPageController)Element).StackCopy.LastOrDefault();
if ((firstPage != pageBeingRemoved && currentChild != firstPage && NavigationPage.GetHasBackButton(currentChild)) || _parentMasterDetailPage == null)
return;
diff --git a/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs b/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
index f02655a0..3e5655c9 100644
--- a/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
+++ b/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
@@ -1,11 +1,6 @@
-#if __MOBILE__
using UIKit;
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
internal class ResourcesProvider : ISystemResourcesProvider
{
@@ -13,9 +8,7 @@ namespace Xamarin.Forms.Platform.MacOS
public ResourcesProvider()
{
-#if __MOBILE__
UIApplication.Notifications.ObserveContentSizeCategoryChanged((sender, args) => UpdateStyles());
-#endif
}
public IResourceDictionary GetSystemResources()
@@ -26,7 +19,6 @@ namespace Xamarin.Forms.Platform.MacOS
return _dictionary;
}
-#if __MOBILE__
Style GenerateListItemDetailTextStyle()
{
var font = new UITableViewCell(UITableViewCellStyle.Subtitle, "Foobar").DetailTextLabel.Font;
@@ -52,7 +44,7 @@ namespace Xamarin.Forms.Platform.MacOS
void UpdateStyles()
{
-
+
_dictionary[Device.Styles.TitleStyleKey] = GenerateStyle(UIFont.PreferredHeadline);
_dictionary[Device.Styles.SubtitleStyleKey] = GenerateStyle(UIFont.PreferredSubheadline);
_dictionary[Device.Styles.BodyStyleKey] = GenerateStyle(UIFont.PreferredBody);
@@ -61,11 +53,5 @@ namespace Xamarin.Forms.Platform.MacOS
_dictionary[Device.Styles.ListItemTextStyleKey] = GenerateListItemTextStyle();
_dictionary[Device.Styles.ListItemDetailTextStyleKey] = GenerateListItemDetailTextStyle();
}
-#else
- void UpdateStyles()
- {
- }
-#endif
-
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/ViewInitializedEventArgs.cs b/Xamarin.Forms.Platform.iOS/ViewInitializedEventArgs.cs
index 9ee0da88..73041163 100644
--- a/Xamarin.Forms.Platform.iOS/ViewInitializedEventArgs.cs
+++ b/Xamarin.Forms.Platform.iOS/ViewInitializedEventArgs.cs
@@ -1,16 +1,11 @@
using System;
-#if __MOBILE__
-using TNativeView = UIKit.UIView;
-#else
-using TNativeView = AppKit.NSView;
-
-#endif
+using UIKit;
namespace Xamarin.Forms
{
public class ViewInitializedEventArgs : EventArgs
{
- public TNativeView NativeView { get; internal set; }
+ public UIView NativeView { get; internal set; }
public VisualElement View { get; internal set; }
}
diff --git a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
index 2cf9f754..6ecc307b 100644
--- a/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/ViewRenderer.cs
@@ -1,39 +1,21 @@
using System;
using System.ComponentModel;
-
+using UIKit;
using RectangleF = CoreGraphics.CGRect;
using SizeF = CoreGraphics.CGSize;
-#if __MOBILE__
-using UIKit;
-using NativeView = UIKit.UIView;
-using NativeColor = UIKit.UIColor;
-using NativeControl = UIKit.UIControl;
-
namespace Xamarin.Forms.Platform.iOS
-#else
-using NativeView = AppKit.NSView;
-using NativeColor = CoreGraphics.CGColor;
-using NativeControl = AppKit.NSControl;
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
- public abstract class ViewRenderer : ViewRenderer<View, NativeView>
+ public abstract class ViewRenderer : ViewRenderer<View, UIView>
{
}
- public abstract class ViewRenderer<TView, TNativeView> : VisualElementRenderer<TView> where TView : View where TNativeView : NativeView
+ public abstract class ViewRenderer<TView, TNativeView> : VisualElementRenderer<TView> where TView : View where TNativeView : UIView
{
-#if __MOBILE__
- string _defaultAccessibilityLabel;
- string _defaultAccessibilityHint;
- bool? _defaultIsAccessibilityElement;
-#endif
- NativeColor _defaultColor;
+ UIColor _defaultColor;
public TNativeView Control { get; private set; }
-#if __MOBILE__
+
public override void LayoutSubviews()
{
base.LayoutSubviews();
@@ -48,19 +30,6 @@ namespace Xamarin.Forms.Platform.MacOS
return Control.SizeThatFits(size);
}
-#else
- public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
- {
- return (Control ?? NativeView).GetSizeRequest(widthConstraint, heightConstraint);
- }
-
- public override void Layout()
- {
- if (Control != null)
- Control.Frame = new RectangleF(0, 0, (nfloat)Element.Width, (nfloat)Element.Height);
- base.Layout();
- }
-#endif
/// <summary>
/// Determines whether the native control is disposed of when this renderer is disposed
@@ -115,59 +84,7 @@ namespace Xamarin.Forms.Platform.MacOS
base.OnRegisterEffect(effect);
effect.Control = Control;
}
-#if __MOBILE__
- protected override void SetAccessibilityHint()
- {
- if (Control == null)
- {
- base.SetAccessibilityHint();
- return;
- }
-
- if (Element == null)
- return;
-
- if (_defaultAccessibilityHint == null)
- _defaultAccessibilityHint = Control.AccessibilityHint;
-
- Control.AccessibilityHint = (string)Element.GetValue(Accessibility.HintProperty) ?? _defaultAccessibilityHint;
-
- }
-
- protected override void SetAccessibilityLabel()
- {
- if (Control == null)
- {
- base.SetAccessibilityLabel();
- return;
- }
-
- if (Element == null)
- return;
-
- if (_defaultAccessibilityLabel == null)
- _defaultAccessibilityLabel = Control.AccessibilityLabel;
-
- Control.AccessibilityLabel = (string)Element.GetValue(Accessibility.NameProperty) ?? _defaultAccessibilityLabel;
- }
- protected override void SetIsAccessibilityElement()
- {
- if (Control == null)
- {
- base.SetIsAccessibilityElement();
- return;
- }
-
- if (Element == null)
- return;
-
- if (!_defaultIsAccessibilityElement.HasValue)
- _defaultIsAccessibilityElement = Control.IsAccessibilityElement;
-
- Control.IsAccessibilityElement = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultIsAccessibilityElement);
- }
-#endif
protected override void SetAutomationId(string id)
{
if (Control == null)
@@ -183,24 +100,16 @@ namespace Xamarin.Forms.Platform.MacOS
{
if (Control == null)
return;
-#if __MOBILE__
+
if (color == Color.Default)
Control.BackgroundColor = _defaultColor;
else
Control.BackgroundColor = color.ToUIColor();
-#else
- Control.Layer.BackgroundColor = color == Color.Default ? _defaultColor : color.ToCGColor();
-#endif
}
protected void SetNativeControl(TNativeView uiview)
{
-#if __MOBILE__
_defaultColor = uiview.BackgroundColor;
-#else
- uiview.WantsLayer = true;
- _defaultColor = uiview.Layer.BackgroundColor;
-#endif
Control = uiview;
if (Element.BackgroundColor != Color.Default)
@@ -211,19 +120,17 @@ namespace Xamarin.Forms.Platform.MacOS
AddSubview(uiview);
}
-#if __MOBILE__
- internal override void SendVisualElementInitialized(VisualElement element, NativeView nativeView)
+ internal override void SendVisualElementInitialized(VisualElement element, UIView nativeView)
{
base.SendVisualElementInitialized(element, Control);
}
-#endif
void UpdateIsEnabled()
{
if (Element == null || Control == null)
return;
- var uiControl = Control as NativeControl;
+ var uiControl = Control as UIControl;
if (uiControl == null)
return;
uiControl.Enabled = Element.IsEnabled;
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementPackager.cs b/Xamarin.Forms.Platform.iOS/VisualElementPackager.cs
index fa91cf6a..1670176d 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementPackager.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementPackager.cs
@@ -1,11 +1,6 @@
using System;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public class VisualElementPackager : IDisposable
{
@@ -18,7 +13,7 @@ namespace Xamarin.Forms.Platform.MacOS
public VisualElementPackager(IVisualElementRenderer renderer)
{
if (renderer == null)
- throw new ArgumentNullException(nameof(renderer));
+ throw new ArgumentNullException("renderer");
Renderer = renderer;
renderer.ElementChanged += OnRendererElementChanged;
@@ -105,9 +100,8 @@ namespace Xamarin.Forms.Platform.MacOS
continue;
var nativeControl = childRenderer.NativeView;
-#if __MOBILE__
+
Renderer.NativeView.BringSubviewToFront(nativeControl);
-#endif
nativeControl.Layer.ZPosition = z * 1000;
}
}
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
index 57c9ab12..155f8b60 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
@@ -1,25 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using UIKit;
+using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
using RectangleF = CoreGraphics.CGRect;
using SizeF = CoreGraphics.CGSize;
-#if __MOBILE__
-using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
-using UIKit;
-using NativeView = UIKit.UIView;
-using NativeViewController = UIKit.UIViewController;
-using NativeColor = UIKit.UIColor;
namespace Xamarin.Forms.Platform.iOS
-#else
-using AppKit;
-using NativeView = AppKit.NSView;
-using NativeViewController = AppKit.NSViewController;
-using NativeColor = AppKit.NSColor;
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
[Flags]
public enum VisualElementRendererFlags
@@ -29,18 +17,13 @@ namespace Xamarin.Forms.Platform.MacOS
AutoPackage = 1 << 2
}
- public class VisualElementRenderer<TElement> : NativeView, IVisualElementRenderer, IEffectControlProvider where TElement : VisualElement
+ public class VisualElementRenderer<TElement> : UIView, IVisualElementRenderer, IEffectControlProvider where TElement : VisualElement
{
- readonly NativeColor _defaultColor = NativeColor.Clear;
+ readonly UIColor _defaultColor = UIColor.Clear;
readonly List<EventHandler<VisualElementChangedEventArgs>> _elementChangedHandlers = new List<EventHandler<VisualElementChangedEventArgs>>();
readonly PropertyChangedEventHandler _propertyChangedHandler;
-#if __MOBILE__
- string _defaultAccessibilityLabel;
- string _defaultAccessibilityHint;
- bool? _defaultIsAccessibilityElement;
-#endif
EventTracker _events;
VisualElementRendererFlags _flags = VisualElementRendererFlags.AutoPackage | VisualElementRendererFlags.AutoTrack;
@@ -48,30 +31,21 @@ namespace Xamarin.Forms.Platform.MacOS
VisualElementPackager _packager;
VisualElementTracker _tracker;
-#if __MOBILE__
UIVisualEffectView _blur;
BlurEffectStyle _previousBlur;
-#endif
protected VisualElementRenderer() : base(RectangleF.Empty)
{
_propertyChangedHandler = OnElementPropertyChanged;
-#if __MOBILE__
- BackgroundColor = _defaultColor;
-#else
- WantsLayer = true;
- Layer.BackgroundColor = _defaultColor.CGColor;
-#endif
+ BackgroundColor = UIColor.Clear;
}
-#if __MOBILE__
// prevent possible crashes in overrides
- public sealed override NativeColor BackgroundColor
+ public sealed override UIColor BackgroundColor
{
get { return base.BackgroundColor; }
set { base.BackgroundColor = value; }
}
-#endif
public TElement Element { get; private set; }
@@ -99,7 +73,7 @@ namespace Xamarin.Forms.Platform.MacOS
}
}
- public static void RegisterEffect(Effect effect, NativeView container, NativeView control = null)
+ public static void RegisterEffect(Effect effect, UIView container, UIView control = null)
{
var platformEffect = effect as PlatformEffect;
if (platformEffect == null)
@@ -132,7 +106,10 @@ namespace Xamarin.Forms.Platform.MacOS
return NativeView.GetSizeRequest(widthConstraint, heightConstraint);
}
- public NativeView NativeView => this;
+ public UIView NativeView
+ {
+ get { return this; }
+ }
void IVisualElementRenderer.SetElement(VisualElement element)
{
@@ -141,10 +118,13 @@ namespace Xamarin.Forms.Platform.MacOS
public void SetElementSize(Size size)
{
- Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion(Element, new Rectangle(Element.X, Element.Y, size.Width, size.Height));
+ Layout.LayoutChildIntoBoundingRegion(Element, new Rectangle(Element.X, Element.Y, size.Width, size.Height));
}
- public virtual NativeViewController ViewController => null;
+ public virtual UIViewController ViewController
+ {
+ get { return null; }
+ }
public event EventHandler<ElementChangedEventArgs<TElement>> ElementChanged;
@@ -182,7 +162,6 @@ namespace Xamarin.Forms.Platform.MacOS
}
element.PropertyChanged += _propertyChangedHandler;
-
}
OnElementChanged(new ElementChangedEventArgs<TElement>(oldElement, element));
@@ -194,14 +173,8 @@ namespace Xamarin.Forms.Platform.MacOS
if (Element != null && !string.IsNullOrEmpty(Element.AutomationId))
SetAutomationId(Element.AutomationId);
-#if __MOBILE__
- SetAccessibilityLabel();
- SetAccessibilityHint();
- SetIsAccessibilityElement();
-#endif
}
-#if __MOBILE__
public override SizeF SizeThatFits(SizeF size)
{
return new SizeF(0, 0);
@@ -217,16 +190,6 @@ namespace Xamarin.Forms.Platform.MacOS
Superview.Add(_blur);
}
}
-#else
- public override void MouseDown(NSEvent theEvent)
- {
- bool inViewCell = IsOnViewCell(Element);
-
- if (Element.InputTransparent || inViewCell)
- base.MouseDown(theEvent);
- }
-#endif
-
protected override void Dispose(bool disposing)
{
if ((_flags & VisualElementRendererFlags.Disposed) != 0)
@@ -264,29 +227,22 @@ namespace Xamarin.Forms.Platform.MacOS
for (var i = 0; i < _elementChangedHandlers.Count; i++)
_elementChangedHandlers[i](this, args);
- ElementChanged?.Invoke(this, e);
-#if __MOBILE__
+ var changed = ElementChanged;
+ if (changed != null)
+ changed(this, e);
+
if (e.NewElement != null)
SetBlur((BlurEffectStyle)e.NewElement.GetValue(PlatformConfiguration.iOSSpecific.VisualElement.BlurEffectProperty));
-#endif
}
protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
SetBackgroundColor(Element.BackgroundColor);
- else if (e.PropertyName == Xamarin.Forms.Layout.IsClippedToBoundsProperty.PropertyName)
+ else if (e.PropertyName == Layout.IsClippedToBoundsProperty.PropertyName)
UpdateClipToBounds();
-#if __MOBILE__
else if (e.PropertyName == PlatformConfiguration.iOSSpecific.VisualElement.BlurEffectProperty.PropertyName)
SetBlur((BlurEffectStyle)Element.GetValue(PlatformConfiguration.iOSSpecific.VisualElement.BlurEffectProperty));
- else if (e.PropertyName == Accessibility.HintProperty.PropertyName)
- SetAccessibilityHint();
- else if (e.PropertyName == Accessibility.NameProperty.PropertyName)
- SetAccessibilityLabel();
- else if (e.PropertyName == Accessibility.IsInAccessibleTreeProperty.PropertyName)
- SetIsAccessibilityElement();
-#endif
}
protected virtual void OnRegisterEffect(PlatformEffect effect)
@@ -294,40 +250,6 @@ namespace Xamarin.Forms.Platform.MacOS
effect.Container = this;
}
-#if __MOBILE__
- protected virtual void SetAccessibilityHint()
- {
- if (Element == null)
- return;
-
- if (_defaultAccessibilityHint == null)
- _defaultAccessibilityHint = AccessibilityHint;
-
- AccessibilityHint = (string)Element.GetValue(Accessibility.HintProperty) ?? _defaultAccessibilityHint;
- }
-
- protected virtual void SetAccessibilityLabel()
- {
- if (Element == null)
- return;
-
- if (_defaultAccessibilityLabel == null)
- _defaultAccessibilityLabel = AccessibilityLabel;
-
- AccessibilityLabel = (string)Element.GetValue(Accessibility.NameProperty) ?? _defaultAccessibilityLabel;
- }
-
- protected virtual void SetIsAccessibilityElement()
- {
- if (Element == null)
- return;
-
- if (!_defaultIsAccessibilityElement.HasValue)
- _defaultIsAccessibilityElement = IsAccessibilityElement;
-
- IsAccessibilityElement = (bool)((bool?)Element.GetValue(Accessibility.IsInAccessibleTreeProperty) ?? _defaultIsAccessibilityElement);
- }
-#endif
protected virtual void SetAutomationId(string id)
{
AccessibilityIdentifier = id;
@@ -336,20 +258,11 @@ namespace Xamarin.Forms.Platform.MacOS
protected virtual void SetBackgroundColor(Color color)
{
if (color == Color.Default)
-#if __MOBILE__
-
BackgroundColor = _defaultColor;
else
BackgroundColor = color.ToUIColor();
-
-#else
- Layer.BackgroundColor = _defaultColor.CGColor;
- else
- Layer.BackgroundColor = color.ToCGColor();
-#endif
}
-#if __MOBILE__
protected virtual void SetBlur(BlurEffectStyle blur)
{
if (_previousBlur == blur)
@@ -387,35 +300,21 @@ namespace Xamarin.Forms.Platform.MacOS
_blur = new UIVisualEffectView(blurEffect);
LayoutSubviews();
}
-#endif
protected virtual void UpdateNativeWidget()
{
}
- internal virtual void SendVisualElementInitialized(VisualElement element, NativeView nativeView)
+ internal virtual void SendVisualElementInitialized(VisualElement element, UIView nativeView)
{
element.SendViewInitialized(nativeView);
}
void UpdateClipToBounds()
{
-#if __MOBILE__
var clippableLayout = Element as Layout;
if (clippableLayout != null)
ClipsToBounds = clippableLayout.IsClippedToBounds;
-#endif
- }
-
- static bool IsOnViewCell(Element element)
- {
-
- if (element.Parent == null)
- return false;
- else if (element.Parent is ViewCell)
- return true;
- else
- return IsOnViewCell(element.Parent);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs b/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
index 29840e2d..5b41ca84 100644
--- a/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
+++ b/Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
@@ -3,13 +3,8 @@ using System.ComponentModel;
using System.Drawing;
using System.Threading;
using CoreAnimation;
-#if __MOBILE__
namespace Xamarin.Forms.Platform.iOS
-#else
-
-namespace Xamarin.Forms.Platform.MacOS
-#endif
{
public class VisualElementTracker : IDisposable
{
@@ -23,9 +18,7 @@ namespace Xamarin.Forms.Platform.MacOS
// Track these by hand because the calls down into iOS are too expensive
bool _isInteractive;
Rectangle _lastBounds;
-#if !__MOBILE__
- Rectangle _lastParentBounds;
-#endif
+
CALayer _layer;
int _updateCount;
@@ -114,17 +107,12 @@ namespace Xamarin.Forms.Platform.MacOS
var shouldInteract = !view.InputTransparent && view.IsEnabled;
if (_isInteractive != shouldInteract)
{
-#if __MOBILE__
uiview.UserInteractionEnabled = shouldInteract;
-#endif
_isInteractive = shouldInteract;
}
var boundsChanged = _lastBounds != view.Bounds;
-#if !__MOBILE__
- var viewParent = view.RealParent as VisualElement;
- var parentBoundsChanged = _lastParentBounds != (viewParent == null ? Rectangle.Zero : viewParent.Bounds);
-#endif
+
var thread = !boundsChanged && !caLayer.Frame.IsEmpty;
var anchorX = (float)view.AnchorX;
@@ -148,17 +136,13 @@ namespace Xamarin.Forms.Platform.MacOS
{
if (updateTarget != _updateCount)
return;
-#if __MOBILE__
+
var visualElement = view;
-#endif
var parent = view.RealParent;
var shouldRelayoutSublayers = false;
if (isVisible && caLayer.Hidden)
{
-#if !__MOBILE__
- uiview.Hidden = false;
-#endif
caLayer.Hidden = false;
if (!caLayer.Frame.IsEmpty)
shouldRelayoutSublayers = true;
@@ -166,9 +150,6 @@ namespace Xamarin.Forms.Platform.MacOS
if (!isVisible && !caLayer.Hidden)
{
-#if !__MOBILE__
- uiview.Hidden = true;
-#endif
caLayer.Hidden = true;
shouldRelayoutSublayers = true;
}
@@ -176,26 +157,11 @@ namespace Xamarin.Forms.Platform.MacOS
// ripe for optimization
var transform = CATransform3D.Identity;
-#if __MOBILE__
- bool shouldUpdate = (!(visualElement is Page) || visualElement is ContentPage) && width > 0 && height > 0 && parent != null && boundsChanged;
-#else
- // We don't care if it's a page or not since bounds of the window can change
- // TODO: Find why it doesn't work to check if the parentsBounds changed and remove true;
- parentBoundsChanged = true;
- bool shouldUpdate = width > 0 && height > 0 && parent != null && (boundsChanged || parentBoundsChanged);
-#endif
// Dont ever attempt to actually change the layout of a Page unless it is a ContentPage
// iOS is a really big fan of you not actually modifying the View's of the UIViewControllers
- if (shouldUpdate)
+ if ((!(visualElement is Page) || visualElement is ContentPage) && width > 0 && height > 0 && parent != null && boundsChanged)
{
-#if __MOBILE__
var target = new RectangleF(x, y, width, height);
-#else
- var visualParent = parent as VisualElement;
- float newY = visualParent == null ? y : Math.Max(0, (float)(visualParent.Height - y - view.Height));
- var target = new RectangleF(x, newY, width, height);
-#endif
-
// must reset transform prior to setting frame...
caLayer.Transform = transform;
uiview.Frame = target;
@@ -204,17 +170,11 @@ namespace Xamarin.Forms.Platform.MacOS
}
else if (width <= 0 || height <= 0)
{
- //TODO: FInd why it doesn't work
-#if __MOBILE__
caLayer.Hidden = true;
-#endif
return;
}
-#if __MOBILE__
+
caLayer.AnchorPoint = new PointF(anchorX, anchorY);
-#else
- caLayer.AnchorPoint = new PointF(anchorX - 0.5f, anchorY - 0.5f);
-#endif
caLayer.Opacity = opacity;
const double epsilon = 0.001;
@@ -249,9 +209,6 @@ namespace Xamarin.Forms.Platform.MacOS
update();
_lastBounds = view.Bounds;
-#if !__MOBILE__
- _lastParentBounds = viewParent?.Bounds ?? Rectangle.Zero;
-#endif
}
void SetElement(VisualElement oldElement, VisualElement newElement)
@@ -282,18 +239,14 @@ namespace Xamarin.Forms.Platform.MacOS
if (_layer == null)
{
-#if !__MOBILE__
- Renderer.NativeView.WantsLayer = true;
-#endif
_layer = Renderer.NativeView.Layer;
-#if __MOBILE__
_isInteractive = Renderer.NativeView.UserInteractionEnabled;
-#endif
}
OnUpdateNativeControl(_layer);
- NativeControlUpdated?.Invoke(this, EventArgs.Empty);
+ if (NativeControlUpdated != null)
+ NativeControlUpdated(this, EventArgs.Empty);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml
index 7118c5d8..296f9eeb 100644
--- a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml
+++ b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml
@@ -4,8 +4,7 @@
x:Class="Xamarin.Forms.Xaml.UnitTests.CompiledTypeConverter"
RectangleP="0,1,2,4"
RectangleBP="4,8,16,32"
- BackgroundColor="Pink"
- List="Foo, Bar">
+ BackgroundColor="Pink">
<Label x:Name="label"
HorizontalOptions="EndAndExpand"
RelativeLayout.XConstraint="2" Margin="2,3"/>
diff --git a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs
index f74b5a73..1ef319a3 100644
--- a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using NUnit.Framework;
+using NUnit.Framework;
namespace Xamarin.Forms.Xaml.UnitTests
{
@@ -15,10 +14,6 @@ namespace Xamarin.Forms.Xaml.UnitTests
public Rectangle RectangleP { get; set; }
- [TypeConverter(typeof(ListStringTypeConverter))]
- public IList<string> List { get; set; }
-
-
public CompiledTypeConverter ()
{
InitializeComponent ();
@@ -44,8 +39,6 @@ namespace Xamarin.Forms.Xaml.UnitTests
var xConstraint = RelativeLayout.GetXConstraint(p.label);
Assert.AreEqual(2, xConstraint.Compute(null));
Assert.AreEqual(new Thickness(2, 3), p.label.Margin);
- Assert.AreEqual(2, p.List.Count);
- Assert.AreEqual("Bar", p.List[1]);
}
}
}
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27863.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27863.xaml.cs
index 1120a033..03ebaaf9 100644
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27863.xaml.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27863.xaml.cs
@@ -4,7 +4,6 @@ using System.Collections.Generic;
using Xamarin.Forms;
using NUnit.Framework;
-using Xamarin.Forms.Core.UnitTests;
namespace Xamarin.Forms.Xaml.UnitTests
{
@@ -23,18 +22,6 @@ namespace Xamarin.Forms.Xaml.UnitTests
[TestFixture]
class Tests
{
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
[TestCase(true)]
[TestCase(false)]
public void DataTemplateInResourceDictionaries (bool useCompiledXaml)
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27968.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27968.xaml.cs
index 507073d7..2482e9f0 100644
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27968.xaml.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz27968.xaml.cs
@@ -4,7 +4,6 @@ using System.Collections.Generic;
using Xamarin.Forms;
using NUnit.Framework;
-using Xamarin.Forms.Core.UnitTests;
namespace Xamarin.Forms.Xaml.UnitTests
{
@@ -27,18 +26,6 @@ namespace Xamarin.Forms.Xaml.UnitTests
[TestFixture]
class Tests
{
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
[TestCase(true)]
[TestCase(false)]
public void BaseClassIdentifiersAreValidForResources (bool useCompiledXaml)
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml
deleted file mode 100644
index cb280fcb..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?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="Xamarin.Forms.Xaml.UnitTests.Bz40906">
- <Label x:Name="label0">
- <![CDATA[Foo]]>
- </Label>
- <Label x:Name="label1">
- <![CDATA[Foo]]>Bar<![CDATA[>><<]]>
- </Label>
-</ContentPage>
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs
deleted file mode 100644
index dd734550..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz40906.xaml.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public partial class Bz40906 : ContentPage
- {
- public Bz40906()
- {
- InitializeComponent();
- }
-
- public Bz40906(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void ParsingCDATA(bool useCompiledXaml)
- {
- var page = new Bz40906(useCompiledXaml);
- Assert.AreEqual("Foo", page.label0.Text);
- Assert.AreEqual("FooBar>><<", page.label1.Text);
-}
- }
- }
-}
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml
deleted file mode 100644
index 49c473ca..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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="Xamarin.Forms.Xaml.UnitTests.Bz42531">
- <ListView x:Name="lv">
- <ListView.ItemTemplate>
- <DataTemplate>
- <ViewCell>
- <StackLayout Orientation="Horizontal">
- <StackLayout.Resources>
- <ResourceDictionary>
- <Style TargetType="Label">
- <Setter Property="HorizontalOptions" Value="Center"/>
- </Style>
- </ResourceDictionary>
- </StackLayout.Resources>
- <Label Text="Example1"/>
- <Label Text="2..."/>
- </StackLayout>
- </ViewCell>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
-</ContentPage> \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml.cs
deleted file mode 100644
index 380cef6a..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz42531.xaml.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public partial class Bz42531 : ContentPage
- {
- public Bz42531()
- {
- InitializeComponent();
- }
-
- public Bz42531(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void RDInDataTemplates(bool useCompiledXaml)
- {
- var p = new Bz42531(useCompiledXaml);
- ListView lv = p.lv;
- var template = lv.ItemTemplate;
- var cell = template.CreateContent(null, lv) as ViewCell;
- var sl = cell.View as StackLayout;
- Assert.AreEqual(1, sl.Resources.Count);
- var label = sl.Children[0] as Label;
- Assert.AreEqual(LayoutOptions.Center, label.HorizontalOptions);
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml
deleted file mode 100644
index 9fcc0c00..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?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="Xamarin.Forms.Xaml.UnitTests.Bz43694">
- <ContentPage.Resources>
- <ResourceDictionary>
- <x:String x:Key="Dark">Dark</x:String>
- <x:String x:Key="Light">
- <OnPlatform x:TypeArguments="x:String">
- <OnPlatform.iOS>OpenSans-Light</OnPlatform.iOS>
- <OnPlatform.Android>OpenSans-Light</OnPlatform.Android>
- <OnPlatform.WinPhone>/Assets/Fonts/OpenSans-Light.ttf#Open Sans</OnPlatform.WinPhone>
- </OnPlatform>
- </x:String>
- </ResourceDictionary>
- </ContentPage.Resources>
- <Label Text="{StaticResource Light}"
- VerticalOptions="Center"
- HorizontalOptions="Center"
- x:Name="label"/>
-</ContentPage> \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml.cs
deleted file mode 100644
index 62af1c0b..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43694.xaml.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- [XamlCompilation(XamlCompilationOptions.Skip)]
- public partial class Bz43694 : ContentPage
- {
- public Bz43694()
- {
- InitializeComponent();
- }
-
- public Bz43694(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void xStaticWithOnPlatformChildInRD(bool useCompiledXaml)
- {
- if (useCompiledXaml)
- Assert.Throws(new XamlParseExceptionConstraint(9, 6), () => MockCompiler.Compile(typeof(Bz43694)));
- else
- Assert.Throws(new XamlParseExceptionConstraint(9, 6), () => new Bz43694(useCompiledXaml));
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml
deleted file mode 100644
index eaccfcd9..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?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="Xamarin.Forms.Xaml.UnitTests.Bz43733">
- <Label x:Name="label" Text="{StaticResource SharedText}"/>
-</ContentPage>
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml.cs
deleted file mode 100644
index 2f15579f..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43733.xaml.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public class Bz43733Rd : ResourceDictionary
- {
- public Bz43733Rd()
- {
- Add("SharedText", "Foo");
- }
- }
-
- public partial class Bz43733 : ContentPage
- {
- public Bz43733()
- {
- InitializeComponent();
- }
-
- public Bz43733(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void ThrowOnMissingDictionary(bool useCompiledXaml)
- {
- Application.Current = new MockApplication {
- Resources = new ResourceDictionary {
- MergedWith = typeof(Bz43733Rd),
- }
- };
- var p = new Bz43733(useCompiledXaml);
- Assert.AreEqual("Foo", p.label.Text);
- }
- }
- }
-}
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml
deleted file mode 100644
index 0a932f32..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?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="Xamarin.Forms.Xaml.UnitTests.Bz44213">
- <Label x:Name="label">
- <Label.Text>
- <OnPlatform x:TypeArguments="BindingBase" Android="{Binding Bar}">
- <OnPlatform.iOS>
- <Binding Path="Foo"/>
- </OnPlatform.iOS>
- </OnPlatform>
- </Label.Text>
- </Label>
-</ContentPage>
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml.cs
deleted file mode 100644
index faabad6d..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44213.xaml.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using NUnit.Framework;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public partial class Bz44213 : ContentPage
- {
- public Bz44213()
- {
- InitializeComponent();
- }
-
- public Bz44213(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void BindingInOnPlatform(bool useCompiledXaml)
- {
- ((MockPlatformServices)Device.PlatformServices).RuntimePlatform = Device.iOS;
- var p = new Bz44213(useCompiledXaml);
- p.BindingContext = new { Foo = "Foo", Bar = "Bar" };
- Assert.AreEqual("Foo", p.label.Text);
- ((MockPlatformServices)Device.PlatformServices).RuntimePlatform = Device.Android;
- p = new Bz44213(useCompiledXaml);
- p.BindingContext = new { Foo = "Foo", Bar = "Bar" };
- Assert.AreEqual("Bar", p.label.Text);
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml
deleted file mode 100644
index fd0cfb4d..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:Xamarin.Forms.Xaml.UnitTests"
- x:Class="Xamarin.Forms.Xaml.UnitTests.Bz44216">
- <ContentPage.Behaviors>
- <local:Bz44216Behavior MinLengh="5" />
- </ContentPage.Behaviors>
-</ContentPage>
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml.cs
deleted file mode 100644
index b6ad87b7..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz44216.xaml.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public class Bz44216Behavior : Behavior<ContentPage>
- {
- static readonly BindableProperty MinLenghProperty = BindableProperty.Create("MinLengh", typeof(int), typeof(Bz44216Behavior), 1);
-
- public int MinLengh {
- get { return (int)base.GetValue(MinLenghProperty); }
- private set { base.SetValue(MinLenghProperty, value > 0 ? value : 1); }
- }
- }
-
- [XamlCompilation(XamlCompilationOptions.Skip)]
- public partial class Bz44216 : ContentPage
- {
- public Bz44216()
- {
- InitializeComponent();
- }
-
- public Bz44216(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void DonSetValueOnPrivateBP(bool useCompiledXaml)
- {
- if (useCompiledXaml)
- Assert.Throws(new XamlParseExceptionConstraint(7, 26, s => s.StartsWith("No property,", StringComparison.Ordinal)), () => MockCompiler.Compile(typeof(Bz44216)));
- else
- Assert.Throws(new XamlParseExceptionConstraint(7, 26, s=> s.StartsWith("Cannot assign property", StringComparison.Ordinal)), () => new Bz44216(useCompiledXaml));
- }
- }
- }
-}
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml
deleted file mode 100644
index a89aa295..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ContentPage
- xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:Xamarin.Forms.Xaml.UnitTests"
- x:Class="Xamarin.Forms.Xaml.UnitTests.Bz45179">
- <ContentPage.Resources>
- <ResourceDictionary>
- <DataTemplate x:Key="dt0">
- <local:Bz45179_0/>
- </DataTemplate>
- </ResourceDictionary>
- </ContentPage.Resources>
-</ContentPage> \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml.cs
deleted file mode 100644
index 1dbdb44d..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45179.xaml.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public class Bz45179_0 : ContentView {
- public static int creator_count;
- public Bz45179_0()
- {
- creator_count++;
- }
-
- }
- public partial class Bz45179 : ContentPage
- {
- public Bz45179()
- {
- InitializeComponent();
- }
-
- public Bz45179(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void DTDoNotInstantiateTheirContent(bool useCompiledXaml)
- {
- Bz45179_0.creator_count = 0;
- Assume.That(Bz45179_0.creator_count, Is.EqualTo(0));
- var page = new Bz45179(useCompiledXaml);
- Assert.That(Bz45179_0.creator_count, Is.EqualTo(0));
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml
deleted file mode 100644
index daaa8daa..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:Xamarin.Forms.Xaml.UnitTests"
- x:Class="Xamarin.Forms.Xaml.UnitTests.Bz45299">
- <local:Bz45299Control
- BackgroundColor="Silver"
- HorizontalOptions="FillAndExpand"
- VerticalOptions="FillAndExpand" x:Name="ctrl">
- <local:Bz45299Control.PortraitLayout>
- <local:Bz45299OrientationLayout Count="3" Spacing="1" />
- </local:Bz45299Control.PortraitLayout>
- </local:Bz45299Control>
-</ContentPage> \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml.cs
deleted file mode 100644
index 791e870f..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45299.xaml.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public class Bz45299Control : ContentView
- {
- public static readonly BindableProperty PortraitLayoutProperty =
- BindableProperty.Create(nameof(PortraitLayout), typeof(Bz45299OrientationLayout), typeof(Bz45299Control));
- public Bz45299OrientationLayout PortraitLayout {
- get { return (Bz45299OrientationLayout)GetValue(PortraitLayoutProperty); }
- set { this.SetValue(PortraitLayoutProperty, value); }
- }
-
- }
-
- public class Bz45299OrientationLayout : BindableObject
- {
- public static readonly BindableProperty SizeProperty =
- BindableProperty.Create(nameof(Size), typeof(Bz45299UISize), typeof(Bz45299OrientationLayout), Bz45299UISize.Zero);
- public Bz45299UISize Size {
- get { return (Bz45299UISize)GetValue(SizeProperty); }
- set { SetValue(SizeProperty, value); }
- }
-
- public static readonly BindableProperty SpacingProperty =
- BindableProperty.Create(nameof(Spacing), typeof(Bz45299UILength), typeof(Bz45299OrientationLayout), Bz45299UILength.Zero);
- public Bz45299UILength Spacing {
- get { return (Bz45299UILength)GetValue(SpacingProperty); }
- set { SetValue(SpacingProperty, value); }
- }
-
- public static readonly BindableProperty CountProperty =
- BindableProperty.Create(nameof(Count), typeof(int), typeof(Bz45299OrientationLayout), 1);
- public int Count {
- get { return (int)GetValue(CountProperty); }
- set { SetValue(CountProperty, value); }
- }
- }
-
- [TypeConverter(typeof(Bz45299UILengthTypeConverter))]
- public class Bz45299UILength
- {
- public static Bz45299UILength Zero => new Bz45299UILength { Value = 0 };
-
- public double Value { get; set; }
-
- public static implicit operator string(Bz45299UILength uiLength) => uiLength.Value.ToString();
- public static implicit operator double(Bz45299UILength uiLength) => uiLength.Value;
-
- public static implicit operator Bz45299UILength(string value) => Zero;
- public static implicit operator Bz45299UILength(long value) => Zero;
- public static implicit operator Bz45299UILength(ulong value) => Zero;
- public static implicit operator Bz45299UILength(int value) => Zero;
- public static implicit operator Bz45299UILength(uint value) => Zero;
- public static implicit operator Bz45299UILength(double value) => Zero;
- public static implicit operator Bz45299UILength(float value) => Zero;
- }
-
- public class Bz45299UILengthTypeConverter : TypeConverter
- {
- static readonly Type StringType = typeof(string);
- public override bool CanConvertFrom(Type sourceType)
- {
- if (sourceType != StringType)
- return false;
-
- return true;
- }
-
- public override object ConvertFromInvariantString(string value) => Bz45299UILength.Zero;
- }
-
- [TypeConverter(typeof(Bz45299UISizeTypeConverter))]
- public class Bz45299UISize
- {
- public static Bz45299UISize Zero => new Bz45299UISize { Width = 0, Height = 0 };
-
- public Bz45299UILength Width { get; set; }
- public Bz45299UILength Height { get; set; }
-
- public static implicit operator Bz45299UISize(string value) => Zero;
- public static implicit operator Size(Bz45299UISize uiSize) => new Size(uiSize.Width, uiSize.Height);
- public static implicit operator Bz45299UISize(Size size) => new Bz45299UISize { Width = size.Width, Height = size.Height };
- }
-
- public class Bz45299UISizeTypeConverter : TypeConverter
- {
- private static readonly Type StringType = typeof(string);
-
- public override bool CanConvertFrom(Type sourceType)
- {
- if (sourceType != StringType)
- return false;
-
- return true;
- }
-
- public override object ConvertFromInvariantString(string value) => Bz45299UISize.Zero;
- }
-
- public partial class Bz45299 : ContentPage
- {
- public Bz45299()
- {
- InitializeComponent();
- }
- public Bz45299(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void XamlCCustomTypeConverter(bool useCompiledXaml)
- {
- var p = new Bz45299(useCompiledXaml);
- Assert.AreEqual(0d, p.ctrl.PortraitLayout.Spacing.Value);
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml
deleted file mode 100644
index 7a1adf67..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
- xmlns:local="clr-namespace:Xamarin.Forms.Xaml.UnitTests"
- x:Class="Xamarin.Forms.Xaml.UnitTests.Bz45891">
- <local:Bz45891.List>
- <OnPlatform x:TypeArguments="scg:List(sys:String)">
- <OnPlatform.iOS>
- <scg:List x:TypeArguments="sys:String">
- <x:String>Foo</x:String>
- </scg:List>
- </OnPlatform.iOS>
- </OnPlatform>
- </local:Bz45891.List>
-</ContentPage> \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml.cs
deleted file mode 100644
index 4284dde7..00000000
--- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz45891.xaml.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Core.UnitTests;
-
-namespace Xamarin.Forms.Xaml.UnitTests
-{
- public partial class Bz45891 : ContentPage
- {
- public Bz45891()
- {
- InitializeComponent();
- }
-
- public Bz45891(bool useCompiledXaml)
- {
- //this stub will be replaced at compile time
- }
-
- public static readonly BindableProperty ListProperty =
- BindableProperty.Create("List", typeof(IEnumerable<string>), typeof(Bz45891), default(IEnumerable<string>));
-
- public IEnumerable<string> List {
- get { return (IEnumerable<string>)GetValue(ListProperty); }
- set { SetValue(ListProperty, value); }
- }
-
- [TestFixture]
- class Tests
- {
- [SetUp]
- public void Setup()
- {
- Device.PlatformServices = new MockPlatformServices();
- }
-
- [TearDown]
- public void TearDown()
- {
- Device.PlatformServices = null;
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void LookForInheritanceOnOpImplicit(bool useCompiledXaml)
- {
- var p = new Bz45891(useCompiledXaml);
- Assert.AreEqual("Foo", p.List.First());
- }
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
index be0d97cf..b0e4fa52 100644
--- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
+++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj
@@ -427,21 +427,6 @@
<Compile Include="Issues\Bz53203.xaml.cs">
<DependentUpon>Bz53203.xaml</DependentUpon>
</Compile>
- <Compile Include="Issues\Bz51567.xaml.cs">
- <DependentUpon>Bz51567.xaml</DependentUpon>
- </Compile>
- <Compile Include="Issues\Bz42531.xaml.cs">
- <DependentUpon>Bz42531.xaml</DependentUpon>
- </Compile>
- <Compile Include="Issues\Bz45299.xaml.cs">
- <DependentUpon>Bz45299.xaml</DependentUpon>
- </Compile>
- <Compile Include="Issues\Bz43733.xaml.cs">
- <DependentUpon>Bz43733.xaml</DependentUpon>
- </Compile>
- <Compile Include="Issues\Bz44213.xaml.cs">
- <DependentUpon>Bz44213.xaml</DependentUpon>
- </Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\.nuspec\Xamarin.Forms.Debug.targets" />
@@ -790,21 +775,6 @@
<EmbeddedResource Include="Issues\Bz53203.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
- <EmbeddedResource Include="Issues\Bz51567.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="Issues\Bz42531.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="Issues\Bz45299.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="Issues\Bz43733.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="Issues\Bz44213.xaml">
- <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
- </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs
index 1064166f..9aa03b9e 100644
--- a/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs
@@ -48,7 +48,6 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests
[TestCase(typeof(bool), typeof(BindableObject), ExpectedResult = false)]
[TestCase(typeof(Dictionary<string, string>), typeof(BindableObject), ExpectedResult = false)]
[TestCase(typeof(List<string>), typeof(BindableObject), ExpectedResult = false)]
- [TestCase(typeof(List<string>), typeof(IEnumerable<string>), ExpectedResult = true)]
[TestCase(typeof(List<Button>), typeof(BindableObject), ExpectedResult = false)]
[TestCase(typeof(Queue<KeyValuePair<string, string>>), typeof(BindableObject), ExpectedResult = false)]
[TestCase(typeof(double), typeof(double), ExpectedResult = true)]
diff --git a/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs b/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs
index 833d5d94..154ba023 100644
--- a/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs
+++ b/Xamarin.Forms.Xaml/ApplyPropertiesVisitor.cs
@@ -35,10 +35,15 @@ namespace Xamarin.Forms.Xaml
HydratationContext Context { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.BottomUp;
- public bool StopOnDataTemplate => true;
+ public bool VisitChildrenFirst {
+ get { return true; }
+ }
+
+ public bool StopOnDataTemplate {
+ get { return true; }
+ }
+
public bool StopOnResourceDictionary { get; }
- public bool VisitNodeOnDataTemplate => true;
public void Visit(ValueNode node, INode parentNode)
{
@@ -76,15 +81,6 @@ namespace Xamarin.Forms.Xaml
public void Visit(ElementNode node, INode parentNode)
{
- var propertyName = XmlName.Empty;
- if (TryGetPropertyName(node, parentNode, out propertyName) && propertyName == XmlName._CreateContent){
- var s0 = Values[parentNode];
- if (s0 is ElementTemplate) {
- SetTemplate(s0 as ElementTemplate, node);
- return;
- }
- }
-
var value = Values [node];
var parentElement = parentNode as IElementNode;
var markupExtension = value as IMarkupExtension;
@@ -100,7 +96,7 @@ namespace Xamarin.Forms.Xaml
value = valueProvider.ProvideValue(serviceProvider);
}
- propertyName = XmlName.Empty;
+ XmlName propertyName = XmlName.Empty;
//Simplify ListNodes with single elements
var pList = parentNode as ListNode;
@@ -117,11 +113,15 @@ namespace Xamarin.Forms.Xaml
return;
var source = Values [parentNode];
- SetPropertyValue(source, propertyName, value, Context.RootElement, node, Context, node);
+
+ if (propertyName == XmlName._CreateContent && source is ElementTemplate)
+ SetTemplate(source as ElementTemplate, node);
+ else
+ SetPropertyValue(source, propertyName, value, Context.RootElement, node, Context, node);
} else if (IsCollectionItem(node, parentNode) && parentNode is IElementNode) {
// Collection element, implicit content, or implicit collection element.
string contentProperty;
- if (typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(Context.Types [parentElement].GetTypeInfo()) && Context.Types[parentElement].GetRuntimeMethods().Any(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) {
+ if (typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(Context.Types [parentElement].GetTypeInfo())) {
var source = Values [parentNode];
if (!(typeof(ResourceDictionary).IsAssignableFrom(Context.Types [parentElement]))) {
var addMethod =
@@ -137,8 +137,7 @@ namespace Xamarin.Forms.Xaml
var source = Values [parentNode];
SetPropertyValue(source, name, value, Context.RootElement, node, Context, node);
- } else
- throw new XamlParseException($"Can not set the content of {((IElementNode)parentNode).XmlType.Name} as it doesn't have a ContentPropertyAttribute", node);
+ }
} else if (IsCollectionItem(node, parentNode) && parentNode is ListNode) {
var parentList = (ListNode)parentNode;
var source = Values [parentNode.Parent];
@@ -297,7 +296,7 @@ namespace Xamarin.Forms.Xaml
return;
//If we can assign that value to a normal property, let's do it
- if (xpe == null && TrySetProperty(xamlelement, localName, value, lineInfo, serviceProvider, context, out xpe))
+ if (xpe == null && TrySetProperty(xamlelement, localName, value, lineInfo, serviceProvider, out xpe))
return;
//If it's an already initialized property, add to it
@@ -362,7 +361,7 @@ namespace Xamarin.Forms.Xaml
exception = null;
var elementType = element.GetType();
- var binding = value.ConvertTo(typeof(BindingBase),pinfoRetriever:null,serviceProvider:null) as BindingBase;
+ var binding = value as BindingBase;
var bindable = element as BindableObject;
var nativeBindingService = DependencyService.Get<INativeBindingService>();
@@ -423,7 +422,7 @@ namespace Xamarin.Forms.Xaml
return false;
}
- static bool TrySetProperty(object element, string localName, object value, IXmlLineInfo lineInfo, XamlServiceProvider serviceProvider, HydratationContext context, out Exception exception)
+ static bool TrySetProperty(object element, string localName, object value, IXmlLineInfo lineInfo, XamlServiceProvider serviceProvider, out Exception exception)
{
exception = null;
@@ -433,9 +432,6 @@ namespace Xamarin.Forms.Xaml
if (propertyInfo == null || !propertyInfo.CanWrite || (setter = propertyInfo.SetMethod) == null)
return false;
- if (!IsVisibleFrom(setter, context.RootElement))
- return false;
-
object convertedValue = value.ConvertTo(propertyInfo.PropertyType, () => propertyInfo, serviceProvider);
if (convertedValue != null && !propertyInfo.PropertyType.IsInstanceOfType(convertedValue))
return false;
@@ -444,19 +440,6 @@ namespace Xamarin.Forms.Xaml
return true;
}
- static bool IsVisibleFrom(MethodInfo setter, object rootElement)
- {
- if (setter.IsPublic)
- return true;
- if (setter.IsPrivate && setter.DeclaringType == rootElement.GetType())
- return true;
- if ((setter.IsAssembly || setter.IsFamilyOrAssembly) && setter.DeclaringType.AssemblyQualifiedName == rootElement.GetType().AssemblyQualifiedName)
- return true;
- if (setter.IsFamily && setter.DeclaringType.IsAssignableFrom(rootElement.GetType()))
- return true;
- return false;
- }
-
static bool TryAddToProperty(object element, string localName, object value, IXmlLineInfo lineInfo, XamlServiceProvider serviceProvider, out Exception exception)
{
exception = null;
diff --git a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
index b4f9213a..817b62c8 100644
--- a/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
+++ b/Xamarin.Forms.Xaml/CreateValuesVisitor.cs
@@ -23,10 +23,20 @@ namespace Xamarin.Forms.Xaml
HydratationContext Context { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.BottomUp;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return true; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs b/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs
index 282b7da4..81893506 100644
--- a/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs
+++ b/Xamarin.Forms.Xaml/ExpandMarkupsVisitor.cs
@@ -28,10 +28,20 @@ namespace Xamarin.Forms.Xaml
HydratationContext Context { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.BottomUp;
- public bool StopOnDataTemplate => false;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => true;
+ public bool VisitChildrenFirst
+ {
+ get { return true; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return false; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/FillResourceDictionariesVisitor.cs b/Xamarin.Forms.Xaml/FillResourceDictionariesVisitor.cs
index 509d54e8..a3f12109 100644
--- a/Xamarin.Forms.Xaml/FillResourceDictionariesVisitor.cs
+++ b/Xamarin.Forms.Xaml/FillResourceDictionariesVisitor.cs
@@ -20,10 +20,20 @@ namespace Xamarin.Forms.Xaml
get { return Context.Values; }
}
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return false; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/MarkupExtensions/StaticResourceExtension.cs b/Xamarin.Forms.Xaml/MarkupExtensions/StaticResourceExtension.cs
index 34f1c569..703fc206 100644
--- a/Xamarin.Forms.Xaml/MarkupExtensions/StaticResourceExtension.cs
+++ b/Xamarin.Forms.Xaml/MarkupExtensions/StaticResourceExtension.cs
@@ -34,7 +34,7 @@ namespace Xamarin.Forms.Xaml
}
if (resource == null && (Application.Current == null || Application.Current.Resources == null ||
!Application.Current.Resources.TryGetMergedValue(Key, out resource)))
- throw new XamlParseException($"StaticResource not found for key {Key}", xmlLineInfo);
+ throw new XamlParseException($"StaticResource not found for key {Key}", xmlLineInfo);
var bp = valueProvider.TargetProperty as BindableProperty;
var pi = valueProvider.TargetProperty as PropertyInfo;
diff --git a/Xamarin.Forms.Xaml/NamescopingVisitor.cs b/Xamarin.Forms.Xaml/NamescopingVisitor.cs
index ec9b9851..0651d045 100644
--- a/Xamarin.Forms.Xaml/NamescopingVisitor.cs
+++ b/Xamarin.Forms.Xaml/NamescopingVisitor.cs
@@ -14,10 +14,20 @@ namespace Xamarin.Forms.Xaml
Dictionary<INode, object> Values { get; set; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => false;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => true;
+ public bool VisitChildrenFirst
+ {
+ get { return false; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return false; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/PruneIgnoredNodesVisitor.cs b/Xamarin.Forms.Xaml/PruneIgnoredNodesVisitor.cs
index 92badecd..95ddb20f 100644
--- a/Xamarin.Forms.Xaml/PruneIgnoredNodesVisitor.cs
+++ b/Xamarin.Forms.Xaml/PruneIgnoredNodesVisitor.cs
@@ -5,10 +5,17 @@ namespace Xamarin.Forms.Xaml
{
class PruneIgnoredNodesVisitor : IXamlNodeVisitor
{
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => false;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => true;
+ public bool StopOnDataTemplate {
+ get { return false; }
+ }
+
+ public bool StopOnResourceDictionary {
+ get { return false; }
+ }
+
+ public bool VisitChildrenFirst {
+ get { return false; }
+ }
public void Visit(ElementNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/RegisterXNamesVisitor.cs b/Xamarin.Forms.Xaml/RegisterXNamesVisitor.cs
index 5ee3bc3e..a7da3b98 100644
--- a/Xamarin.Forms.Xaml/RegisterXNamesVisitor.cs
+++ b/Xamarin.Forms.Xaml/RegisterXNamesVisitor.cs
@@ -12,10 +12,20 @@ namespace Xamarin.Forms.Xaml
Dictionary<INode, object> Values { get; }
- public TreeVisitingMode VisitingMode => TreeVisitingMode.TopDown;
- public bool StopOnDataTemplate => true;
- public bool StopOnResourceDictionary => false;
- public bool VisitNodeOnDataTemplate => false;
+ public bool VisitChildrenFirst
+ {
+ get { return false; }
+ }
+
+ public bool StopOnDataTemplate
+ {
+ get { return true; }
+ }
+
+ public bool StopOnResourceDictionary
+ {
+ get { return false; }
+ }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/TypeConversionExtensions.cs b/Xamarin.Forms.Xaml/TypeConversionExtensions.cs
index da8e7117..15a66f5d 100644
--- a/Xamarin.Forms.Xaml/TypeConversionExtensions.cs
+++ b/Xamarin.Forms.Xaml/TypeConversionExtensions.cs
@@ -176,7 +176,7 @@ namespace Xamarin.Forms.Xaml
if (!mi.IsSpecialName) continue;
if (mi.Name != "op_Implicit") continue;
if (!mi.IsPublic) continue;
- if (!toType.IsAssignableFrom(mi.ReturnType)) continue;
+ if (mi.ReturnType != toType) continue;
var parameters = mi.GetParameters();
if (parameters.Length != 1) continue;
if (parameters[0].ParameterType != value.GetType()) continue;
@@ -188,7 +188,7 @@ namespace Xamarin.Forms.Xaml
if (!mi.IsSpecialName) continue;
if (mi.Name != "op_Implicit") continue;
if (!mi.IsPublic) continue;
- if (!toType.IsAssignableFrom(mi.ReturnType)) continue;
+ if (mi.ReturnType != toType) continue;
var parameters = mi.GetParameters();
if (parameters.Length != 1) continue;
if (parameters[0].ParameterType != value.GetType()) continue;
diff --git a/Xamarin.Forms.Xaml/XamlNode.cs b/Xamarin.Forms.Xaml/XamlNode.cs
index eccf2075..752f3845 100644
--- a/Xamarin.Forms.Xaml/XamlNode.cs
+++ b/Xamarin.Forms.Xaml/XamlNode.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -6,30 +7,36 @@ using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Xaml
{
- interface INode
+ internal interface INode
{
List<string> IgnorablePrefixes { get; set; }
+
IXmlNamespaceResolver NamespaceResolver { get; }
+
INode Parent { get; set; }
void Accept(IXamlNodeVisitor visitor, INode parentNode);
INode Clone();
}
- interface IValueNode : INode
+ internal interface IValueNode : INode
{
}
- interface IElementNode : INode, IListNode
+ internal interface IElementNode : INode, IListNode
{
Dictionary<XmlName, INode> Properties { get; }
+
List<XmlName> SkipProperties { get; }
+
INameScope Namescope { get; }
+
XmlType XmlType { get; }
+
string NamespaceURI { get; }
}
- interface IListNode : INode
+ internal interface IListNode : INode
{
List<INode> CollectionItems { get; }
}
@@ -49,7 +56,7 @@ namespace Xamarin.Forms.Xaml
public IList<XmlType> TypeArguments { get; }
}
- abstract class BaseNode : IXmlLineInfo, INode
+ internal abstract class BaseNode : IXmlLineInfo, INode
{
protected BaseNode(IXmlNamespaceResolver namespaceResolver, int linenumber = -1, int lineposition = -1)
{
@@ -59,19 +66,27 @@ namespace Xamarin.Forms.Xaml
}
public IXmlNamespaceResolver NamespaceResolver { get; }
+
+ public abstract void Accept(IXamlNodeVisitor visitor, INode parentNode);
+
public INode Parent { get; set; }
+
public List<string> IgnorablePrefixes { get; set; }
+
+ public bool HasLineInfo()
+ {
+ return LineNumber >= 0 && LinePosition >= 0;
+ }
+
public int LineNumber { get; set; }
- public int LinePosition { get; set; }
- public bool HasLineInfo() => LineNumber >= 0 && LinePosition >= 0;
+ public int LinePosition { get; set; }
- public abstract void Accept(IXamlNodeVisitor visitor, INode parentNode);
public abstract INode Clone();
}
[DebuggerDisplay("{Value}")]
- class ValueNode : BaseNode, IValueNode
+ internal class ValueNode : BaseNode, IValueNode
{
public ValueNode(object value, IXmlNamespaceResolver namespaceResolver, int linenumber = -1, int lineposition = -1)
: base(namespaceResolver, linenumber, lineposition)
@@ -86,15 +101,19 @@ namespace Xamarin.Forms.Xaml
visitor.Visit(this, parentNode);
}
- public override INode Clone() => new ValueNode(Value, NamespaceResolver, LineNumber, LinePosition) {
- IgnorablePrefixes = IgnorablePrefixes
- };
+ public override INode Clone()
+ {
+ return new ValueNode(Value, NamespaceResolver, LineNumber, LinePosition) {
+ IgnorablePrefixes = IgnorablePrefixes
+ };
+ }
}
[DebuggerDisplay("{MarkupString}")]
- class MarkupNode : BaseNode, IValueNode
+ internal class MarkupNode : BaseNode, IValueNode
{
- public MarkupNode(string markupString, IXmlNamespaceResolver namespaceResolver, int linenumber = -1, int lineposition = -1)
+ public MarkupNode(string markupString, IXmlNamespaceResolver namespaceResolver, int linenumber = -1,
+ int lineposition = -1)
: base(namespaceResolver, linenumber, lineposition)
{
MarkupString = markupString;
@@ -107,13 +126,15 @@ namespace Xamarin.Forms.Xaml
visitor.Visit(this, parentNode);
}
- public override INode Clone() => new MarkupNode(MarkupString, NamespaceResolver, LineNumber, LinePosition) {
- IgnorablePrefixes = IgnorablePrefixes
- };
+ public override INode Clone()
+ {
+ return new MarkupNode(MarkupString, NamespaceResolver, LineNumber, LinePosition) {
+ IgnorablePrefixes = IgnorablePrefixes
+ };
+ }
}
- [DebuggerDisplay("{XmlType.Name}")]
- class ElementNode : BaseNode, IValueNode, IElementNode
+ internal class ElementNode : BaseNode, IValueNode, IElementNode
{
public ElementNode(XmlType type, string namespaceURI, IXmlNamespaceResolver namespaceResolver, int linenumber = -1,
int lineposition = -1)
@@ -127,48 +148,48 @@ namespace Xamarin.Forms.Xaml
}
public Dictionary<XmlName, INode> Properties { get; }
+
public List<XmlName> SkipProperties { get; }
+
public List<INode> CollectionItems { get; }
+
public XmlType XmlType { get; }
+
public string NamespaceURI { get; }
+
public INameScope Namescope { get; set; }
public override void Accept(IXamlNodeVisitor visitor, INode parentNode)
{
- if (!SkipVisitNode(visitor, parentNode) && visitor.VisitingMode == TreeVisitingMode.TopDown)
+ if (!visitor.VisitChildrenFirst)
visitor.Visit(this, parentNode);
-
- if (!SkipChildren(visitor, parentNode)) {
+ if ((!visitor.StopOnDataTemplate || !IsDataTemplate(this, parentNode)) &&
+ (!visitor.StopOnResourceDictionary || !IsResourceDictionary(this, parentNode)))
+ {
foreach (var node in Properties.Values.ToList())
node.Accept(visitor, this);
foreach (var node in CollectionItems)
node.Accept(visitor, this);
}
-
- if (!SkipVisitNode(visitor, parentNode) && visitor.VisitingMode == TreeVisitingMode.BottomUp)
+ if (visitor.VisitChildrenFirst)
visitor.Visit(this, parentNode);
-
}
- bool IsDataTemplate(INode parentNode)
+ internal static bool IsDataTemplate(INode node, INode parentNode)
{
var parentElement = parentNode as IElementNode;
INode createContent;
- if (parentElement != null &&
- parentElement.Properties.TryGetValue(XmlName._CreateContent, out createContent) &&
- createContent == this)
+ if (parentElement != null && parentElement.Properties.TryGetValue(XmlName._CreateContent, out createContent) &&
+ createContent == node)
return true;
return false;
}
- bool IsResourceDictionary() => XmlType.Name == "ResourceDictionary";
-
- protected bool SkipChildren(IXamlNodeVisitor visitor, INode parentNode) =>
- (visitor.StopOnDataTemplate && IsDataTemplate(parentNode)) ||
- (visitor.StopOnResourceDictionary && IsResourceDictionary());
-
- protected bool SkipVisitNode(IXamlNodeVisitor visitor, INode parentNode) =>
- !visitor.VisitNodeOnDataTemplate && IsDataTemplate(parentNode);
+ internal static bool IsResourceDictionary(INode node, INode parentNode)
+ {
+ var enode = node as ElementNode;
+ return enode.XmlType.Name == "ResourceDictionary";
+ }
public override INode Clone()
{
@@ -185,7 +206,7 @@ namespace Xamarin.Forms.Xaml
}
}
- abstract class RootNode : ElementNode
+ internal abstract class RootNode : ElementNode
{
protected RootNode(XmlType xmlType, IXmlNamespaceResolver nsResolver) : base(xmlType, xmlType.NamespaceUri, nsResolver)
{
@@ -193,39 +214,40 @@ namespace Xamarin.Forms.Xaml
public override void Accept(IXamlNodeVisitor visitor, INode parentNode)
{
- if (!SkipVisitNode(visitor, parentNode) && visitor.VisitingMode == TreeVisitingMode.TopDown)
+ if (!visitor.VisitChildrenFirst)
visitor.Visit(this, parentNode);
-
- if (!SkipChildren(visitor, parentNode)) {
+ if ((!visitor.StopOnDataTemplate || !IsDataTemplate(this, parentNode)) &&
+ (!visitor.StopOnResourceDictionary || !IsResourceDictionary(this, parentNode)))
+ {
foreach (var node in Properties.Values.ToList())
node.Accept(visitor, this);
foreach (var node in CollectionItems)
node.Accept(visitor, this);
}
-
- if (!SkipVisitNode(visitor, parentNode) && visitor.VisitingMode == TreeVisitingMode.BottomUp)
+ if (visitor.VisitChildrenFirst)
visitor.Visit(this, parentNode);
}
}
- class ListNode : BaseNode, IListNode, IValueNode
+ internal class ListNode : BaseNode, IListNode, IValueNode
{
- public ListNode(IList<INode> nodes, IXmlNamespaceResolver namespaceResolver, int linenumber = -1, int lineposition = -1)
- : base(namespaceResolver, linenumber, lineposition)
+ public ListNode(IList<INode> nodes, IXmlNamespaceResolver namespaceResolver, int linenumber = -1,
+ int lineposition = -1) : base(namespaceResolver, linenumber, lineposition)
{
CollectionItems = nodes.ToList();
}
public XmlName XmlName { get; set; }
+
public List<INode> CollectionItems { get; set; }
public override void Accept(IXamlNodeVisitor visitor, INode parentNode)
{
- if (visitor.VisitingMode == TreeVisitingMode.TopDown)
+ if (!visitor.VisitChildrenFirst)
visitor.Visit(this, parentNode);
foreach (var node in CollectionItems)
node.Accept(visitor, this);
- if (visitor.VisitingMode == TreeVisitingMode.BottomUp)
+ if (visitor.VisitChildrenFirst)
visitor.Visit(this, parentNode);
}
@@ -240,11 +262,12 @@ namespace Xamarin.Forms.Xaml
}
}
- static class INodeExtensions
+ internal static class INodeExtensions
{
public static bool SkipPrefix(this INode node, string prefix)
{
- do {
+ do
+ {
if (node.IgnorablePrefixes != null && node.IgnorablePrefixes.Contains(prefix))
return true;
node = node.Parent;
diff --git a/Xamarin.Forms.Xaml/XamlNodeVisitor.cs b/Xamarin.Forms.Xaml/XamlNodeVisitor.cs
index 874a5fbd..e0b1db32 100644
--- a/Xamarin.Forms.Xaml/XamlNodeVisitor.cs
+++ b/Xamarin.Forms.Xaml/XamlNodeVisitor.cs
@@ -2,11 +2,12 @@
namespace Xamarin.Forms.Xaml
{
- interface IXamlNodeVisitor
+ internal interface IXamlNodeVisitor
{
- TreeVisitingMode VisitingMode { get; }
+ bool VisitChildrenFirst { get; }
+
bool StopOnDataTemplate { get; }
- bool VisitNodeOnDataTemplate { get; }
+
bool StopOnResourceDictionary { get; }
void Visit(ValueNode node, INode parentNode);
@@ -16,27 +17,22 @@ namespace Xamarin.Forms.Xaml
void Visit(ListNode node, INode parentNode);
}
- enum TreeVisitingMode {
- TopDown,
- BottomUp
- }
-
- class XamlNodeVisitor : IXamlNodeVisitor
+ internal class XamlNodeVisitor : IXamlNodeVisitor
{
readonly Action<INode, INode> action;
- public XamlNodeVisitor(Action<INode, INode> action, TreeVisitingMode visitingMode = TreeVisitingMode.TopDown, bool stopOnDataTemplate = false, bool visitNodeOnDataTemplate = true)
+ public XamlNodeVisitor(Action<INode, INode> action, bool visitChildrenFirst = false, bool stopOnDataTemplate = false)
{
this.action = action;
- VisitingMode = visitingMode;
+ VisitChildrenFirst = visitChildrenFirst;
StopOnDataTemplate = stopOnDataTemplate;
- VisitNodeOnDataTemplate = visitNodeOnDataTemplate;
}
- public TreeVisitingMode VisitingMode { get; }
+ public bool VisitChildrenFirst { get; }
+
public bool StopOnDataTemplate { get; }
+
public bool StopOnResourceDictionary { get; private set; }
- public bool VisitNodeOnDataTemplate { get; }
public void Visit(ValueNode node, INode parentNode)
{
diff --git a/Xamarin.Forms.Xaml/XamlParser.cs b/Xamarin.Forms.Xaml/XamlParser.cs
index 456aad6a..e5c49804 100644
--- a/Xamarin.Forms.Xaml/XamlParser.cs
+++ b/Xamarin.Forms.Xaml/XamlParser.cs
@@ -104,11 +104,7 @@ namespace Xamarin.Forms.Xaml
case XmlNodeType.Whitespace:
break;
case XmlNodeType.Text:
- case XmlNodeType.CDATA:
- if (node.CollectionItems.Count == 1 && node.CollectionItems[0] is ValueNode)
- ((ValueNode)node.CollectionItems[0]).Value += reader.Value.Trim();
- else
- node.CollectionItems.Add(new ValueNode(reader.Value.Trim(), (IXmlNamespaceResolver)reader));
+ node.CollectionItems.Add(new ValueNode(reader.Value.Trim(), (IXmlNamespaceResolver)reader));
break;
default:
Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value);
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration.macOSSpecific/TabbedPage.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration.macOSSpecific/TabbedPage.xml
deleted file mode 100644
index 550ca297..00000000
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration.macOSSpecific/TabbedPage.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<Type Name="TabbedPage" FullName="Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage">
- <TypeSignature Language="C#" Value="public static class TabbedPage" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit TabbedPage extends System.Object" />
- <AssemblyInfo>
- <AssemblyName>Xamarin.Forms.Core</AssemblyName>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Base>
- <BaseTypeName>System.Object</BaseTypeName>
- </Base>
- <Interfaces />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- <Members>
- <Member MemberName="GetTabsStyle">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.TabsStyle GetTabsStyle (Xamarin.Forms.BindableObject element);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype Xamarin.Forms.TabsStyle GetTabsStyle(class Xamarin.Forms.BindableObject element) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
- </Parameters>
- <Docs>
- <param name="element">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="GetTabsStyle">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.TabsStyle GetTabsStyle (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype Xamarin.Forms.TabsStyle GetTabsStyle(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="HideTabs">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; HideTabs (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; HideTabs(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="SetShowTabs">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; SetShowTabs (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config, Xamarin.Forms.TabsStyle value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; SetShowTabs(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config, valuetype Xamarin.Forms.TabsStyle value) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- <Parameter Name="value" Type="Xamarin.Forms.TabsStyle" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <param name="value">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="SetTabsStyle">
- <MemberSignature Language="C#" Value="public static void SetTabsStyle (Xamarin.Forms.BindableObject element, Xamarin.Forms.TabsStyle value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetTabsStyle(class Xamarin.Forms.BindableObject element, valuetype Xamarin.Forms.TabsStyle value) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
- <Parameter Name="value" Type="Xamarin.Forms.TabsStyle" />
- </Parameters>
- <Docs>
- <param name="element">To be added.</param>
- <param name="value">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="ShowTabs">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; ShowTabs (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; ShowTabs(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="ShowTabsOnNavigation">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; ShowTabsOnNavigation (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; ShowTabsOnNavigation(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="TabsStyleProperty">
- <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty TabsStyleProperty;" />
- <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty TabsStyleProperty" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- </Members>
-</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration/macOS.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration/macOS.xml
deleted file mode 100644
index 5012c5e8..00000000
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms.PlatformConfiguration/macOS.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<Type Name="macOS" FullName="Xamarin.Forms.PlatformConfiguration.macOS">
- <TypeSignature Language="C#" Value="public sealed class macOS : Xamarin.Forms.IConfigPlatform" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit macOS extends System.Object implements class Xamarin.Forms.IConfigPlatform" />
- <AssemblyInfo>
- <AssemblyName>Xamarin.Forms.Core</AssemblyName>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Base>
- <BaseTypeName>System.Object</BaseTypeName>
- </Base>
- <Interfaces>
- <Interface>
- <InterfaceName>Xamarin.Forms.IConfigPlatform</InterfaceName>
- </Interface>
- </Interfaces>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- <Members>
- <Member MemberName=".ctor">
- <MemberSignature Language="C#" Value="public macOS ();" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
- <MemberType>Constructor</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Parameters />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- </Members>
-</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml
deleted file mode 100644
index c18c73e6..00000000
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Accessibility.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<Type Name="Accessibility" FullName="Xamarin.Forms.Accessibility">
- <TypeSignature Language="C#" Value="public class Accessibility" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Accessibility extends System.Object" />
- <AssemblyInfo>
- <AssemblyName>Xamarin.Forms.Core</AssemblyName>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Base>
- <BaseTypeName>System.Object</BaseTypeName>
- </Base>
- <Interfaces />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- <Members>
- <Member MemberName=".ctor">
- <MemberSignature Language="C#" Value="public Accessibility ();" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
- <MemberType>Constructor</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Parameters />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="HintProperty">
- <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty HintProperty;" />
- <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty HintProperty" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="IsInAccessibleTreeProperty">
- <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty IsInAccessibleTreeProperty;" />
- <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty IsInAccessibleTreeProperty" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="LabeledByProperty">
- <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty LabeledByProperty;" />
- <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty LabeledByProperty" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="NameProperty">
- <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty NameProperty;" />
- <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty NameProperty" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- </Members>
-</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Button.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/Button.xml
index 3df8f8fc..ba243413 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Button.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/Button.xml
@@ -1,6 +1,6 @@
<Type Name="Button" FullName="Xamarin.Forms.Button">
- <TypeSignature Language="C#" Value="public class Button : Xamarin.Forms.View, Xamarin.Forms.IButtonController, Xamarin.Forms.IElementConfiguration&lt;Xamarin.Forms.Button&gt;, Xamarin.Forms.IFontElement" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Button extends Xamarin.Forms.View implements class Xamarin.Forms.IButtonController, class Xamarin.Forms.IElementConfiguration`1&lt;class Xamarin.Forms.Button&gt;, class Xamarin.Forms.IElementController, class Xamarin.Forms.IFontElement, class Xamarin.Forms.IViewController, class Xamarin.Forms.IVisualElementController" />
+ <TypeSignature Language="C#" Value="public class Button : Xamarin.Forms.View, Xamarin.Forms.IButtonController, Xamarin.Forms.IElementConfiguration&lt;Xamarin.Forms.Button&gt;" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Button extends Xamarin.Forms.View implements class Xamarin.Forms.IButtonController, class Xamarin.Forms.IElementConfiguration`1&lt;class Xamarin.Forms.Button&gt;, class Xamarin.Forms.IElementController, class Xamarin.Forms.IViewController, class Xamarin.Forms.IVisualElementController" />
<AssemblyInfo>
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
@@ -21,9 +21,6 @@
<Interface>
<InterfaceName>Xamarin.Forms.IElementConfiguration&lt;Xamarin.Forms.Button&gt;</InterfaceName>
</Interface>
- <Interface>
- <InterfaceName>Xamarin.Forms.IFontElement</InterfaceName>
- </Interface>
</Interfaces>
<Attributes>
<Attribute>
@@ -672,37 +669,6 @@ namespace FormsGallery
<remarks>A Button triggers this by itself. An inheritor only need to call this for properties without BindableProperty as backend store.</remarks>
</Docs>
</Member>
- <Member MemberName="Pressed">
- <MemberSignature Language="C#" Value="public event EventHandler Pressed;" />
- <MemberSignature Language="ILAsm" Value=".event class System.EventHandler Pressed" />
- <MemberType>Event</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.EventHandler</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>Occurs when the Button is pressed.</summary>
- <remarks>
- </remarks>
- </Docs>
- </Member>
- <Member MemberName="Released">
- <MemberSignature Language="C#" Value="public event EventHandler Released;" />
- <MemberSignature Language="ILAsm" Value=".event class System.EventHandler Released" />
- <MemberType>Event</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.EventHandler</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>Occurs when the Button is released.</summary>
- <remarks>The released event always occur before the clicked event.</remarks>
- </Docs>
- </Member>
<Member MemberName="Text">
<MemberSignature Language="C#" Value="public string Text { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Text" />
@@ -811,37 +777,5 @@ namespace FormsGallery
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="Xamarin.Forms.IButtonController.SendPressed">
- <MemberSignature Language="C#" Value="void IButtonController.SendPressed ();" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IButtonController.SendPressed() cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters />
- <Docs>
- <summary>Sends a press event.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.IButtonController.SendReleased">
- <MemberSignature Language="C#" Value="void IButtonController.SendReleased ();" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IButtonController.SendReleased() cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters />
- <Docs>
- <summary>Sends a release event.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
</Members>
</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml
index 37fbad36..16d13483 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml
@@ -159,21 +159,6 @@ Device.BeginInvokeOnMainThread (() => {
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="macOS">
- <MemberSignature Language="C#" Value="public const string macOS;" />
- <MemberSignature Language="ILAsm" Value=".field public static literal string macOS" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.String</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
<Member MemberName="OnPlatform">
<MemberSignature Language="C#" Value="public static void OnPlatform (Action iOS = null, Action Android = null, Action WinPhone = null, Action Default = null);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void OnPlatform(class System.Action iOS, class System.Action Android, class System.Action WinPhone, class System.Action Default) cil managed" />
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/IButtonController.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/IButtonController.xml
index 6e4e1c20..2b66481b 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/IButtonController.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/IButtonController.xml
@@ -31,37 +31,5 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="SendPressed">
- <MemberSignature Language="C#" Value="public void SendPressed ();" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SendPressed() cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="SendReleased">
- <MemberSignature Language="C#" Value="public void SendReleased ();" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SendReleased() cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
</Members>
</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml
deleted file mode 100644
index 1c16a996..00000000
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/IMessagingCenter.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-<Type Name="IMessagingCenter" FullName="Xamarin.Forms.IMessagingCenter">
- <TypeSignature Language="C#" Value="public interface IMessagingCenter" />
- <TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IMessagingCenter" />
- <AssemblyInfo>
- <AssemblyName>Xamarin.Forms.Core</AssemblyName>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Interfaces />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- <Members>
- <Member MemberName="Send&lt;TSender&gt;">
- <MemberSignature Language="C#" Value="public void Send&lt;TSender&gt; (TSender sender, string message) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Send&lt;class TSender&gt;(!!TSender sender, string message) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- </TypeParameters>
- <Parameters>
- <Parameter Name="sender" Type="TSender" />
- <Parameter Name="message" Type="System.String" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <param name="sender">To be added.</param>
- <param name="message">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Send&lt;TSender,TArgs&gt;">
- <MemberSignature Language="C#" Value="public void Send&lt;TSender,TArgs&gt; (TSender sender, string message, TArgs args) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Send&lt;class TSender, TArgs&gt;(!!TSender sender, string message, !!TArgs args) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- <TypeParameter Name="TArgs" />
- </TypeParameters>
- <Parameters>
- <Parameter Name="sender" Type="TSender" />
- <Parameter Name="message" Type="System.String" />
- <Parameter Name="args" Type="TArgs" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <typeparam name="TArgs">To be added.</typeparam>
- <param name="sender">To be added.</param>
- <param name="message">To be added.</param>
- <param name="args">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Subscribe&lt;TSender&gt;">
- <MemberSignature Language="C#" Value="public void Subscribe&lt;TSender&gt; (object subscriber, string message, Action&lt;TSender&gt; callback, TSender source = null) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Subscribe&lt;class TSender&gt;(object subscriber, string message, class System.Action`1&lt;!!TSender&gt; callback, !!TSender source) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- <Parameter Name="callback" Type="System.Action&lt;TSender&gt;" />
- <Parameter Name="source" Type="TSender" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <param name="callback">To be added.</param>
- <param name="source">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Subscribe&lt;TSender,TArgs&gt;">
- <MemberSignature Language="C#" Value="public void Subscribe&lt;TSender,TArgs&gt; (object subscriber, string message, Action&lt;TSender,TArgs&gt; callback, TSender source = null) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Subscribe&lt;class TSender, TArgs&gt;(object subscriber, string message, class System.Action`2&lt;!!TSender, !!TArgs&gt; callback, !!TSender source) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- <TypeParameter Name="TArgs" />
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- <Parameter Name="callback" Type="System.Action&lt;TSender,TArgs&gt;" />
- <Parameter Name="source" Type="TSender" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <typeparam name="TArgs">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <param name="callback">To be added.</param>
- <param name="source">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Unsubscribe&lt;TSender&gt;">
- <MemberSignature Language="C#" Value="public void Unsubscribe&lt;TSender&gt; (object subscriber, string message) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Unsubscribe&lt;class TSender&gt;(object subscriber, string message) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Unsubscribe&lt;TSender,TArgs&gt;">
- <MemberSignature Language="C#" Value="public void Unsubscribe&lt;TSender,TArgs&gt; (object subscriber, string message) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Unsubscribe&lt;class TSender, TArgs&gt;(object subscriber, string message) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- <TypeParameter Name="TArgs" />
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <typeparam name="TArgs">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- </Members>
-</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/INavigationPageController.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/INavigationPageController.xml
index 95aeae7e..b72feb0b 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/INavigationPageController.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/INavigationPageController.xml
@@ -26,42 +26,6 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="Pages">
- <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable&lt;Xamarin.Forms.Page&gt; Pages { get; }" />
- <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1&lt;class Xamarin.Forms.Page&gt; Pages" />
- <MemberType>Property</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Collections.Generic.IEnumerable&lt;Xamarin.Forms.Page&gt;</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <value>To be added.</value>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Peek">
- <MemberSignature Language="C#" Value="public Xamarin.Forms.Page Peek (int depth);" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Xamarin.Forms.Page Peek(int32 depth) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.Page</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="depth" Type="System.Int32" />
- </Parameters>
- <Docs>
- <param name="depth">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
<Member MemberName="PopAsyncInner">
<MemberSignature Language="C#" Value="public System.Threading.Tasks.Task&lt;Xamarin.Forms.Page&gt; PopAsyncInner (bool animated, bool fast = false);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1&lt;class Xamarin.Forms.Page&gt; PopAsyncInner(bool animated, bool fast) cil managed" />
@@ -144,6 +108,22 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="StackCopy">
+ <MemberSignature Language="C#" Value="public System.Collections.Generic.Stack&lt;Xamarin.Forms.Page&gt; StackCopy { get; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.Stack`1&lt;class Xamarin.Forms.Page&gt; StackCopy" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Collections.Generic.Stack&lt;Xamarin.Forms.Page&gt;</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>For internal use by platform renderers.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
<Member MemberName="StackDepth">
<MemberSignature Language="C#" Value="public int StackDepth { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 StackDepth" />
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml
index f87451e2..f21f0116 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/MessagingCenter.xml
@@ -1,6 +1,6 @@
<Type Name="MessagingCenter" FullName="Xamarin.Forms.MessagingCenter">
- <TypeSignature Language="C#" Value="public class MessagingCenter : Xamarin.Forms.IMessagingCenter" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MessagingCenter extends System.Object implements class Xamarin.Forms.IMessagingCenter" />
+ <TypeSignature Language="C#" Value="public static class MessagingCenter" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit MessagingCenter extends System.Object" />
<AssemblyInfo>
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
@@ -14,11 +14,7 @@
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
- <Interfaces>
- <Interface>
- <InterfaceName>Xamarin.Forms.IMessagingCenter</InterfaceName>
- </Interface>
- </Interfaces>
+ <Interfaces />
<Docs>
<summary>Associates a callback on subscribers with a specific message name.</summary>
<remarks>
@@ -44,35 +40,6 @@ Assert.AreEqual(2, subscriber.IntProperty);
</remarks>
</Docs>
<Members>
- <Member MemberName=".ctor">
- <MemberSignature Language="C#" Value="public MessagingCenter ();" />
- <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
- <MemberType>Constructor</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Parameters />
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Instance">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IMessagingCenter Instance { get; }" />
- <MemberSignature Language="ILAsm" Value=".property class Xamarin.Forms.IMessagingCenter Instance" />
- <MemberType>Property</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IMessagingCenter</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <value>To be added.</value>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
<Member MemberName="Send&lt;TSender&gt;">
<MemberSignature Language="C#" Value="public static void Send&lt;TSender&gt; (TSender sender, string message) where TSender : class;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Send&lt;class TSender&gt;(!!TSender sender, string message) cil managed" />
@@ -292,195 +259,5 @@ Assert.AreEqual(2, subscriber.IntProperty);
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="Xamarin.Forms.IMessagingCenter.Send&lt;TSender&gt;">
- <MemberSignature Language="C#" Value="void IMessagingCenter.Send&lt;TSender&gt; (TSender sender, string message) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Send&lt;class TSender&gt;(!!TSender sender, string message) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- </TypeParameters>
- <Parameters>
- <Parameter Name="sender" Type="TSender" />
- <Parameter Name="message" Type="System.String" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <param name="sender">To be added.</param>
- <param name="message">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.IMessagingCenter.Send&lt;TSender,TArgs&gt;">
- <MemberSignature Language="C#" Value="void IMessagingCenter.Send&lt;TSender,TArgs&gt; (TSender sender, string message, TArgs args) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Send&lt;class TSender, TArgs&gt;(!!TSender sender, string message, !!TArgs args) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- <TypeParameter Name="TArgs" />
- </TypeParameters>
- <Parameters>
- <Parameter Name="sender" Type="TSender" />
- <Parameter Name="message" Type="System.String" />
- <Parameter Name="args" Type="TArgs" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <typeparam name="TArgs">To be added.</typeparam>
- <param name="sender">To be added.</param>
- <param name="message">To be added.</param>
- <param name="args">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.IMessagingCenter.Subscribe&lt;TSender&gt;">
- <MemberSignature Language="C#" Value="void IMessagingCenter.Subscribe&lt;TSender&gt; (object subscriber, string message, Action&lt;TSender&gt; callback, TSender source) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Subscribe&lt;class TSender&gt;(object subscriber, string message, class System.Action`1&lt;!!TSender&gt; callback, !!TSender source) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- <Parameter Name="callback" Type="System.Action&lt;TSender&gt;" />
- <Parameter Name="source" Type="TSender" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <param name="callback">To be added.</param>
- <param name="source">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.IMessagingCenter.Subscribe&lt;TSender,TArgs&gt;">
- <MemberSignature Language="C#" Value="void IMessagingCenter.Subscribe&lt;TSender,TArgs&gt; (object subscriber, string message, Action&lt;TSender,TArgs&gt; callback, TSender source) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Subscribe&lt;class TSender, TArgs&gt;(object subscriber, string message, class System.Action`2&lt;!!TSender, !!TArgs&gt; callback, !!TSender source) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- <TypeParameter Name="TArgs" />
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- <Parameter Name="callback" Type="System.Action&lt;TSender,TArgs&gt;" />
- <Parameter Name="source" Type="TSender" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <typeparam name="TArgs">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <param name="callback">To be added.</param>
- <param name="source">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;TSender&gt;">
- <MemberSignature Language="C#" Value="void IMessagingCenter.Unsubscribe&lt;TSender&gt; (object subscriber, string message) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;class TSender&gt;(object subscriber, string message) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;TSender,TArgs&gt;">
- <MemberSignature Language="C#" Value="void IMessagingCenter.Unsubscribe&lt;TSender,TArgs&gt; (object subscriber, string message) where TSender : class;" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void Xamarin.Forms.IMessagingCenter.Unsubscribe&lt;class TSender, TArgs&gt;(object subscriber, string message) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <TypeParameters>
- <TypeParameter Name="TSender">
- <Constraints>
- <ParameterAttribute>ReferenceTypeConstraint</ParameterAttribute>
- </Constraints>
- </TypeParameter>
- <TypeParameter Name="TArgs" />
- </TypeParameters>
- <Parameters>
- <Parameter Name="subscriber" Type="System.Object" />
- <Parameter Name="message" Type="System.String" />
- </Parameters>
- <Docs>
- <typeparam name="TSender">To be added.</typeparam>
- <typeparam name="TArgs">To be added.</typeparam>
- <param name="subscriber">To be added.</param>
- <param name="message">To be added.</param>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
</Members>
</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/NavigationPage.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/NavigationPage.xml
index c2afcedd..77e203f5 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/NavigationPage.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/NavigationPage.xml
@@ -226,42 +226,6 @@
</remarks>
</Docs>
</Member>
- <Member MemberName="RootPage">
- <MemberSignature Language="C#" Value="public Xamarin.Forms.Page RootPage { get; }" />
- <MemberSignature Language="ILAsm" Value=".property instance class Xamarin.Forms.Page RootPage" />
- <MemberType>Property</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.Page</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>
- The <see cref="T:Xamarin.Forms.Page" /> that is the root of the navigation stack.
- </summary>
- <value>To be added.</value>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="RootPageProperty">
- <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty RootPageProperty;" />
- <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty RootPageProperty" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>
- Identifies the <see cref="P:Xamarin.Forms.NavigationPage.RootPage" /> property.
- </summary>
- <remarks>
- </remarks>
- </Docs>
- </Member>
<Member MemberName="GetBackButtonTitle">
<MemberSignature Language="C#" Value="public static string GetBackButtonTitle (Xamarin.Forms.BindableObject page);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string GetBackButtonTitle(class Xamarin.Forms.BindableObject page) cil managed" />
@@ -486,7 +450,7 @@
<AttributeName>System.Diagnostics.DebuggerStepThrough</AttributeName>
</Attribute>
<Attribute>
- <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;PopAsync&gt;d__39))</AttributeName>
+ <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;PopAsync&gt;d__38))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
@@ -584,7 +548,7 @@
<AttributeName>System.Diagnostics.DebuggerStepThrough</AttributeName>
</Attribute>
<Attribute>
- <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;PopToRootAsync&gt;d__47))</AttributeName>
+ <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;PopToRootAsync&gt;d__46))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
@@ -641,7 +605,7 @@
<AttributeName>System.Diagnostics.DebuggerStepThrough</AttributeName>
</Attribute>
<Attribute>
- <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;PushAsync&gt;d__49))</AttributeName>
+ <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;PushAsync&gt;d__48))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
@@ -880,42 +844,6 @@ public class MyPage : NavigationPage
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="Xamarin.Forms.INavigationPageController.Pages">
- <MemberSignature Language="C#" Value="System.Collections.Generic.IEnumerable&lt;Xamarin.Forms.Page&gt; Xamarin.Forms.INavigationPageController.Pages { get; }" />
- <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IEnumerable`1&lt;class Xamarin.Forms.Page&gt; Xamarin.Forms.INavigationPageController.Pages" />
- <MemberType>Property</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Collections.Generic.IEnumerable&lt;Xamarin.Forms.Page&gt;</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- <value>To be added.</value>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="Xamarin.Forms.INavigationPageController.Peek">
- <MemberSignature Language="C#" Value="Xamarin.Forms.Page INavigationPageController.Peek (int depth);" />
- <MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class Xamarin.Forms.Page Xamarin.Forms.INavigationPageController.Peek(int32 depth) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.Page</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="depth" Type="System.Int32" />
- </Parameters>
- <Docs>
- <param name="depth">To be added.</param>
- <summary>To be added.</summary>
- <returns>To be added.</returns>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
<Member MemberName="Xamarin.Forms.INavigationPageController.PopAsyncInner">
<MemberSignature Language="C#" Value="System.Threading.Tasks.Task&lt;Xamarin.Forms.Page&gt; INavigationPageController.PopAsyncInner (bool animated, bool fast);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Threading.Tasks.Task`1&lt;class Xamarin.Forms.Page&gt; Xamarin.Forms.INavigationPageController.PopAsyncInner(bool animated, bool fast) cil managed" />
@@ -928,7 +856,7 @@ public class MyPage : NavigationPage
<AttributeName>System.Diagnostics.DebuggerStepThrough</AttributeName>
</Attribute>
<Attribute>
- <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;Xamarin-Forms-INavigationPageController-PopAsyncInner&gt;d__64))</AttributeName>
+ <AttributeName>System.Runtime.CompilerServices.AsyncStateMachine(typeof(Xamarin.Forms.NavigationPage/&lt;Xamarin-Forms-INavigationPageController-PopAsyncInner&gt;d__63))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
@@ -946,6 +874,22 @@ public class MyPage : NavigationPage
<remarks>To be added.</remarks>
</Docs>
</Member>
+ <Member MemberName="Xamarin.Forms.INavigationPageController.StackCopy">
+ <MemberSignature Language="C#" Value="System.Collections.Generic.Stack&lt;Xamarin.Forms.Page&gt; Xamarin.Forms.INavigationPageController.StackCopy { get; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.Stack`1&lt;class Xamarin.Forms.Page&gt; Xamarin.Forms.INavigationPageController.StackCopy" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Collections.Generic.Stack&lt;Xamarin.Forms.Page&gt;</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>Internal</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
<Member MemberName="Xamarin.Forms.INavigationPageController.StackDepth">
<MemberSignature Language="C#" Value="int Xamarin.Forms.INavigationPageController.StackDepth { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Xamarin.Forms.INavigationPageController.StackDepth" />
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/OnIdiom`1.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/OnIdiom`1.xml
index 6e6b3727..aed2ddc2 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/OnIdiom`1.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/OnIdiom`1.xml
@@ -139,22 +139,5 @@
</remarks>
</Docs>
</Member>
- <Member MemberName="TV">
- <MemberSignature Language="C#" Value="public T TV { get; set; }" />
- <MemberSignature Language="ILAsm" Value=".property instance !T TV" />
- <MemberType>Property</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>T</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>Gets or sets the value applied on TV-like devices.</summary>
- <value>A T.</value>
- <remarks>
- </remarks>
- </Docs>
- </Member>
</Members>
</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/RelativeLayout.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/RelativeLayout.xml
index 6a8c498b..8d1082e9 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/RelativeLayout.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/RelativeLayout.xml
@@ -446,90 +446,6 @@ public class RelativeLayoutExample : ContentPage
<remarks>To be added.</remarks>
</Docs>
</Member>
- <Member MemberName="SetHeightConstraint">
- <MemberSignature Language="C#" Value="public static void SetHeightConstraint (Xamarin.Forms.BindableObject bindable, Xamarin.Forms.Constraint value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetHeightConstraint(class Xamarin.Forms.BindableObject bindable, class Xamarin.Forms.Constraint value) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="bindable" Type="Xamarin.Forms.BindableObject" />
- <Parameter Name="value" Type="Xamarin.Forms.Constraint" />
- </Parameters>
- <Docs>
- <param name="bindable">The <see cref="T:Xamarin.Forms.BindableObject" /> to which the constraint will be applied.</param>
- <param name="value">The <see cref="T:Xamarin.Forms.Constraint" /> on the height of the <paramref name="bindable" />.</param>
- <summary>Sets <paramref name="value" /> as a constraint on the height of the <paramref name="bindable" />.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="SetWidthConstraint">
- <MemberSignature Language="C#" Value="public static void SetWidthConstraint (Xamarin.Forms.BindableObject bindable, Xamarin.Forms.Constraint value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetWidthConstraint(class Xamarin.Forms.BindableObject bindable, class Xamarin.Forms.Constraint value) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="bindable" Type="Xamarin.Forms.BindableObject" />
- <Parameter Name="value" Type="Xamarin.Forms.Constraint" />
- </Parameters>
- <Docs>
- <param name="bindable">The <see cref="T:Xamarin.Forms.BindableObject" /> to which the constraint will be applied.</param>
- <param name="value">The <see cref="T:Xamarin.Forms.Constraint" /> on the width of the <paramref name="bindable" />.</param>
- <summary>Sets <paramref name="value" /> as a constraint on the width of the <paramref name="bindable" />.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="SetXConstraint">
- <MemberSignature Language="C#" Value="public static void SetXConstraint (Xamarin.Forms.BindableObject bindable, Xamarin.Forms.Constraint value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetXConstraint(class Xamarin.Forms.BindableObject bindable, class Xamarin.Forms.Constraint value) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="bindable" Type="Xamarin.Forms.BindableObject" />
- <Parameter Name="value" Type="Xamarin.Forms.Constraint" />
- </Parameters>
- <Docs>
- <param name="bindable">The <see cref="T:Xamarin.Forms.BindableObject" /> to which the constraint will be applied.</param>
- <param name="value">The <see cref="T:Xamarin.Forms.Constraint" /> on the X position of the <paramref name="bindable" />.</param>
- <summary>Sets <paramref name="value" /> as a constraint on the X position of the <paramref name="bindable" />.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
- <Member MemberName="SetYConstraint">
- <MemberSignature Language="C#" Value="public static void SetYConstraint (Xamarin.Forms.BindableObject bindable, Xamarin.Forms.Constraint value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetYConstraint(class Xamarin.Forms.BindableObject bindable, class Xamarin.Forms.Constraint value) cil managed" />
- <MemberType>Method</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>System.Void</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="bindable" Type="Xamarin.Forms.BindableObject" />
- <Parameter Name="value" Type="Xamarin.Forms.Constraint" />
- </Parameters>
- <Docs>
- <param name="bindable">The <see cref="T:Xamarin.Forms.BindableObject" /> to which the constraint will be applied.</param>
- <param name="value">The <see cref="T:Xamarin.Forms.Constraint" /> on the Y position of the <paramref name="bindable" />.</param>
- <summary>Sets <paramref name="value" /> as a constraint on the Y position of the <paramref name="bindable" />.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- </Member>
<Member MemberName="WidthConstraintProperty">
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty WidthConstraintProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty WidthConstraintProperty" />
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/TabsStyle.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/TabsStyle.xml
deleted file mode 100644
index 7565a1f1..00000000
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/TabsStyle.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<Type Name="TabsStyle" FullName="Xamarin.Forms.TabsStyle">
- <TypeSignature Language="C#" Value="public enum TabsStyle" />
- <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed TabsStyle extends System.Enum" />
- <AssemblyInfo>
- <AssemblyName>Xamarin.Forms.Core</AssemblyName>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Base>
- <BaseTypeName>System.Enum</BaseTypeName>
- </Base>
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
- <Members>
- <Member MemberName="Default">
- <MemberSignature Language="C#" Value="Default" />
- <MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TabsStyle Default = int32(0)" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- </Docs>
- </Member>
- <Member MemberName="Hidden">
- <MemberSignature Language="C#" Value="Hidden" />
- <MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TabsStyle Hidden = int32(1)" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- </Docs>
- </Member>
- <Member MemberName="Icons">
- <MemberSignature Language="C#" Value="Icons" />
- <MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TabsStyle Icons = int32(2)" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- </Docs>
- </Member>
- <Member MemberName="OnBottom">
- <MemberSignature Language="C#" Value="OnBottom" />
- <MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TabsStyle OnBottom = int32(4)" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- </Docs>
- </Member>
- <Member MemberName="OnNavigation">
- <MemberSignature Language="C#" Value="OnNavigation" />
- <MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TabsStyle OnNavigation = int32(3)" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>To be added.</summary>
- </Docs>
- </Member>
- </Members>
-</Type>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/TargetIdiom.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/TargetIdiom.xml
index 33c5ed16..1541f7a9 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/TargetIdiom.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/TargetIdiom.xml
@@ -80,20 +80,6 @@
<summary>Indicates that the width of the iPad, Windows 8.1, or Android device on which Forms is running is wider than 600 dips.</summary>
</Docs>
</Member>
- <Member MemberName="TV">
- <MemberSignature Language="C#" Value="TV" />
- <MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TargetIdiom TV = int32(4)" />
- <MemberType>Field</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>2.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TargetIdiom</ReturnType>
- </ReturnValue>
- <Docs>
- <summary>Indicates that Forms is running on a Tizen app on Tizen TV.</summary>
- </Docs>
- </Member>
<Member MemberName="Unsupported">
<MemberSignature Language="C#" Value="Unsupported" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Forms.TargetIdiom Unsupported = int32(0)" />
diff --git a/docs/Xamarin.Forms.Core/index.xml b/docs/Xamarin.Forms.Core/index.xml
index 89af75c2..1b6cb745 100644
--- a/docs/Xamarin.Forms.Core/index.xml
+++ b/docs/Xamarin.Forms.Core/index.xml
@@ -108,9 +108,6 @@
<AttributeName>System.Runtime.CompilerServices.InternalsVisibleTo("Xamarin.Forms.Core.Windows.UITests")</AttributeName>
</Attribute>
<Attribute>
- <AttributeName>System.Runtime.CompilerServices.InternalsVisibleTo("Xamarin.Forms.Core.macOS.UITests")</AttributeName>
- </Attribute>
- <Attribute>
<AttributeName>System.Runtime.CompilerServices.InternalsVisibleTo("Xamarin.Forms.iOS.UITests")</AttributeName>
</Attribute>
<Attribute>
@@ -399,7 +396,6 @@
<Type Name="TableSectionBase" Kind="Class" />
<Type Name="TableSectionBase`1" DisplayName="TableSectionBase&lt;T&gt;" Kind="Class" />
<Type Name="TableView" Kind="Class" />
- <Type Name="TabsStyle" Kind="Enumeration" />
<Type Name="TapGestureRecognizer" Kind="Class" />
<Type Name="TappedEventArgs" Kind="Class" />
<Type Name="TargetIdiom" Kind="Enumeration" />
@@ -465,7 +461,6 @@
<Namespace Name="Xamarin.Forms.PlatformConfiguration">
<Type Name="Android" Kind="Class" />
<Type Name="iOS" Kind="Class" />
- <Type Name="macOS" Kind="Class" />
<Type Name="Tizen" Kind="Class" />
<Type Name="Windows" Kind="Class" />
</Namespace>
@@ -484,9 +479,6 @@
<Type Name="StatusBarTextColorMode" Kind="Enumeration" />
<Type Name="VisualElement" Kind="Class" />
</Namespace>
- <Namespace Name="Xamarin.Forms.PlatformConfiguration.macOSSpecific">
- <Type Name="TabbedPage" Kind="Class" />
- </Namespace>
<Namespace Name="Xamarin.Forms.PlatformConfiguration.WindowsSpecific">
<Type Name="CollapseStyle" Kind="Enumeration" />
<Type Name="MasterDetailPage" Kind="Class" />
@@ -1635,113 +1627,6 @@
<Targets>
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
</Targets>
- <Member MemberName="GetTabsStyle">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.TabsStyle GetTabsStyle (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype Xamarin.Forms.TabsStyle GetTabsStyle(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>ExtensionMethod</MemberType>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.TabsStyle</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- </Docs>
- <Link Type="Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage" Member="M:Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage.GetTabsStyle(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage})" />
- </Member>
- </ExtensionMethod>
- <ExtensionMethod>
- <Targets>
- <Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
- </Targets>
- <Member MemberName="HideTabs">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; HideTabs (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; HideTabs(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>ExtensionMethod</MemberType>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- </Docs>
- <Link Type="Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage" Member="M:Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage.HideTabs(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage})" />
- </Member>
- </ExtensionMethod>
- <ExtensionMethod>
- <Targets>
- <Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
- </Targets>
- <Member MemberName="SetShowTabs">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; SetShowTabs (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config, Xamarin.Forms.TabsStyle value);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; SetShowTabs(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config, valuetype Xamarin.Forms.TabsStyle value) cil managed" />
- <MemberType>ExtensionMethod</MemberType>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- <Parameter Name="value" Type="Xamarin.Forms.TabsStyle" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <param name="value">To be added.</param>
- <summary>To be added.</summary>
- </Docs>
- <Link Type="Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage" Member="M:Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage.SetShowTabs(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage},Xamarin.Forms.TabsStyle)" />
- </Member>
- </ExtensionMethod>
- <ExtensionMethod>
- <Targets>
- <Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
- </Targets>
- <Member MemberName="ShowTabs">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; ShowTabs (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; ShowTabs(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>ExtensionMethod</MemberType>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- </Docs>
- <Link Type="Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage" Member="M:Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage.ShowTabs(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage})" />
- </Member>
- </ExtensionMethod>
- <ExtensionMethod>
- <Targets>
- <Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
- </Targets>
- <Member MemberName="ShowTabsOnNavigation">
- <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; ShowTabsOnNavigation (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt; config);" />
- <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; ShowTabsOnNavigation(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.macOS, class Xamarin.Forms.TabbedPage&gt; config) cil managed" />
- <MemberType>ExtensionMethod</MemberType>
- <ReturnValue>
- <ReturnType>Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;</ReturnType>
- </ReturnValue>
- <Parameters>
- <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage&gt;" RefType="this" />
- </Parameters>
- <Docs>
- <param name="config">To be added.</param>
- <summary>To be added.</summary>
- </Docs>
- <Link Type="Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage" Member="M:Xamarin.Forms.PlatformConfiguration.macOSSpecific.TabbedPage.ShowTabsOnNavigation(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.macOS,Xamarin.Forms.TabbedPage})" />
- </Member>
- </ExtensionMethod>
- <ExtensionMethod>
- <Targets>
- <Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
- </Targets>
<Member MemberName="CollapsedPaneWidth">
<MemberSignature Language="C#" Value="public static double CollapsedPaneWidth (this Xamarin.Forms.IPlatformElementConfiguration&lt;Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.MasterDetailPage&gt; config);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig float64 CollapsedPaneWidth(class Xamarin.Forms.IPlatformElementConfiguration`2&lt;class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.MasterDetailPage&gt; config) cil managed" />
diff --git a/docs/Xamarin.Forms.Core/ns-Xamarin.Forms.PlatformConfiguration.macOSSpecific.xml b/docs/Xamarin.Forms.Core/ns-Xamarin.Forms.PlatformConfiguration.macOSSpecific.xml
deleted file mode 100644
index 644ef854..00000000
--- a/docs/Xamarin.Forms.Core/ns-Xamarin.Forms.PlatformConfiguration.macOSSpecific.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<Namespace Name="Xamarin.Forms.PlatformConfiguration.macOSSpecific">
- <Docs>
- <summary>To be added.</summary>
- <remarks>To be added.</remarks>
- </Docs>
-</Namespace>
diff --git a/docs/Xamarin.Forms.Maps/index.xml b/docs/Xamarin.Forms.Maps/index.xml
index 775e9db2..c8db2882 100644
--- a/docs/Xamarin.Forms.Maps/index.xml
+++ b/docs/Xamarin.Forms.Maps/index.xml
@@ -33,7 +33,7 @@
<AttributeName>System.Resources.NeutralResourcesLanguage("en")</AttributeName>
</Attribute>
<Attribute>
- <AttributeName>System.Runtime.CompilerServices.InternalsVisibleTo("Xamarin.Forms.Maps.macOS")</AttributeName>
+ <AttributeName>System.Runtime.CompilerServices.CompilationRelaxations(8)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.InternalsVisibleTo("Xamarin.Forms.Maps.iOS")</AttributeName>
diff --git a/verify-nuspecs.ps1 b/verify-nuspecs.ps1
new file mode 100644
index 00000000..0559cfe5
--- /dev/null
+++ b/verify-nuspecs.ps1
@@ -0,0 +1,130 @@
+[CmdletBinding()]
+param ( )
+
+# Namespace for msbuild csproj files
+$namespace = @{msb="http://schemas.microsoft.com/developer/msbuild/2003"}
+
+# The various Windows projects and their nuspec targets
+$projectTargets = @{
+ "Xamarin.Forms.Platform.WinRT.Phone" = @("lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone");
+ "Xamarin.Forms.Platform.WinRT" = @("lib\wpa81\Xamarin.Forms.Platform.WinRT", "lib\win81\Xamarin.Forms.Platform.WinRT");
+ "Xamarin.Forms.Platform.WinRT.Tablet" = @("lib\win81\Xamarin.Forms.Platform.WinRT.Tablet");
+ "Xamarin.Forms.Platform.UAP" = @("lib\uap10.0\Xamarin.Forms.Platform.UAP");
+}
+
+# Iterate over the Windows projects, load their csproj files,
+# and build a hashtable of the required .xbf files and their targets
+
+$projectNames = @()
+$projectTargets.Keys | % {
+ $projectNames += $_
+}
+
+$requirements = @{}
+
+$projectNames | % {
+
+ $name = $_
+
+ # Find the csproj file
+ $csproj = (Get-ChildItem -r ($_ + '.csproj')).FullName
+
+ # Load it up
+ [xml]$proj = Get-Content $csproj
+
+ # Check for XAML files as part of control with codebehind files
+ $dependentUpon = Select-Xml -Xml $proj -XPath "//msb:Compile/msb:DependentUpon" -Namespace $namespace | Select-Object -ExpandProperty Node
+ $dependentUpon | % {
+ $filename = $_.InnerText
+
+ Write-Verbose "Found $filename for project $name";
+
+ # Build the .xbf source file name that should be in the nuspec
+ $xbf = (Split-Path $filename -leaf).Replace(".xaml", ".xbf")
+ $xbf = "..\$name\bin\`$Configuration`$\$xbf"
+
+ # Add this .xbf to our requirements
+ $requirements[$xbf] = $projectTargets[$name]
+ }
+
+ # Check for XAML files included as Pages (Resources files, styles, etc.)
+ $pageInclude = Select-Xml -Xml $proj -XPath "//msb:Page" -Namespace $namespace | Select-Object -ExpandProperty Node
+ $pageInclude | % {
+
+ Write-Verbose "Found $($_.Include) for project $name";
+
+ # Build the .xbf source file name that should be in the nuspec
+ $xbf = (Split-Path $_.Include -leaf).Replace(".xaml", ".xbf")
+ $xbf = "..\$name\bin\`$Configuration`$\$xbf"
+
+ # Add this .xbf to our requirements
+ $requirements[$xbf] = $projectTargets[$name]
+ }
+}
+
+
+# load up the nuspec file
+[xml]$nuspec = Get-Content .\.nuspec\Xamarin.Forms.nuspec
+
+# Keep track of which requirements aren't being met so we can display that in the build output
+$failedRequirements = @()
+
+# Also keep track of extra XBF entries which aren't required so we can display that in the build output
+$extraEntries = @()
+
+# Find all the xbf files listed in the nuspec
+$nuspecFiles = $nuspec.package.files.file | ? { $_.src.EndsWith(".xbf") }
+
+# Iterate over the requirements and track each one that isn't met
+Write-Verbose "Verifying that required XAML file has a corresponding XBF in nuspec..."
+$requirements.Keys | % {
+ $xbf = $_
+
+ $requirements[$_] | % {
+ $target = $_
+
+ Write-Verbose "Checking for nuspec entry file = $xbf with target $target"
+
+ $entries = $nuspecFiles | ? {
+ ($_.src -eq $xbf) -and ($_.target -eq $target)
+ }
+
+ if(!$entries) {
+ $failedRequirements += "Missing nuspec entry for $xbf with target $target"
+ }
+ }
+}
+
+# Iterate over the xbf entries and track each one that isn't a requirement
+Write-Verbose "Verifying that each XBF entry in nuspec has an actual XAML file..."
+$nuspecFiles | % {
+ $entry = $_
+
+ Write-Verbose "Checking entry with src = $($entry.src) and target = $($entry.target)"
+
+ $srcMatch = $requirements.Keys | ? { $_ -eq $entry.src }
+
+ if($srcMatch) {
+ $requirements[$entry.src] | % { Write-Verbose $_ }
+ $targetMatch = $requirements[$entry.src] | ? { $_ -eq $entry.target }
+ if(-not $targetMatch) {
+ $extraEntries += "XBF entry $($entry.src) doesn't have a corresponding XAML file"
+ }
+ } else {
+ $extraEntries += "XBF entry $($entry.src) doesn't have a corresponding XAML file"
+ }
+}
+
+
+# Emit the failed requirements and extra entries so they show up in build ouput
+$failedRequirements
+$extraEntries
+
+if($failedRequirements -or $extraEntries) {
+ # D'oh!
+ exit 13
+} else {
+ # Woohoo!
+ exit 0
+}
+