maui-linux/Xamarin.Forms.Core/TabbedPage.cs

67 строки
2.2 KiB
C#
Исходник Обычный вид История

Platform Specifics (#301) * Playing around with how the platform specifics interfaces etc. might work * Sample implementation of iOS navigation translucency * Very slightly reduced code * Better vendor stuff * Drop single-implemenation interfaces * Generics on NavigationPage * On-demand vendor stuff * Remove functionally duplicate classes and make ControlGallery work again * Namespace all the things. XAML test. * Can use Effect to attach platform specific * Attach Effect on PropertyChanging for XAML support! * Rename IConfigPlatform interfaces for readability * Some renaming to match the documents * Split class files * Clear out test-only code * Re-namespace * Added On method to rendered Elements * Allow for removal of platform suffix, convenience methods on specific platforms * Creating a gallery page for specifics * Add rudimentary Platform Specifics gallery; make CollapseStyle work on UWP; Add CollapsedPaneWidth specific property * Toolbar now working with both collapse styles * MDP now displaying Content title; toolbar routing around title * Add a gallery for the iOS NavigationPage stuff * Add Navigation Page as detail page to verify it works with new Toolbar options * Make titlebar/toolbar background colors consistent * ToolbarPlacement now working on NavigationPage * Toolbar Placement working for tabbed and nav pages * Fix bug where phone doesn't get default toolbar placement on start * [Core] Add PS WindowSoftInputModeAdjust [Core] Make Application extendable * Toolbar placement now working on Nav, Tabbed, and Master pages on desktop/phone Remove unnecessary style indirection Fix build errors * [A] Add PlatformConfigurationExtensions * SetSoftInputMode test page * [A] SetSoftInputMode Known issue: Status bar color does not work in AdjustResize mode * [Core] Add PS Blur * [iOS] Configure renderer for blur * Add test page * Move to blur VisualElement for broader support * Move test pages to gallery * Update docs * Use lazy initializer for PlatformConfigurationRegistry
2016-08-30 20:46:14 +03:00
using System;
2016-03-22 23:02:25 +03:00
using Xamarin.Forms.Platform;
namespace Xamarin.Forms
{
[RenderWith(typeof(_TabbedPageRenderer))]
public class TabbedPage : MultiPage<Page>, IBarElement, IElementConfiguration<TabbedPage>
2016-03-22 23:02:25 +03:00
{
public static readonly BindableProperty BarBackgroundColorProperty = BarElement.BarBackgroundColorProperty;
[Enhancement] Brushes (#9220) * Added brushes to Core, Core Gallery and the iOS implementation * Implemented brushes on UWP * Improved UWP brushes implementation * Changes to improve the brushes Core Gallery samples * Added default SolidColorBrush colors * Improved brushes samples adding more options * Implement brushes on Android * Fixed Brush Background on Android ImageButton * Initial code to add support to brushes using CSS * Support more CSS gradient options Added more unit tests * Changes in Core Gallery brushes samples * Reuse same ColorTypeConverter in the GradientBrushParser * Fixed brush issues on specific controles (Android: Page) (iOS: Label, ImageButton, NavBar) * Updated brushes unit tests * Added new sample in Core Gallery Fixed angle issue in UWP LinearGradientBrush * Fixed UWP issue updating brushes in Buttons * Improved UWP UpdateBackground logic in VisualElementRenderer * Fixed UWP build errors Fixed some UWP brushes issues * Added WPF implementation * Fixed issue verifying brushes in iOS VisualElementRenderer * Fixed iOS brushes in BoxView * Added scroll to LinearGradientPointsGallery sample * Fixed iOS brushes size issue * Implemented brushes in macOS * Uncommented wrong method to update image brushes resizing the App Window * Fixed Windows Build * Fixed broken unit tests * Added more comments in UWP RadialGradientBrush * Added BrushExperimental flag * Notify VisualElement Background changes if some Brush property have changed * Fixed brush issue in Android Button using CornerRadius * Fixed unnecessary border color issue applying brushes to Layouts in Android * Fixed brushes unit tests * Removed EditorBrowsable label in BackgroundColor until deprecate it * - fix whitespace * Changed IsEmpty Brush property to be abstract and implemented it in every brush. * Changed IGradientShader to GradientShader * Fixed BindableBrushGallery issue on iOS/macOS * Fixed wrong iOS right RadialGradientBrush * Fixed Brush in iOS NavBar iOS < 13 * Fixed iOS Brush on Button and Label * Fixed Build errors * Replace UWP Community Toolkit RadialGradientBrush class by WinUI 2.4 RadialGradientBrush * Fixed broken unit test * Fixed brushes issues on macOS resizing the Window or on iOS rotation, etc. * Added the option to choose the BorderColor in the Brushes Playground * Removed duplicated ShapeRenderer Compile line in Platform iOS csproj * Removed unnecessary changes * Added Visual Brush samples * Implemented Brushes in iOS Visual Renderers * Only show the access to the Brushes Visual sample in Android and iOS * Added brushes support to shapes * Fixed Build error * Removed unnecessary changes * Added Brushes support to Android Material ActivityIndicator * Added brushes support to Android Visual Frame * Updated Visual Android Renderers * Fixed BoxView Brush issue * Updated brush views sample to add more BoxView cases * Added brushes tests classes * More Brushes unit tests * Added more controls to test in the BrushesViewGallery * Added new Brushes sample * Fixed build error * Updated AnimateShapeGallery to use a Brush * Fixed CoreGallery Core samples allowing to use the Background property * Added Brushes platform unit tests * - apply background color if solid brush is empty * - fix visual checkbox * Fixed the build * Fixed issue on Shapes * Updated MaterialButtonRenderer to use IsOneOf with several properties * Removed unnecesary change in UWP Styles * Use IsOneOf in UWP BackgroundTracker * Added IsNullOrEmpty Brush method * Removed unnecessary brush updates * Added more constructors to LinearGradientBrush and RadialGradientBrush * Fixed UWP NavBar BarBackgroundColor issue * Removed unnecessary line in UWP BoxViewRenderer * Fixed NRE in iOS ButtonRenderer * Updated iOS Button SetBackground logic * Implemented Shell FlyoutBackground Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
2020-07-17 17:44:13 +03:00
public static readonly BindableProperty BarBackgroundProperty = BarElement.BarBackgroundProperty;
public static readonly BindableProperty BarTextColorProperty = BarElement.BarTextColorProperty;
public static readonly BindableProperty UnselectedTabColorProperty = BindableProperty.Create(nameof(UnselectedTabColor), typeof(Color), typeof(TabbedPage), default(Color));
public static readonly BindableProperty SelectedTabColorProperty = BindableProperty.Create(nameof(SelectedTabColor), typeof(Color), typeof(TabbedPage), default(Color));
Platform Specifics (#301) * Playing around with how the platform specifics interfaces etc. might work * Sample implementation of iOS navigation translucency * Very slightly reduced code * Better vendor stuff * Drop single-implemenation interfaces * Generics on NavigationPage * On-demand vendor stuff * Remove functionally duplicate classes and make ControlGallery work again * Namespace all the things. XAML test. * Can use Effect to attach platform specific * Attach Effect on PropertyChanging for XAML support! * Rename IConfigPlatform interfaces for readability * Some renaming to match the documents * Split class files * Clear out test-only code * Re-namespace * Added On method to rendered Elements * Allow for removal of platform suffix, convenience methods on specific platforms * Creating a gallery page for specifics * Add rudimentary Platform Specifics gallery; make CollapseStyle work on UWP; Add CollapsedPaneWidth specific property * Toolbar now working with both collapse styles * MDP now displaying Content title; toolbar routing around title * Add a gallery for the iOS NavigationPage stuff * Add Navigation Page as detail page to verify it works with new Toolbar options * Make titlebar/toolbar background colors consistent * ToolbarPlacement now working on NavigationPage * Toolbar Placement working for tabbed and nav pages * Fix bug where phone doesn't get default toolbar placement on start * [Core] Add PS WindowSoftInputModeAdjust [Core] Make Application extendable * Toolbar placement now working on Nav, Tabbed, and Master pages on desktop/phone Remove unnecessary style indirection Fix build errors * [A] Add PlatformConfigurationExtensions * SetSoftInputMode test page * [A] SetSoftInputMode Known issue: Status bar color does not work in AdjustResize mode * [Core] Add PS Blur * [iOS] Configure renderer for blur * Add test page * Move to blur VisualElement for broader support * Move test pages to gallery * Update docs * Use lazy initializer for PlatformConfigurationRegistry
2016-08-30 20:46:14 +03:00
readonly Lazy<PlatformConfigurationRegistry<TabbedPage>> _platformConfigurationRegistry;
public Color BarBackgroundColor {
get => (Color)GetValue(BarElement.BarBackgroundColorProperty);
set => SetValue(BarElement.BarBackgroundColorProperty, value);
}
[Enhancement] Brushes (#9220) * Added brushes to Core, Core Gallery and the iOS implementation * Implemented brushes on UWP * Improved UWP brushes implementation * Changes to improve the brushes Core Gallery samples * Added default SolidColorBrush colors * Improved brushes samples adding more options * Implement brushes on Android * Fixed Brush Background on Android ImageButton * Initial code to add support to brushes using CSS * Support more CSS gradient options Added more unit tests * Changes in Core Gallery brushes samples * Reuse same ColorTypeConverter in the GradientBrushParser * Fixed brush issues on specific controles (Android: Page) (iOS: Label, ImageButton, NavBar) * Updated brushes unit tests * Added new sample in Core Gallery Fixed angle issue in UWP LinearGradientBrush * Fixed UWP issue updating brushes in Buttons * Improved UWP UpdateBackground logic in VisualElementRenderer * Fixed UWP build errors Fixed some UWP brushes issues * Added WPF implementation * Fixed issue verifying brushes in iOS VisualElementRenderer * Fixed iOS brushes in BoxView * Added scroll to LinearGradientPointsGallery sample * Fixed iOS brushes size issue * Implemented brushes in macOS * Uncommented wrong method to update image brushes resizing the App Window * Fixed Windows Build * Fixed broken unit tests * Added more comments in UWP RadialGradientBrush * Added BrushExperimental flag * Notify VisualElement Background changes if some Brush property have changed * Fixed brush issue in Android Button using CornerRadius * Fixed unnecessary border color issue applying brushes to Layouts in Android * Fixed brushes unit tests * Removed EditorBrowsable label in BackgroundColor until deprecate it * - fix whitespace * Changed IsEmpty Brush property to be abstract and implemented it in every brush. * Changed IGradientShader to GradientShader * Fixed BindableBrushGallery issue on iOS/macOS * Fixed wrong iOS right RadialGradientBrush * Fixed Brush in iOS NavBar iOS < 13 * Fixed iOS Brush on Button and Label * Fixed Build errors * Replace UWP Community Toolkit RadialGradientBrush class by WinUI 2.4 RadialGradientBrush * Fixed broken unit test * Fixed brushes issues on macOS resizing the Window or on iOS rotation, etc. * Added the option to choose the BorderColor in the Brushes Playground * Removed duplicated ShapeRenderer Compile line in Platform iOS csproj * Removed unnecessary changes * Added Visual Brush samples * Implemented Brushes in iOS Visual Renderers * Only show the access to the Brushes Visual sample in Android and iOS * Added brushes support to shapes * Fixed Build error * Removed unnecessary changes * Added Brushes support to Android Material ActivityIndicator * Added brushes support to Android Visual Frame * Updated Visual Android Renderers * Fixed BoxView Brush issue * Updated brush views sample to add more BoxView cases * Added brushes tests classes * More Brushes unit tests * Added more controls to test in the BrushesViewGallery * Added new Brushes sample * Fixed build error * Updated AnimateShapeGallery to use a Brush * Fixed CoreGallery Core samples allowing to use the Background property * Added Brushes platform unit tests * - apply background color if solid brush is empty * - fix visual checkbox * Fixed the build * Fixed issue on Shapes * Updated MaterialButtonRenderer to use IsOneOf with several properties * Removed unnecesary change in UWP Styles * Use IsOneOf in UWP BackgroundTracker * Added IsNullOrEmpty Brush method * Removed unnecessary brush updates * Added more constructors to LinearGradientBrush and RadialGradientBrush * Fixed UWP NavBar BarBackgroundColor issue * Removed unnecessary line in UWP BoxViewRenderer * Fixed NRE in iOS ButtonRenderer * Updated iOS Button SetBackground logic * Implemented Shell FlyoutBackground Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
2020-07-17 17:44:13 +03:00
public Brush BarBackground
{
get => (Brush)GetValue(BarElement.BarBackgroundProperty);
set => SetValue(BarElement.BarBackgroundProperty, value);
}
public Color BarTextColor {
get => (Color)GetValue(BarElement.BarTextColorProperty);
set => SetValue(BarElement.BarTextColorProperty, value);
}
public Color UnselectedTabColor
{
get => (Color)GetValue(UnselectedTabColorProperty);
set => SetValue(UnselectedTabColorProperty, value);
}
public Color SelectedTabColor
{
get => (Color)GetValue(SelectedTabColorProperty);
set => SetValue(SelectedTabColorProperty, value);
}
2016-03-22 23:02:25 +03:00
protected override Page CreateDefault(object item)
{
var page = new Page();
if (item != null)
page.Title = item.ToString();
return page;
}
Platform Specifics (#301) * Playing around with how the platform specifics interfaces etc. might work * Sample implementation of iOS navigation translucency * Very slightly reduced code * Better vendor stuff * Drop single-implemenation interfaces * Generics on NavigationPage * On-demand vendor stuff * Remove functionally duplicate classes and make ControlGallery work again * Namespace all the things. XAML test. * Can use Effect to attach platform specific * Attach Effect on PropertyChanging for XAML support! * Rename IConfigPlatform interfaces for readability * Some renaming to match the documents * Split class files * Clear out test-only code * Re-namespace * Added On method to rendered Elements * Allow for removal of platform suffix, convenience methods on specific platforms * Creating a gallery page for specifics * Add rudimentary Platform Specifics gallery; make CollapseStyle work on UWP; Add CollapsedPaneWidth specific property * Toolbar now working with both collapse styles * MDP now displaying Content title; toolbar routing around title * Add a gallery for the iOS NavigationPage stuff * Add Navigation Page as detail page to verify it works with new Toolbar options * Make titlebar/toolbar background colors consistent * ToolbarPlacement now working on NavigationPage * Toolbar Placement working for tabbed and nav pages * Fix bug where phone doesn't get default toolbar placement on start * [Core] Add PS WindowSoftInputModeAdjust [Core] Make Application extendable * Toolbar placement now working on Nav, Tabbed, and Master pages on desktop/phone Remove unnecessary style indirection Fix build errors * [A] Add PlatformConfigurationExtensions * SetSoftInputMode test page * [A] SetSoftInputMode Known issue: Status bar color does not work in AdjustResize mode * [Core] Add PS Blur * [iOS] Configure renderer for blur * Add test page * Move to blur VisualElement for broader support * Move test pages to gallery * Update docs * Use lazy initializer for PlatformConfigurationRegistry
2016-08-30 20:46:14 +03:00
public TabbedPage()
{
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<TabbedPage>>(() => new PlatformConfigurationRegistry<TabbedPage>(this));
}
public new IPlatformElementConfiguration<T, TabbedPage> On<T>() where T : IConfigPlatform
{
return _platformConfigurationRegistry.Value.On<T>();
}
2016-03-22 23:02:25 +03:00
}
}