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

Adds Popup Control #653

Merged
merged 46 commits into from
Feb 3, 2021
Merged

Adds Popup Control #653

merged 46 commits into from
Feb 3, 2021

Conversation

SkyeHoefling
Copy link
Contributor

@SkyeHoefling SkyeHoefling commented Dec 4, 2020

Description of Change

Adds native popups to iOS/Android/UWP

This PR ports the original popup control implementation from Xamarin.Forms to the Xamarin Community Toolkit. This PR is more complete than the original PR and there is better feature parity between the 3 major platform (iOS/Android/UWP). Please see the table below which documents what features are implemented on each platform.

Feature Add

API Changes

Added:

  • Popup
  • Popup<T>
  • BasePopup

The popup control allows developers to create popups and they can be extended to return data to the invocation code. This is why there are 3 different classes for XCT Popups. The BasePopup is what is needed at minimum to render a popup on screen. Then Popup<T> allows generic results where Popup will just return an object.

Below documents all the APIs added

BasePopup

View Content { get; set; }
Color Color { get; set; }
LayoutOptions VerticalOptions { get; set; }
LayoutOptions HorizontalOptions { get; set; }
Color BorderColor { get; set; }
View Anchor { get; set; }
Size Size { get; set; }
bool IsLightDissmissEnabled { get; set; }
event EventHandler<PopupDismissedEventArgs> Dismissed;
event EventHandler<PopupOpenedEventArgs> Opened;
void LightDismiss();

Popup

void Reset();
void Dismiss(T result);
Task<T> Result;

Popup

Nothing different than Popup<T> it just uses object as the type definition

Feature Parity Table

This is a very large Pull Request that adds a set of complex features to the 3 major platform (iOS, Android and UWP). It wasn't possible to get perfect feature parity across the platforms and the table below documents what is implemented in each platform

Feature Android iOS UWP
Simple Popup
Light Dismiss (Enabled)
Light Dismiss (Disabled)
Transparent Backgrounds
Custom Background Color
Event - Opened
Event - Dismissed
Layout Positioning
Dynamic Sizing
View Anchoring
Custom Return Object
Custom Light Dismissed Return Object

Usage - Basic

You can use Popups just like you do a ContentView or ContentPage below are some basic examples of using a popup in XAML

<xct:Popup xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           xmlns:xct="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit"
           x:Class="MyProject.SimplePopup">

    <StackLayout>
        <Label Text="Hello Simple Popup" />
    </StackLayout>
    
</xct:Popup>

With the popup defined you will display it by using the INavigation extension methods. At the most basic level you can access this on any ContentPage in Xamarin.Forms via the following code

var myPopup = new SimplePopup();
App.Current.MainPaget.Navigation.ShowPopup(myPopup);

Popups can use the event handlers to determine if a popup has opened or been dismissed. The code below will print a message to the console once the popup has been dismissed.

var myPopup = new SimplePopup();
myPopup.Dismissed += (s, e) => Console.WriteLine("Popup Dismissed");
App.Current.MainPage.Navigation.ShowPopup(myPopup);

Popups also support async/await Task. The code below functions the same way as above but without events.

var myPopup = new SimplePopup();
await App.Current.MainPage.Navigation.ShowPopupAsync(myPopup);
Console.WriteLine("Popup Dismissed");

Usage - Return Types

To return an object after dismissing a popup the implementation will need to invoke the Dismiss() method. This will tell the native popup to dismiss and then set the result of the popup with whatever is passed in the parameter. When using a popup with a result it is a good idea to override the GetLightDismissResult() method which is the default value if the user taps outside of the popup to dismiss it.

The solution below is using C# instead of XAML to demonstrate the other technique of creating a Popup

public class ReturnResultPopup : Popup<string>
{
	public ReturnResultPopup()
	{
		Content = new StackLayout
		{
			Children = { Message(), CloseButton() }
		};

		Button CloseButton()
		{
			var button = new Button
			{
				Text = "Close"
			};

			button.Clicked += (s, e) => Dismiss("Close button tapped");
			return button;
		}

		Label Message() =>
			new Label
			{
				Text = "Hello World"
			};
	}

	protected override string GetLightDismissResult() => "Light Dismiss";
}

Once the popup is defined to invoke it you can use the following code which will just print the result in a standard alert

var myPopup = new ReturnResultPopup();
var result = await App.Current.MainPage.Navigation.ShowPopupAsync(myPopup);
await App.Current.MainPage.DisplayAlertAsync("Popup Result", result, "OKAY");

The same technique can also be accomplished using events

var myPopup = new ReturnResultPopup();
myPopup.Dismissed += (s, e) => App.Current.MainPage.DisplayAlertAsync("Popup Result", e.Result, "OKAY");
app.Current.MainPage.Navigation.ShowPopup(myPopup);

Screenshots

Below are a series of screenshots from the sample app that demonstrate some of the different features of the Popup Control. It is not a complete list as some features are difficult to demonstrate in a screenshot.

Simple Popup

image

Custom Positioning Popup

You can position a popup anywhere on the screen, the screenshot below shows that the popup is positioned horizontally left and vertically center
image

Transparent Background Popup

As noted in the table above this doesn't work on iOS but it is still useful to see it working across the 3 major platforms
image

Toggle Size Popup

popup-togglesize

Anchor Popup

You can anchor a popup over another element
image

Notes to Code Reviewers

I have left some comments throughout the code that ask questions about certain techniques. I plan to remove those prior to accepting this change but it will be a good opportunity for us to have some dialog. I am going to go through and start discussion points on them so they are easier to find.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard

@@ -17,14 +16,15 @@ protected override void OnCreate(Bundle savedInstanceState)
base.OnCreate(savedInstanceState);

global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
Platform.Init(this, savedInstanceState);
Essentials.Platform.Init(this, savedInstanceState);
ToolkitPlatform.Init(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid initializing it somehow?
Maybe we should depend on CrossCurrentActivity plugin? @jfversluis @pictos @jsuarezruiz @sthewissen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CrossCurrentActivity needs to be initialized as well... We still have access to the Forms.Forms.Context is obsolete, but will there until Maui. This on top of my head, after looking at the implementation I can have more (bad) ideas 😋

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also...We are using the multi-target structure, we can inspire in how Maui is exposing the native objects in shared code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required in the NavigationExtensions.android.cs as it uses Platform.CreateRendererWithContext.

I didn't have a good alternative that I could think of when implementing this. The Popup controls are quite different than standard renderers as it needs to invoke the Platform.CreateRendererWithContext API. Typically this isn't needed as most custom renderers are loaded in the context of a ContentPage.

I looked at using the [Obsolete] API Platform.CreateRenderer for Android but didn't want new code to depend on deprecated APIs. I could see an argument for removing that deprecation flag in Xamarin.Forms 5, but I think that will cause more harm to the general ecosystem since using it with the correct Context is very important.

I'm all ears for a better way to handle this as I don't like having the init API if we can avoid it. To add an additional mind to the mix, @PureWeen do you have any thoughts on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahoefling when we perform the navigation, we already have the BasePopup instanciated? If so I think that we solve this more easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have an instance of the BasePopup, but there is no renderer associated with it unless we manually instantiate it. This is because the concept of Popups doesn't exist in Xamarin.Forms. I am using the CreateRenderer APIs to manually associate the shared object with it's native renderer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... I want to see if we can resolve this in the renderer area first and if we don't a way move to having an android lifecycle, to track the current Context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really hoping someone will spot a thing I missed. It was very frustrating when I had to use this workaround 😢

@pictos pictos added a/views This issue/PR is related to views p/android This issue impacts Android p/iOS iOS platform issue. UWP UWP platform issue. labels Dec 5, 2020
Copy link
Contributor

@pictos pictos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahoefling thank you for this huge contribution, I didn't run the code on my side, my comments, for now, are just about the code and any comment about implementation is just theoretical. Let me know your thoughts.

/// <summary>
/// Popup opened event arguments used when a popup is opened.
/// </summary>
public class PopupOpenedEventArgs : EventArgs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we have some properties here? If don't I think that we can remove this EventArgs (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent here was to create an event argument that we could build off in the future. Considering that all event arguments should inherit from EventArgs I agree that we should just remove this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we will use this, will be better to keep it there, because adding in the future the users will need to go for all delegates and change the EventArgs to PopupOpenedEventArgs .

@@ -17,14 +16,15 @@ protected override void OnCreate(Bundle savedInstanceState)
base.OnCreate(savedInstanceState);

global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
Platform.Init(this, savedInstanceState);
Essentials.Platform.Init(this, savedInstanceState);
ToolkitPlatform.Init(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also...We are using the multi-target structure, we can inspire in how Maui is exposing the native objects in shared code.

// This class is ported from Xamarin.Forms and should remain in sync
internal class WrapperControl : Panel
{
readonly View _view;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers, since this a ported code (basically the maintenance will be copy and paste), I think that is ok to keep the same code style as the original source. If you agree with me, we can suppress the warning in this file.

// make sure we re-measure once the template is applied
if (FrameworkElement != null)
{
FrameworkElement.Loaded += (sender, args) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if they forgot to unsubscribe from this event... 🤔

@@ -2,7 +2,7 @@
<Project Sdk="MSBuild.Sdk.Extras/2.1.2">
<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;netstandard2.1;Xamarin.iOS10;MonoAndroid10.0;Xamarin.TVOS10;Xamarin.WatchOS10;Xamarin.Mac20;tizen40</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.17763;netcoreapp3.1;net472;net471</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.19041;netcoreapp3.1;net472;net471</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to upgrade this version? I mean is this better than using the WinUI (I remember that we talked about it on the discord channel)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to update to 19041 to get the Flyout to render with a transparent background. Prior to 18362 the Flyout Shadow was not configurable which means there would be a weird shadow if you set the Color to transparent. I am not sure the best way to handle this as I added a pre-processor directive #if to only use the property if the windows version is >= 18362.

PopupRenderer.uwp.cs:168-171

#if UWP_18362
    if (Element.Color == Color.Transparent)
        flyoutStyle.Setters.Add(new Windows.UI.Xaml.Setter(FlyoutPresenter.IsDefaultShadowEnabledProperty, false));
#endif

In the UWP Sample App it is using 18362 as the target but 17763 as the min version. I think this is 'okay' but if anyone knows a better way to manage this I am all ears.

image

WinUI Investigation

While implementing this I tried using WinUI instead of the UWP library as the Flyout control is available in WinUI 3. Xamarin.Forms Shell takes a dependency on WinUI 2 and Flyout isn't available in WinUI 2. It would create a management nightmare for XCT to include WinUI 3 and Xamarin.Forms to include WinUI 2.

WinUI 3 is still in preview and I don't think it makes sense to do any push for supporting it in Xamarin.Forms 5 at this point. Perhaps once Xamarin.Forms 5 is shipped and WinUI 3 is released we could revisit this idea

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Said that, is there a problem to have a mismatch version with the XF or apps made with XF? If don't have any compatibility problem I'm ok with that.
Because I can remember that apps can have a problem with the supported version, see this #624.

@VladislavAntonyuk
Copy link
Contributor

VladislavAntonyuk commented Dec 7, 2020

can you adapt it with Tooltip control (http://www.xamboy.com/2019/03/01/showing-tooltips-in-xamarin-forms/)? I see you added Anchor Popup, but looks like on Android it doesn't have arrow and dims the background.

@SkyeHoefling
Copy link
Contributor Author

@VladislavAntonyuk

can you adapt it with Tooltip control

This is a great idea to support arrows across all the platforms. They were never part of the original spec that EZ wrote a few years ago nor the spec that was ported from the Xamarin.Forms repo to XCT. I believe adding support for arrows is out of scope for the initial PR, but I think it is something we should absolutely add to the backlog.

To properly support arrows and dimming across the platforms we should spike out how that would look for UWP as I think that is the only unknown at this point.

@jsuarezruiz
Copy link
Collaborator

@ahoefling Could you rebase to fix the conflicts?. Thanks!.

Comment on lines 24 to 29
#if __ANDROID__
OnShowPopup(popup);
#elif __IOS__
OnShowPopup(popup);
#elif WINDOWS_UWP
OnShowPopup(popup);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SkyeHoefling
Copy link
Contributor Author

I just pushed some changes and took care of a good number of the requests in the code review. I didn't get through everything, but marked everything that I have done something for as resolved. Some of the threads I looked at but couldn't get it quite right, so I left some additional comments in those.

If I get more time this weekend I'll try and make another pass.

@SkyeHoefling
Copy link
Contributor Author

I just made another code push which covers the majority of outstanding feedback items.

@pictos
I had a few questions for you in the review comments, once we get some clarification on those I can make another code push

@pictos
Copy link
Contributor

pictos commented Dec 18, 2020

@ahoefling can you solve these conflicts? I think that will be easy since the changes are just moving folders and files. I'll find a time this weekend to review this and answer your questions.

{
bool isDisposed;

protected static WeakEventManager EventManager { get; private set; } = new WeakEventManager();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pictos I updated the WeakEventManager to be a local static so it can be easily accessed between the PopupRenderer and PopupDelegate. Does this solve the Garbage Collection issue we were discussing earlier?

@SkyeHoefling
Copy link
Contributor Author

I have rebased this PR on the latest changes in main, and made another change to the iOS renderer. I added a single-line comment on a line of code that is important to review.

@pictos
Copy link
Contributor

pictos commented Dec 19, 2020

@ahoefling
The build failed
samples\XCT.Sample\ViewModels\Views\ViewsGalleryViewModel.cs(53,28): Error CS0246: The type or namespace name 'PopupGalleryPage' could not be found (are you missing a using directive or an assembly reference?)

@SkyeHoefling
Copy link
Contributor Author

Ugh, build failures

👀👀

@SkyeHoefling
Copy link
Contributor Author

It should be all fixed now

@TheCodeTraveler TheCodeTraveler added the DO-NOT-MERGE Don't merge it.... don't do it! Really... label Dec 19, 2020
@TheCodeTraveler
Copy link
Contributor

Adding the DO-NOT-MERGE label for now until WeakEventManager is properly implemented

@TheCodeTraveler
Copy link
Contributor

TheCodeTraveler commented Dec 19, 2020

@ahoefling Does PopoverDelegate.DidDismiss need to be implemented?

I'm testing the sample with the following code for PopoverDelegate, and it seems to be functioning properly.

That being said, I'm not an expert on this Popup control 🙂

class PopoverDelegate : UIPopoverPresentationControllerDelegate
{
	public override UIModalPresentationStyle GetAdaptivePresentationStyle(UIPresentationController forPresentationController) =>
		UIModalPresentationStyle.None;
}

If we do not need to implement PopoverDelegate.DidDismiss, this is my recommended solution:

  • Remove WeakEventManager from PopupRenderer.ios.cs
  • Implement WeakEventManager in BasePopup.shared.cs

PopupRenderer.ios.cs

Removes WeakEventManager

using System;
using System.ComponentModel;
using CoreGraphics;
using UIKit;
using Xamarin.CommunityToolkit.UI.Views;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;

[assembly: ExportRenderer(typeof(BasePopup), typeof(PopupRenderer))]

namespace Xamarin.CommunityToolkit.UI.Views
{
	public class PopupRenderer : UIViewController, IVisualElementRenderer
	{
		bool isDisposed;

		public IVisualElementRenderer Control { get; private set; }

		public BasePopup Element { get; private set; }

		VisualElement IVisualElementRenderer.Element => Element;

		public UIView NativeView => base.View;

		public UIViewController ViewController { get; private set; }

		public event EventHandler<VisualElementChangedEventArgs> ElementChanged;

		public event EventHandler<PropertyChangedEventArgs> ElementPropertyChanged;

		public void SetElementSize(Size size) =>
			Control?.SetElementSize(size);

		public override void ViewDidLayoutSubviews()
		{
			base.ViewDidLayoutSubviews();
			SetElementSize(new Size(base.View.Bounds.Width, base.View.Bounds.Height));
		}

		public override void ViewDidAppear(bool animated)
		{
			base.ViewDidAppear(animated);

			ModalInPopover = !Element.IsLightDismissEnabled;
		}

		public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint) =>
			NativeView.GetSizeRequest(widthConstraint, heightConstraint);

		void IVisualElementRenderer.SetElement(VisualElement element)
		{
			if (element == null)
				throw new ArgumentNullException(nameof(element));

			if (!(element is BasePopup popup))
				throw new ArgumentNullException("Element is not of type " + typeof(BasePopup), nameof(element));

			var oldElement = Element;
			Element = popup;
			CreateControl();

			if (oldElement != null)
				oldElement.PropertyChanged -= OnElementPropertyChanged;

			element.PropertyChanged += OnElementPropertyChanged;

			OnElementChanged(new ElementChangedEventArgs<BasePopup>(oldElement, Element));
		}

		protected virtual void OnElementChanged(ElementChangedEventArgs<BasePopup> e)
		{
			if (e.NewElement != null && !isDisposed)
			{
				ModalInPopover = true;
				ModalPresentationStyle = UIModalPresentationStyle.Popover;

				SetViewController();
				SetPresentationController();
				SetEvents();
				SetSize();
				SetLayout();
				SetBackgroundColor();
				SetView();
				AddToCurrentPageViewController();
			}

			ElementChanged?.Invoke(this, new VisualElementChangedEventArgs(e.OldElement, e.NewElement));
		}

		protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args)
		{
			if (args.PropertyName == BasePopup.VerticalOptionsProperty.PropertyName ||
				args.PropertyName == BasePopup.HorizontalOptionsProperty.PropertyName)
			{
				SetLayout();
			}
			else if (args.PropertyName == BasePopup.SizeProperty.PropertyName)
			{
				SetSize();
			}
			else if (args.PropertyName == BasePopup.ColorProperty.PropertyName)
			{
				SetBackgroundColor();
			}

			ElementPropertyChanged?.Invoke(this, args);
		}

		void CreateControl()
		{
			var view = Element.Content;
			var contentPage = new ContentPage { Content = view, Padding = new Thickness(25) };

			Control = Platform.CreateRenderer(contentPage);
			Platform.SetRenderer(contentPage, Control);
			contentPage.Parent = Application.Current.MainPage;
		}

		void SetViewController()
		{
			var currentPageRenderer = Platform.GetRenderer(Application.Current.MainPage);
			ViewController = currentPageRenderer.ViewController;
		}

		void SetEvents() =>
			Element.Dismissed += OnDismissed;

		void SetSize()
		{
			if (!Element.Size.IsZero)
			{
				PreferredContentSize = new CGSize(Element.Size.Width, Element.Size.Height);
			}
		}

		void SetLayout()
		{
			((UIPopoverPresentationController)PresentationController).SourceRect = new CGRect(0, 0, PreferredContentSize.Width, PreferredContentSize.Height);

			if (Element.Anchor == null)
			{
				nfloat originX = 0;
				nfloat originY = 0;

				switch (Element.VerticalOptions.Alignment)
				{
					case LayoutAlignment.End:
						originY = UIScreen.MainScreen.Bounds.Height - PreferredContentSize.Height;
						break;
					case LayoutAlignment.Center:
						originY = (UIScreen.MainScreen.Bounds.Height / 2) - (PreferredContentSize.Height / 2);
						break;
				}

				switch (Element.HorizontalOptions.Alignment)
				{
					case LayoutAlignment.End:
						originX = UIScreen.MainScreen.Bounds.Width;
						break;
					case LayoutAlignment.Center:
						originX = UIScreen.MainScreen.Bounds.Width / 2;
						break;
				}

				PopoverPresentationController.SourceRect = new CGRect(originX, originY, 0, 0);
			}
			else
			{
				var view = Platform.GetRenderer(Element.Anchor).NativeView;
				PopoverPresentationController.SourceView = view;
				PopoverPresentationController.SourceRect = view.Bounds;
			}
		}

		void SetBackgroundColor() =>
			Control.NativeView.BackgroundColor = Element.Color.ToUIColor();

		void SetView()
		{
			base.View.AddSubview(Control.ViewController.View);
			base.View.Bounds = new CGRect(0, 0, PreferredContentSize.Width, PreferredContentSize.Height);
			AddChildViewController(Control.ViewController);
		}

		void SetPresentationController()
		{
			((UIPopoverPresentationController)PresentationController).SourceView = ViewController.View;

			// Setting PermittedArrowDirector to 0 breaks the Popover layout. It would be nice if there is no anchor to remove the arrow.
			((UIPopoverPresentationController)PresentationController).PermittedArrowDirections = UIPopoverArrowDirection.Up;
			((UIPopoverPresentationController)PresentationController).Delegate = new PopoverDelegate();
		}

		void AddToCurrentPageViewController() =>
			ViewController.PresentViewController(this, true, () => Element.OnOpened());

		void OnDismissed(object sender, PopupDismissedEventArgs e) =>
			ViewController.DismissViewControllerAsync(true);

		protected override void Dispose(bool disposing)
		{
			if (isDisposed)
				return;

			isDisposed = true;
			if (disposing)
			{
				if (Element != null)
				{
					Element.PropertyChanged -= OnElementPropertyChanged;

					if (Platform.GetRenderer(Element) == this)
					{
						// NOTE - AH 9/12/2020
						// This used to use the internal property
						// 'Xamarin.Forms.Platform.iOS.Platform.RendererProperty'
						// That property is marked internal so the closest thing we can do
						// is duplicate the implementation here.
						//
						// I don't think this is really needed for the control, but I am
						// leaving it in so it can be reviewed.
						var rendererProperty = BindableProperty.CreateAttached("Renderer", typeof(IVisualElementRenderer), typeof(Platform), default(IVisualElementRenderer), propertyChanged: (bindable, oldvalue, newvalue) =>
						{
							var view = bindable as VisualElement;
							if (view != null)
								view.IsPlatformEnabled = newvalue != null;
						});

						Element.ClearValue(rendererProperty);
					}

					Element = null;
				}
			}

			base.Dispose(disposing);
		}

		void OnDismiss(object sender, EventArgs e)
		{
			if (IsViewLoaded && Element.IsLightDismissEnabled)
				Element.LightDismiss();
		}

		class PopoverDelegate : UIPopoverPresentationControllerDelegate
		{
			public override UIModalPresentationStyle GetAdaptivePresentationStyle(UIPresentationController forPresentationController) =>
				UIModalPresentationStyle.None;
		}
	}
}

BasePopup.shared.cs

Implements WeakEventManager

using System;
using Xamarin.CommunityToolkit.Helpers;
using Xamarin.Forms;

namespace Xamarin.CommunityToolkit.UI.Views
{
	/// <summary>
	/// The popup controls base implementation.
	/// </summary>
	[ContentProperty(nameof(Content))]
	public abstract class BasePopup : VisualElement
	{
		readonly WeakEventManager<PopupDismissedEventArgs> dismissWeakEventManager = new WeakEventManager<PopupDismissedEventArgs>();
		readonly WeakEventManager<PopupOpenedEventArgs> openedWeakEventManager = new WeakEventManager<PopupOpenedEventArgs>();

		/// <summary>
		/// Instantiates a new instance of <see cref="BasePopup"/>.
		/// </summary>
		public BasePopup()
		{
			Color = Color.White;
			VerticalOptions = LayoutOptions.CenterAndExpand;
			HorizontalOptions = LayoutOptions.CenterAndExpand;
			IsLightDismissEnabled = true;
		}

		public static BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(BasePopup));
		public static BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(BasePopup));

		public static BindableProperty VerticalOptionsProperty = BindableProperty.Create(nameof(VerticalOptions), typeof(LayoutOptions), typeof(BasePopup), LayoutOptions.CenterAndExpand);
		public static BindableProperty HorizontalOptionsProperty = BindableProperty.Create(nameof(HorizontalOptions), typeof(LayoutOptions), typeof(BasePopup), LayoutOptions.CenterAndExpand);

		/// <summary>
		/// Gets or sets the <see cref="View"/> content to render in the Popup.
		/// </summary>
		/// <remarks>
		/// The View can be or type: <see cref="View"/>, <see cref="ContentPage"/> or <see cref="NavigationPage"/>
		/// </remarks>
		public virtual View Content { get; set; }

		/// <summary>
		/// Gets or sets the <see cref="Color"/> of the Popup.
		/// </summary>
		/// <remarks>
		/// This color sets the native background color of the <see cref="Popup"/>, which is
		/// independent of any background color configured in the actual View.
		/// </remarks>
		public Color Color
		{
			get => (Color)GetValue(ColorProperty);
			set => SetValue(ColorProperty, value);
		}

		/// <summary>
		/// Gets or sets the <see cref="LayoutOptions"/> for positioning the <see cref="Popup"/> vertically on the screen.
		/// </summary>
		public LayoutOptions VerticalOptions
		{
			get => (LayoutOptions)GetValue(VerticalOptionsProperty);
			set => SetValue(VerticalOptionsProperty, value);
		}

		/// <summary>
		/// Gets or sets the <see cref="LayoutOptions"/> for positioning the <see cref="Popup"/> horizontally on the screen.
		/// </summary>
		public LayoutOptions HorizontalOptions
		{
			get => (LayoutOptions)GetValue(HorizontalOptionsProperty);
			set => SetValue(HorizontalOptionsProperty, value);
		}

		/// <summary>
		/// Gets or sets the <see cref="View"/> anchor.
		/// </summary>
		/// <remarks>
		/// The Anchor is where the Popup will render closest to. When an Anchor is configured
		/// the popup will appear centered over that control or as close as possible.
		/// </remarks>
		public View Anchor { get; set; }

		/// <summary>
		/// Gets or sets the <see cref="Size"/> of the Popup Display. 
		/// </summary>
		/// <remarks>
		/// The Popup will always try to constrain the actual size of the <see cref="Popup" />
		/// to the <see cref="Popup" /> of the View unless a <see cref="Size"/> is specified.
		/// If the <see cref="Popup" /> contiains <see cref="LayoutOptions"/> a <see cref="Size"/>
		/// will be required. This will allow the View to have a concept of <see cref="Size"/>
		/// that varies from the actual <see cref="Size"/> of the <see cref="Popup" />
		/// </remarks>
		public Size Size
		{
			get => (Size)GetValue(SizeProperty);
			set => SetValue(SizeProperty, value);
		}

		/// <summary>
		/// Gets or sets a value indicating whether the popup can be light dismissed.
		/// </summary>
		/// <remarks>
		/// When true and the user taps outside of the popup it will dismiss.
		/// </remarks>
		public bool IsLightDismissEnabled { get; set; }

		/// <summary>
		/// Dismissed event is invoked when the popup is closed.
		/// </summary>
		public event EventHandler<PopupDismissedEventArgs> Dismissed
		{
			add => dismissWeakEventManager.AddEventHandler(value);
			remove => dismissWeakEventManager.RemoveEventHandler(value);
		}

		/// <summary>
		/// Opened event is invoked when the popup is opened.
		/// </summary>
		public event EventHandler<PopupOpenedEventArgs> Opened
		{
			add => openedWeakEventManager.AddEventHandler(value);
			remove => openedWeakEventManager.RemoveEventHandler(value);
		}

		/// <summary>
		/// Invokes the <see cref="Dismissed"/> event.
		/// </summary>
		/// <param name="result">
		/// The results to add to the <see cref="PopupDismissedEventArgs"/>.
		/// </param>
		internal void OnDismissed(object result) => dismissWeakEventManager.RaiseEvent(this, new PopupDismissedEventArgs(result), nameof(Dismissed));

		/// <summary>
		/// Invokes the <see cref="Opened"/> event.
		/// </summary>
		internal virtual void OnOpened() => openedWeakEventManager.RaiseEvent(this, new PopupOpenedEventArgs(), nameof(Opened));

		/// <summary>
		/// Invoked when the popup is light dismissed. In other words when the
		/// user taps outside of the popup and it closes.
		/// </summary>
		public virtual void LightDismiss()
		{
			// REVIEW - AH 12/3/2020
			// Should this API be protected internal? It is not intended
			// to be called outside of XCT, but it should allow for subclassing.

			// TODO - AH 12/3/2020
			// This is not being tested correctly. It is not
			// implemented in iOS or UWP.

			// empty default implementation
		}

		/// <inheritdoc />
		protected override void OnBindingContextChanged()
		{
			base.OnBindingContextChanged();

			if (Content != null)
			{
				SetInheritedBindingContext(Content, BindingContext);
			}
		}
	}
}

@SkyeHoefling
Copy link
Contributor Author

@brminnick thank you for such a detail review on the iOS implementation ❤, this was the hardest implementation for me and it is appreciated. I wasn't 100% sure how we implemented the WeakEventManager, the updates you shared are going to be very useful in my next code push.

The PopoverDelegate is being used to trigger the shared code that a light dismiss has occurred. It invokes the Element.LightDismiss method. You can see this in the code snippet below, which is the OnDismiss method. Understandable this is confusing as there are other method names that are similar.

void OnDismiss(object sender, EventArgs e)
{
    if (IsViewLoaded && Element.IsLightDismissEnabled)
        Element.LightDismiss();
}

I am going to take a much closer look at this. If I can remove the Popover Delegate, I am more than happy to do that. If not I'll provide notes on my findings

@SkyeHoefling
Copy link
Contributor Author

I just pushed a change that updates the BasePopup to use WeakEventManager. I still need to look at the iOS Popover. There also seems to be some business rule issues with Dismiss vs Light Dismiss that I will look at when I look at the iOS Popover Delegate

@SkyeHoefling
Copy link
Contributor Author

@brminnick I just took a look at the changes you made, everything looks good to me 👍. Thanks for cleaning up the code.

@jfversluis
Copy link
Member

IM DOING THIS

@jfversluis jfversluis merged commit e51ca9d into xamarin:develop Feb 3, 2021
@SkyeHoefling SkyeHoefling deleted the popup_control branch February 3, 2021 20:15
@Suplanus
Copy link

Suplanus commented Feb 5, 2021

This should also works on macOS. The only dependencies are:

  • CoreGraphics
  • UIKit

Cfun1 added a commit to Cfun1/XamarinCommunityToolkit that referenced this pull request Feb 5, 2021
pictos pushed a commit that referenced this pull request Feb 6, 2021
* Fix popup out of horizontal bounds

#653 (comment)

* Device Size dependent

* Essentials namespace

* revert
@acaliaro
Copy link

IM DOING THIS

@jfversluis when will be in the nighlty feed?

@jfversluis
Copy link
Member

@acaliaro It already is

@acaliaro
Copy link

BasePopup?

@acaliaro
Copy link

@acaliaro It already is

how can I visualize it?

await Navigation.ShowPopupAsync(new PopupPezziPrelevatiView()) ;

I see this in the sample, but what is "Navigation"?

@Cfun1
Copy link
Contributor

Cfun1 commented Feb 16, 2021

@acaliaro It already is

how can I visualize it?

await Navigation.ShowPopupAsync(new PopupPezziPrelevatiView()) ;

I see this in the sample, but what is "Navigation"?

@acaliaro check

INavigation Navigation => App.Current.MainPage.Navigation;

@acaliaro
Copy link

Is it possible that the popup takes up as little space as possible, depending on its content? There appears to be a "Size" parameter which however defines a static size. Rg.Popup adapts to the content by defining HorizontalOptions and VerticalOptions; Can the XCT popup do the same?

@inforithmics inforithmics mentioned this pull request Feb 22, 2021
5 tasks
jfversluis added a commit that referenced this pull request Mar 22, 2021
* Added new TextCaseType to TextCaseConverter (#763)

* Added new TextCaseType to TextCaseConverter

Added support for first char to upper rest to lower case.

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

* Added unit tests and fix bug for empty string

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

Co-authored-by: joacim wall <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Add LocalizedString class for automatic  ViewModel string updates (#750)

* Add LocalizedString

* Update test name

* Remove from NETSTANDARD1_0

* LangVersion latest

* Revert "LangVersion latest"

This reverts commit e22a4c1.

* Not using linq discard

* Fix test

* Fix test. Add constructor with localizationManager

* Add new feature to sample app

* Add Dispose() to unsubscribe from localizationManager.PropertyChanged

* Fix Sample localization resources generation

* Update sample app to change AppResources.Culture

* Update LocalizedString to use ObservableObject

* Return unsubscribing from localizationManager.PropertyChanged

* Add WeakSubscribe

* Refactor LocalizedString to use WeakSubscribe

* Add test to ensure instance of LocalizedString is disposed

* Dont create instance of LocalizationResourceManager

* Add null checks to WeakSubscribe

* Invoke action with less code

null check has already been done

* Replace spaces with tabs

* Revert "Use Single for getting culture"

* added one more unit test

Co-authored-by: Pedro Jesus <[email protected]>

* Add CommandFactory class (#797)

* Create CommandHelper.shared.cs

* Use CommandHelper in Sample app

* Rename to CommandFactory

* Replace "is null" with "== null"

* Update GravatarImageViewModel.cs

* Update SearchViewModel.cs

* Move CommandFactory to ObjectModel

* Update ConvertExecute and ConvertCanExecute to throw InvalidCommandParameterException

* Add tests

* Skip test in question

* Revert Xamarin.CommunityToolkit.csproj changes

* Fix tests

* Add tests for AsyncValueCommand

* Revert AsyncValueCommandSupport

* Revert "Revert AsyncValueCommandSupport"

This reverts commit 07a178c.

* Creating AsyncValueCommand using CreateValue

* Revert "Creating AsyncValueCommand using CreateValue"

This reverts commit 7b32561.

* Add Create overloads without optional parameters for Task to act as tiebreakers

* Add different names to "execute" parameters to provide another way to resolve ambiguity

* Updated CommandFactory

- Add XML Documentation
- Separated Command.Factory.Command.shared.cs, Command.Factory.IAsyncCommand.shared.cs and Command.Factory.IAsyncValueCommand.shared.cs
- Removed unnecessary CommandFactory.Create methods
- Added missing CommandFactory.Create methods
- Updated Unit Tests

* Updated XML Documentation

Co-authored-by: Brandon Minnick <[email protected]>

* Deprecate LocalizationResourceManager.SetCulture (#766)

* Deprecate SetCulture

* Add EditorBrowsableState.Never

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Helpers/LocalizationResourceManager.shared.cs

* Fix obsolete warning in tests

* Remove unneeded line

* Use new LocalizationResourceManager for tests

Tests were failing from time to time because the same instance of LRM was used for all of them. And since tests are executed in parallel, this caused some issues

* Siplify impicit conversion test to test only conversion itself

* Return Invalidate mathod

Co-authored-by: Pedro Jesus <[email protected]>

* ShadowEffect (#725)

* #461

* Added mac support

* Added sample

* Updated shadows

* Fixed iOS crash

* removed pragma

* Remove effect when color if default

* cleaned code

* Implemented LazyView (#796)

* Created LazyView and implemented it on TabView

* Added Preserve attribute

* Update LazyTestView.xaml

* Adds Popup Control (#653)

* Ported Popup Control from xamarin/Xamarin.Forms#9616 to Xamarin Community Toolkit

* Added missing async/await api

* Added popup result sample and fixed uwp/android implementations

* Renamed View->Content

* Updated styles of sample popups

* Updated BorderColor to be a platform specific property for UWP

* Moved Android/iOS/UWP renderers to platform specific folders

* Changed PopupDismissedEventArgs so it is immutable

* Removed visual studio edits to sample android project

* Removed = false for isDisposed as it is default

* Normalized accessor properties for ios and uwp

* Removed performance apis since they are used internally at Xamarin.Forms

* Simplified OnElementChanged to use shared method ConfigureControl

* Removed iOS 9 code

* Updated NavigationExtensions to follow Xamarin Essentials style by adding netstandard impl that throws exception

* Added Control.Cleanup invocation to dispose method

* [iOS] Removed async/await from OnDismissed since it is an event the invocation doesn't need to know when it is complete

* Fixed comment

* Updated iOS to use WeakEventManager

* changed instantiation to use default(SizeRequest)

* ios - Changed WeakEventManager so it is a protected static object on the popup renderer. This will help create a weak reference to the popup delegate for the GC

* Moved sample popup code to new location

* Added WeakEventManager for BasePopup events (Opened, Dismissed)

* ios - changed popover delegate to use action

* Added PopOverDelegate.PopoverDismissed

* Updated accessor for LightDismiss to protected internal

* Updated comment in LightDismiss

* Removed stale iOS code

* Updated xml comments

* Removed obj dir from compilation in 'netstandard' projects and fixed debugger issues

* removed Init method and added code to get the Context

* changed accessor of ToolkitPlatform to internal

* Added new UI popup tests for Xaml binding vs C# binding

* Updated XCT xmlns to use uri instead of fully qualified namespace

* Added shared popup size across samples

* Fixed popup BindingContext not working when set in XAML

* Update Samples

- Capitalize x:Name variables
- Replace expression-bodied properties with read-only properties where applicable

* Add PopupDismissedEventArgs<T>

* Add Default Values for Color and Size

* Remove Unncessary `base` Keyword, per styling guide

* Optimize originX + originX, Add missing `await`

* Update PopupAnchorViewModel.cs

* Fix orignY

Copy/paste error

* Update PopupRenderer.ios.cs

* Update NavigationExtensions.netstandard.macos.tvos.watchos.tizen.wpf.gtk.cs

* Added NavigableElementExtension - This allows rendering popup from ContentPage and other children of NavigableElement

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Update BaseGalleryViewModel.cs

* Merging is hard

* Fix Anchor Popup Sample NRE (#834)

* Changed LoadView to be Async (#828)

* Changed LoadView to ValueTask LoadViewAsync and added summaries

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/LazyView/LazyView.shared.cs

* Popup out of the screen horizontally in Android sample (#839)

* Fix popup out of horizontal bounds

#653 (comment)

* Device Size dependent

* Essentials namespace

* revert

* [Android] Converting dimensions to pixels in popup renderer (#856)

* [Android] Converting dimensions to pixels in popup renderer

* Add fixed and relative to screen sizes instead of platform specific sizes.

* Update ButtonPopup size.

* Update CsharpBindingPopup size.

* Update MultipleButtonPopup size.

* Update NoLightDismissPopup size.

* Update OpenedEventSimplePopup size.

* Update ReturnResultPopup size.

* Update SimplePopup size.

* Update ToggleSizePopup size.

* Update TransparentPopup size.

* Update XamlBindingPopup size.

* #704 [Bug] No padding around text in a Toast or Snackbar (#714)

* Make ShieldView more customizable (#874)

* Add SubjectBackgroundColor, SubjectTextColor/reorganization.

* Update sample.

* Obsolete message

* Correct typo in comment

Co-authored-by: Gerald Versluis <[email protected]>

* Drop UpdateTextColor()

Co-authored-by: Gerald Versluis <[email protected]>

* fixed csproj to produce sourcelink (#893)

* [iOS] Remove popup arrow if anchor isn't set (#854)

* Remove popup arrow if anchor isn't set

* Create PopoverArrowDirection.cs

* Create Popup.shared.cs

* Add arrow direction platform specific.

* Add arrow direction platform specific sample.

* Rename PopoverArrowDirection.cs to PopoverArrowDirection.shared.cs

* Change ArrowDirection to up

* Remove switch PopoverArrowDirection.None since default is already zero.

* Use div 2 instead of multiply by 0.5 for consistency.

Co-authored-by: Sebastian Klatte <[email protected]>

* ProgressBar Attached Property to enable progress animation (#352)

* ProgressBar Attached Property to enable progress animation

* Fixes remarks on PR

* Fix remarks PR

* Changes need for new gallery viewmodel

* Correct version from before rebase

* Update AttachedPropertiesGalleryViewModel.cs

* Update ProgressBarAttachedProperties.shared.cs

* Update ProgressBarAttachedProperties.shared.cs

* Change Attached property to behavior

* Update samples/XCT.Sample/Xamarin.CommunityToolkit.Sample.csproj

Co-authored-by: Andrei <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/ProgressBarAnimationBehavior.cs

Co-authored-by: Andrei <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Xamarin.CommunityToolkit.csproj

Co-authored-by: Andrei <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/ProgressBarAnimationBehavior.cs

Co-authored-by: Cfun <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/AttachedProperties/ProgressBarAttachedProperties.shared.cs

Co-authored-by: Cfun <[email protected]>

* Remove old attached property and rename new behavior

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Cfun <[email protected]>

* Merge main into dev (#913)

* [Android] Fix Long Press blocks CollectionView selection  (#764)

* #760

* Moved helper methods to VisualElementExtensions

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs

Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>

* [Android] Fix SideMenuView + Slider issue (#824)

* [Android] Allow using slider inside SideMenu with disabled gestures

#810

* Refactored gesture default threshold
#810

* Cleaned code. Added linker safety code

* Fixed build

Co-authored-by: Javier Suárez <[email protected]>

* Automated dotnet-format update (#837)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Remove `Device` dependency from command implementation (#825) (#830)

* Remove `Device` dependency from command implementation (#804)

* Move Xamarin.CommunityToolkit.ObjectModel.Internals classes to `Internals` folder

* Add Platform-Specific MainThread Implementations, Update Unit Tests to Acommidate Context Switching

* Update BaseCommand.uwp.cs

* Add BaseCommand.wpf.cs

* Finish BaseCommand.gtk.cs

* Update BaseCommand.shared.cs

Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

* Automated dotnet-format update (#865)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fixes #859 (#864)

Co-authored-by: Gerald Versluis <[email protected]>

* ValidationBehavior: Added IsNotValid property (#836)

* Added IsNotValid property to validators

* small fix

* Updated sample

* #822 (#877)

* Fixes AvatarView - Valid source images dont load for the first time they are created  (#849)

* #805

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/AvatarView/AvatarView.shared.cs

Co-authored-by: Gerald Versluis <[email protected]>

* Fixed image loading

* Fixed null ref

* Fixes crashes

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Added inline docs (#882)

* Update ViewsGalleryViewModel.cs (#888)

removed duplicated text "used to"

* Document all behaviors and associated (#895)

* Housekeeping remove XamlCompilation from code-behind. (#897)

* Changed TabView SelectedIndex property to use TwoWay binding mode (#903)

* Add inline Docs/Comments to Converters (#907)

* Update azure-pipelines.yml

Co-authored-by: Andrei <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: WillAutioItrax <[email protected]>
Co-authored-by: Cfun <[email protected]>

* Add "Add(IEnumerable<T> collection)" to ObservableRangeCollection<T> (#891)

* Create ObservableRangeCollectionEx.shared.cs

* Add test

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Extensions/ObservableRangeCollectionEx.shared.cs

* Resolve comments

* Add AddToNullCollection test

* Fix WeakSubscribe parameter type

* Revert "Fix WeakSubscribe parameter type"

This reverts commit 221ee0f.

Co-authored-by: Andrei <[email protected]>

* Update INotifyPropertyChangedEx.shared.cs (#918)

* [Breaking Changes] ValidationBehavior Async checks support (#912)

* Refactored validation behavior

* Refactored to ValueTask

* added configure await false

* Fixed isRunning

* LifeCycleEvents (#674)

* Created LifeCycleEffect and platform implementations

* Added sample to LifeCycle effect

* refactor UnLoaded logic

* clean up csproj

* Fixed NRE for shell

* Code Review fixes

* code style

* improved the sample

* fixed tizen path

* Fixed iOS support

* Implemented WeakEventManager

* Added inline docs/comments

* changed to nameof

* Msbuild hotfix (#946)

* fixed msbuild instructions

* revert android sample csproj

* Add `Grouping` class from Refractored.MvvmHelpers (#957)

* Fix LocalizedString gets unsubscribed while still in use (#987)

* Fixed all the things

* Make PersistentObservableObject abstract

* Reverse the inheritance

* Commit to rerun tests

* Remove PersistentObservableObject

* Grammar

* Feature/371 enum boolean converter (#925)

* Implement EnumToBoolConverter (#371)

* Add example for EnumToBoolConverter

* Make it work with flagged enums (#371)

* Simplify code (#371)

* Make the method an local static method (#371)

* Cache enum type info (#371)

Co-authored-by: Eugen Richter <[email protected]>

* Add VSM to ValidationBehavior (#955)

* Add VSM to ValidationBehavior

* dumb commit: Re trigger CI

* Fix typo

* Fix typo

Co-authored-by: Andrei <[email protected]>

* Change string properties to public

* Apply Pascal Case Naming

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

Co-authored-by: Andrei <[email protected]>

* Fix Singleton Pattern for LocalizationResourceManager (#919)

* Update LocalizationResourceManager.shared.cs

* Implement Lazy Loading for Thread Safety

* Fix Namespace

* Removed changes from main branch

* Revert Commit

* Update LocalizationResourceManager.shared.cs

* Fix Unit Tests

* Add Collection to LocalizationResourceManagerTests

The `Collection` attribute prevents these tests from running in parallel https://xunit.net/docs/running-tests-in-parallel.html

* [Enhancement] Add Scale support for SideMenuView (#1011)

* SideMenu scaling #1007

* Added easing

* Update azure-pipelines.yml

* [iOS] Fix missing binding context for popup view (#1003)

* [iOS] Fix missing binding context for popup view

* Fix handle binding context changes.

* Enable Nullable (#1009)

* Enable Nullable on Unit Tests (#1008)

* Enable Nullability on Xamarin.CommunityToolkit.Markup (#1013)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullability on Xamarin.CommunityToolkit.Sample (#1014)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullability for Android, GTK, iOS, Tizen, UWP & WPF Sample Projects (#1015)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Enable Nullability on Xamarin.CommunityToolkit (#1016)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Add Nullability

* Enable Nullable on XamarinCommunityToolkit (#1023)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Add Nullability

* Resolve Possible Null References

* Removed Possible Null References

* Update AppResources.Designer.cs

* Handle Nullability

* Updated Nullabiltiy

* Update Converters & Unit Tests

* Resolve MediaSource Unit Tests

* Fix Unit Tests (#1036)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Add Nullability

* Resolve Possible Null References

* Removed Possible Null References

* Update AppResources.Designer.cs

* Handle Nullability

* Updated Nullabiltiy

* Update Converters & Unit Tests

* Resolve MediaSource Unit Tests

* Fix VariableMultiValueConverter

* Fixed ImpliedOrderGridBehavior

* Update NumericValidationBehavior.shared.cs

* Resolve Nullable in SideMenuView

* Move <Nullable>enable</Nullable> to Directory.Build.props

* Update Xamarin.CommunityToolkit.Sample.csproj

* Revert Designer.cs

* Update Xamarin.CommunityToolkit.Sample.csproj

* Update ItemSelectedEventArgsConverter_Tests.cs

* Update SearchViewModel.cs

* Update ItemTappedEventArgsConverter_Tests.cs

* Update Xamarin.CommunityToolkit.UnitTests.csproj

* Add Nullability

* Resolve Compiler Warnings

* Ignore Closing square brackets should be spaced correctly

With Nullable enabled, `byte[]?` is now valid, however SA1011 was still generating a warning

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/ImpliedOrderGridBehavior.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update CameraFragment.android.cs

* Update CameraFragment.android.cs

* Update ImpliedOrderGridBehavior.shared.cs

* Update MaskedBehavior.shared.cs

* Update PopupRenderer.uwp.cs

* Use .NET 5.0

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add UWP to Release Build

* Update Nullability

* Update Nullablity

* Update TabView.shared.cs

* Update Nullability

* Revert "Update Nullability"

This reverts commit e391b9c.

* Resolved Nullable

* Update azure-pipelines.yml

* Revert UWP Build Properties

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit 0842280.

* Update azure-pipelines.yml

* Revert "Revert UWP Build Properties"

This reverts commit 77226bf.

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit 4eb36f4.

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit e41a477.

* Fix ValidationBehavior.ForceValidate and ValidationBehavior.DefaultForceValidateCommand

* Update SelectAllTextEffect.ios.cs

* Remove Nullabilty from LocalizedString.generator

* Update MediaElementRenderer.ios.cs

* Update PopupRenderer.uwp.cs

* Update PopupRenderer.ios.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/Helpers/iOS/SnackbarViews/BaseSnackBarView.ios.cs

Co-authored-by: Maksym Koshovyi <[email protected]>

* Update TranslateExtension.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/SnackBar.android.cs

Co-authored-by: Maksym Koshovyi <[email protected]>

* Update Logic

* Fix Failing ICommand Tests

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/SnackBar.tizen.cs

Co-authored-by: Maksym Koshovyi <[email protected]>

* Throw Faulted Task

* Use Cast instead of Pattern Matching

* Update RangeSlider.shared.cs

* Fix missing semi-colons

* Throw InvalidOperationException in LocalizationResourceManager

* Make TranslateExtension.StringFormat nullable

* Update UserStoppedTypingBehavior.shared.cs

* Update SearchPage.logic.cs

* Update TouchEffectCollectionViewPage.xaml.cs

* Update AppResources.Designer.cs

* Update AppResources.Designer.cs

* Update EnumToBoolConverterViewModel.cs

* Update EnumToBoolConverter_Tests.cs

* Update IntToBoolConverter_Tests.cs

* Update InvertedBoolConverter_Tests.cs

* Update IsNotNullOrEmptyConverter_Tests.cs

* Update MultiConverter_Tests.cs

* Update NotEqualConverter_Tests.cs

* Update TextCaseConverter_Tests.cs

* Update MockPlatformServices.cs

* Update MockPlatformServices.cs

* Update Namespace_Tests.cs

* Update ObservableRangeCollection_Tests.cs

* Update ObservableRangeCollection_Tests.cs

* Use `async Task` instead of `async void`

* Update MultiValidationBehavior.shared.cs

* Update EnumToBoolConverter.shared.cs

* Update EnumToBoolConverter.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/NotEqualConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/StateToBooleanConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update IconTintColorEffectRouter.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/SelectAllText/SelectAllTextEffect.android.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update SelectAllTextEffect.android.cs

* Update SelectAllTextEffect.ios.cs

* Update PlatformTouchEffect.ios.cs

* Update PlatformTouchEffect.uwp.cs

* Update PlatformTouchEffect.uwp.cs

* Update PlatformTouchEffect.macos.cs

* Update PlatformTouchEffect.uwp.cs

* Update PlatformTouchEffect.uwp.cs

* Ensure nullable results from BindableProperties are still resolved

* Update ImageResourceExtension.shared.cs

* Update BaseCommand.android.cs

* Use protected private constructor for BaseCommand

* Update BadgeView.shared.cs

* Update CameraFragment.android.cs

* Fix Android Media Bugs

* Update async/await

* Update CameraView_Tests.cs

* Update CameraView

* Update UriTypeConverter.shared.cs

* Update PopupRenderer.uwp.cs

* Update PopoverArrowDirection.shared.cs

* Update PopoverArrowDirection.shared.cs

* Update TabView.shared.cs

* Improve AsyncCommand Tests

* Ensure Context is non nullable

* Remove Missing Translations

* Fix async/await in TouchEffect.shared.cs

* Make Easing Nullable

* Update Samples

* Fix Null Exception

* Resolve NullReferenceExceptions

* Make IBadgeAnimation Nullable

* Add ShutterCommandValueCreator null check

* Add Timeout to prevent race conditions from stalling tests

* Unsubscribe Event Handlers for AsyncCommand Tests

* Update azure-pipelines.yml

* For WPF, Use Cross-Platform Implementation for `BaseCommand.IsMainThread` and `BaseCommand.BeginInvokeOnMainThread` (#965)

* Add Non-WPF Support to .NET Core 3.1

* Update comments

* Merge .NET Standard and WPF Functionality

* Fix Null Reference

* Update ICommand_AsyncValueCommand_Tests.cs

* Add volatile keyword

* Update AsyncValueCommand_Tests.cs

* Remove Timeouts

* Fix Event Unsubscription

* Add .ConfigureAwait(false);

* Run dotnet test serially

* Use SemaphoreSlim to prevent Race Conditions

Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: Maksym Koshovyi <[email protected]>

* add SetFocusOnEntryCompleted (#841) (#911)

* add SetFocusOnEntryCompleted (#841)

* prevent SetFocusOnEntryCompleted memory leak (#841)

also force exception if used on non-Entry

* cleanup (reuse variable) (#841)

* change to attached behavior SetFocusOnEntryCompletedBehavior

* remove AttachedBehaviors sub-namespace

* fix SetFocusOnEntryCompleted_Tests

* simplify SetFocusOnEntryCompletedBehaviorPage

* fixed code to be nullable safe

* code style

Co-authored-by: Pedro Jesus <[email protected]>

* #1046 (#1052)

* #1025 (#1042)

* Merge fixing

* Implement SafeFireAndForgetExtensions (#1054)

* Implement Safe-Fire-And-Forget

* Change `public` to `internal`

* Update PlatformTouchEffect.android.cs

* Regression #853 (#1063)

* [iOS] Fix popup default color and dark mode (#1041)

* [iOS] Fix popup default color and dark mode

* [Android] Set correct background for default color

* [Android] GetWindowColor() for popup background color

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/Android/PopupRenderer.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/Android/PopupRenderer.android.cs

* Update BasePopup.shared.cs

* Update PopupRenderer.android.cs

* Update PopupRenderer.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/BasePopup.shared.cs

Co-authored-by: Andrei <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

* Add remove border effect implementation for uwp (#1048)

Co-authored-by: Alexander Witkowski <[email protected]>

* Added long press event #851 (#1064)

* Update LocalizedString.shared.cs (#1071)

* Image resource converter (#1068)

* Implement ImageResourceConverter

* Add a sample for ImageResource extension

* Fix nullable errors

* Rename converter file to be compiled.

* Better exception message

Co-authored-by: Andrei <[email protected]>

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/ImageResourceConverter.shared.cs

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Fix GalleryPage and VM

* Update samples/XCT.Sample/ViewModels/Extensions/ExtensionsGalleryViewModel.cs

Co-authored-by: Andrei <[email protected]>

* Update samples/XCT.Sample/ViewModels/Extensions/ExtensionsGalleryViewModel.cs

Co-authored-by: Andrei <[email protected]>

* Replace Exception approach by extension used by XF (#1028)

* Replace Exception approach by extension used by XF

* Simplified syntax as requested

* Add a missing namespace

* Resolve `IAsyncCommand` / `IAsyncValueValueCommand` Unit Test Race Condition (#1076)

* Add Unit Test Timeouts

* Add macOS Unit Tests

* Build 'samples/XCT.Sample.sln' on macOS

* Restore Unit Test NuGet Packages

* Fix YAML formatting

* Add xunit.runner.console

* Use latest stable version of Microsoft.NET.Test.Sdk

* Fix Unit Tests on macos

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add SemaphoreSlim

* Add `dotnet restore`

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Revert "Add SemaphoreSlim"

This reverts commit 6875865.

* Revert BaseCommand.semaphoreSlim

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add ConfigureAwait(false) to ValueTaskDelay(int)

* Change Platform from NetCore to macOS

* Passthrough ValueTask

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit d7b2842.

* Use ConfigureAwait(false)

* Rename Task

* Remove `static`

* Remove `static`

* Revert p:BuildInParallel=false

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit bf93f0c.

* Revert "Revert "Update azure-pipelines.yml""

This reverts commit 031121a.

* Revert "Revert "Revert "Update azure-pipelines.yml"""

This reverts commit 458feb2.

* #1066 (#1078)

Co-authored-by: Brandon Minnick <[email protected]>

* fix badge background color (#1080) (#1081)

Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* allow TextCaseConverter to handle any value type (#1053)

* allow TextCaseConverter to handle any value type

* remove duplicate Convert method

* fix nullability

* update TextCaseConverter tests

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

Co-authored-by: Andrei <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* #850 (#1056)

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Platform specific API (#949)

* added iOS platformSpecific

* added UWP platform specific

* Changed the sample

* code clean up

* added null check for Element

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>

* Add some null checks (#1033)

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>

* Migrate Unit Tests to NUnit (#1090)

* Migrate to NUnit

* Update Tests

* Update Azure Pipelines

* Update TextCaseConverter_Tests.cs

* Update DateTimeOffsetConverter_Tests.cs

* Increase Timeout

* Increase Timeout

* Add `const int defaultTimeoutThreshold`

Co-authored-by: Gerald Versluis <[email protected]>

* Enable Nullable for Xamarin.CommunityToolkit.Markup.UnitTests (#1086)

* Add Markup Unit Tests

* Add Nullable to Xamarin.CommunityToolkit.Markdown.UnitTests

* Update BindingHelpers.cs

* Fix Failing Unit Tests

* Don't capture XUnit's Synchronization Context

* Re-order Unit Tests

* Revert "Don't capture XUnit's Synchronization Context"

This reverts commit b8b3f16.

Co-authored-by: Javier Suárez <[email protected]>

* Implement a generic version of the EventToCommandBehavior (#1010)

* created ECBGeneric

* Added Generic implemention to the EventToCommandBehavior

* make EventToCommandBehavior<TType> sealed

* Fixed for value types

* added nullable notations

* update the comment

* fixed unit test

* Migrate Unit Tests to NUnit

* Fixed unitTest

* changed to use C#9 features

* removed Convert method

* Add Inheritance Test

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

* [UWP] TouchEffect OnPointerReleased crash (#1088)

* Fixed TouchEffect UWP crash

* Touch Effect more nullRef fixes

* fixed build

* fix build

Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

Co-authored-by: Joacim Wall <[email protected]>
Co-authored-by: joacim wall <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: Maksym Koshovyi <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Andrew Hoefling <[email protected]>
Co-authored-by: Cfun <[email protected]>
Co-authored-by: Sebastian Klatte <[email protected]>
Co-authored-by: Vladislav Antonyuk <[email protected]>
Co-authored-by: Sebastian Klatte <[email protected]>
Co-authored-by: Glenn Versweyveld <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: WillAutioItrax <[email protected]>
Co-authored-by: tranb3r <[email protected]>
Co-authored-by: Jacob Egner <[email protected]>
Co-authored-by: Alexander Witkowski <[email protected]>
Co-authored-by: Alexander Witkowski <[email protected]>
Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Dan Siegel <[email protected]>
TheCodeTraveler added a commit that referenced this pull request Apr 9, 2021
* Develop to Main for 1.1 (#1108)

* Added new TextCaseType to TextCaseConverter (#763)

* Added new TextCaseType to TextCaseConverter

Added support for first char to upper rest to lower case.

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

* Added unit tests and fix bug for empty string

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

Co-authored-by: joacim wall <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Add LocalizedString class for automatic  ViewModel string updates (#750)

* Add LocalizedString

* Update test name

* Remove from NETSTANDARD1_0

* LangVersion latest

* Revert "LangVersion latest"

This reverts commit e22a4c1.

* Not using linq discard

* Fix test

* Fix test. Add constructor with localizationManager

* Add new feature to sample app

* Add Dispose() to unsubscribe from localizationManager.PropertyChanged

* Fix Sample localization resources generation

* Update sample app to change AppResources.Culture

* Update LocalizedString to use ObservableObject

* Return unsubscribing from localizationManager.PropertyChanged

* Add WeakSubscribe

* Refactor LocalizedString to use WeakSubscribe

* Add test to ensure instance of LocalizedString is disposed

* Dont create instance of LocalizationResourceManager

* Add null checks to WeakSubscribe

* Invoke action with less code

null check has already been done

* Replace spaces with tabs

* Revert "Use Single for getting culture"

* added one more unit test

Co-authored-by: Pedro Jesus <[email protected]>

* Add CommandFactory class (#797)

* Create CommandHelper.shared.cs

* Use CommandHelper in Sample app

* Rename to CommandFactory

* Replace "is null" with "== null"

* Update GravatarImageViewModel.cs

* Update SearchViewModel.cs

* Move CommandFactory to ObjectModel

* Update ConvertExecute and ConvertCanExecute to throw InvalidCommandParameterException

* Add tests

* Skip test in question

* Revert Xamarin.CommunityToolkit.csproj changes

* Fix tests

* Add tests for AsyncValueCommand

* Revert AsyncValueCommandSupport

* Revert "Revert AsyncValueCommandSupport"

This reverts commit 07a178c.

* Creating AsyncValueCommand using CreateValue

* Revert "Creating AsyncValueCommand using CreateValue"

This reverts commit 7b32561.

* Add Create overloads without optional parameters for Task to act as tiebreakers

* Add different names to "execute" parameters to provide another way to resolve ambiguity

* Updated CommandFactory

- Add XML Documentation
- Separated Command.Factory.Command.shared.cs, Command.Factory.IAsyncCommand.shared.cs and Command.Factory.IAsyncValueCommand.shared.cs
- Removed unnecessary CommandFactory.Create methods
- Added missing CommandFactory.Create methods
- Updated Unit Tests

* Updated XML Documentation

Co-authored-by: Brandon Minnick <[email protected]>

* Deprecate LocalizationResourceManager.SetCulture (#766)

* Deprecate SetCulture

* Add EditorBrowsableState.Never

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Helpers/LocalizationResourceManager.shared.cs

* Fix obsolete warning in tests

* Remove unneeded line

* Use new LocalizationResourceManager for tests

Tests were failing from time to time because the same instance of LRM was used for all of them. And since tests are executed in parallel, this caused some issues

* Siplify impicit conversion test to test only conversion itself

* Return Invalidate mathod

Co-authored-by: Pedro Jesus <[email protected]>

* ShadowEffect (#725)

* #461

* Added mac support

* Added sample

* Updated shadows

* Fixed iOS crash

* removed pragma

* Remove effect when color if default

* cleaned code

* Implemented LazyView (#796)

* Created LazyView and implemented it on TabView

* Added Preserve attribute

* Update LazyTestView.xaml

* Adds Popup Control (#653)

* Ported Popup Control from xamarin/Xamarin.Forms#9616 to Xamarin Community Toolkit

* Added missing async/await api

* Added popup result sample and fixed uwp/android implementations

* Renamed View->Content

* Updated styles of sample popups

* Updated BorderColor to be a platform specific property for UWP

* Moved Android/iOS/UWP renderers to platform specific folders

* Changed PopupDismissedEventArgs so it is immutable

* Removed visual studio edits to sample android project

* Removed = false for isDisposed as it is default

* Normalized accessor properties for ios and uwp

* Removed performance apis since they are used internally at Xamarin.Forms

* Simplified OnElementChanged to use shared method ConfigureControl

* Removed iOS 9 code

* Updated NavigationExtensions to follow Xamarin Essentials style by adding netstandard impl that throws exception

* Added Control.Cleanup invocation to dispose method

* [iOS] Removed async/await from OnDismissed since it is an event the invocation doesn't need to know when it is complete

* Fixed comment

* Updated iOS to use WeakEventManager

* changed instantiation to use default(SizeRequest)

* ios - Changed WeakEventManager so it is a protected static object on the popup renderer. This will help create a weak reference to the popup delegate for the GC

* Moved sample popup code to new location

* Added WeakEventManager for BasePopup events (Opened, Dismissed)

* ios - changed popover delegate to use action

* Added PopOverDelegate.PopoverDismissed

* Updated accessor for LightDismiss to protected internal

* Updated comment in LightDismiss

* Removed stale iOS code

* Updated xml comments

* Removed obj dir from compilation in 'netstandard' projects and fixed debugger issues

* removed Init method and added code to get the Context

* changed accessor of ToolkitPlatform to internal

* Added new UI popup tests for Xaml binding vs C# binding

* Updated XCT xmlns to use uri instead of fully qualified namespace

* Added shared popup size across samples

* Fixed popup BindingContext not working when set in XAML

* Update Samples

- Capitalize x:Name variables
- Replace expression-bodied properties with read-only properties where applicable

* Add PopupDismissedEventArgs<T>

* Add Default Values for Color and Size

* Remove Unncessary `base` Keyword, per styling guide

* Optimize originX + originX, Add missing `await`

* Update PopupAnchorViewModel.cs

* Fix orignY

Copy/paste error

* Update PopupRenderer.ios.cs

* Update NavigationExtensions.netstandard.macos.tvos.watchos.tizen.wpf.gtk.cs

* Added NavigableElementExtension - This allows rendering popup from ContentPage and other children of NavigableElement

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Update BaseGalleryViewModel.cs

* Merging is hard

* Fix Anchor Popup Sample NRE (#834)

* Changed LoadView to be Async (#828)

* Changed LoadView to ValueTask LoadViewAsync and added summaries

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/LazyView/LazyView.shared.cs

* Popup out of the screen horizontally in Android sample (#839)

* Fix popup out of horizontal bounds

#653 (comment)

* Device Size dependent

* Essentials namespace

* revert

* [Android] Converting dimensions to pixels in popup renderer (#856)

* [Android] Converting dimensions to pixels in popup renderer

* Add fixed and relative to screen sizes instead of platform specific sizes.

* Update ButtonPopup size.

* Update CsharpBindingPopup size.

* Update MultipleButtonPopup size.

* Update NoLightDismissPopup size.

* Update OpenedEventSimplePopup size.

* Update ReturnResultPopup size.

* Update SimplePopup size.

* Update ToggleSizePopup size.

* Update TransparentPopup size.

* Update XamlBindingPopup size.

* #704 [Bug] No padding around text in a Toast or Snackbar (#714)

* Make ShieldView more customizable (#874)

* Add SubjectBackgroundColor, SubjectTextColor/reorganization.

* Update sample.

* Obsolete message

* Correct typo in comment

Co-authored-by: Gerald Versluis <[email protected]>

* Drop UpdateTextColor()

Co-authored-by: Gerald Versluis <[email protected]>

* fixed csproj to produce sourcelink (#893)

* [iOS] Remove popup arrow if anchor isn't set (#854)

* Remove popup arrow if anchor isn't set

* Create PopoverArrowDirection.cs

* Create Popup.shared.cs

* Add arrow direction platform specific.

* Add arrow direction platform specific sample.

* Rename PopoverArrowDirection.cs to PopoverArrowDirection.shared.cs

* Change ArrowDirection to up

* Remove switch PopoverArrowDirection.None since default is already zero.

* Use div 2 instead of multiply by 0.5 for consistency.

Co-authored-by: Sebastian Klatte <[email protected]>

* ProgressBar Attached Property to enable progress animation (#352)

* ProgressBar Attached Property to enable progress animation

* Fixes remarks on PR

* Fix remarks PR

* Changes need for new gallery viewmodel

* Correct version from before rebase

* Update AttachedPropertiesGalleryViewModel.cs

* Update ProgressBarAttachedProperties.shared.cs

* Update ProgressBarAttachedProperties.shared.cs

* Change Attached property to behavior

* Update samples/XCT.Sample/Xamarin.CommunityToolkit.Sample.csproj

Co-authored-by: Andrei <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/ProgressBarAnimationBehavior.cs

Co-authored-by: Andrei <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Xamarin.CommunityToolkit.csproj

Co-authored-by: Andrei <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/ProgressBarAnimationBehavior.cs

Co-authored-by: Cfun <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/AttachedProperties/ProgressBarAttachedProperties.shared.cs

Co-authored-by: Cfun <[email protected]>

* Remove old attached property and rename new behavior

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Cfun <[email protected]>

* Merge main into dev (#913)

* [Android] Fix Long Press blocks CollectionView selection  (#764)

* #760

* Moved helper methods to VisualElementExtensions

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs

Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>

* [Android] Fix SideMenuView + Slider issue (#824)

* [Android] Allow using slider inside SideMenu with disabled gestures

#810

* Refactored gesture default threshold
#810

* Cleaned code. Added linker safety code

* Fixed build

Co-authored-by: Javier Suárez <[email protected]>

* Automated dotnet-format update (#837)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Remove `Device` dependency from command implementation (#825) (#830)

* Remove `Device` dependency from command implementation (#804)

* Move Xamarin.CommunityToolkit.ObjectModel.Internals classes to `Internals` folder

* Add Platform-Specific MainThread Implementations, Update Unit Tests to Acommidate Context Switching

* Update BaseCommand.uwp.cs

* Add BaseCommand.wpf.cs

* Finish BaseCommand.gtk.cs

* Update BaseCommand.shared.cs

Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

* Automated dotnet-format update (#865)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fixes #859 (#864)

Co-authored-by: Gerald Versluis <[email protected]>

* ValidationBehavior: Added IsNotValid property (#836)

* Added IsNotValid property to validators

* small fix

* Updated sample

* #822 (#877)

* Fixes AvatarView - Valid source images dont load for the first time they are created  (#849)

* #805

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/AvatarView/AvatarView.shared.cs

Co-authored-by: Gerald Versluis <[email protected]>

* Fixed image loading

* Fixed null ref

* Fixes crashes

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Added inline docs (#882)

* Update ViewsGalleryViewModel.cs (#888)

removed duplicated text "used to"

* Document all behaviors and associated (#895)

* Housekeeping remove XamlCompilation from code-behind. (#897)

* Changed TabView SelectedIndex property to use TwoWay binding mode (#903)

* Add inline Docs/Comments to Converters (#907)

* Update azure-pipelines.yml

Co-authored-by: Andrei <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: WillAutioItrax <[email protected]>
Co-authored-by: Cfun <[email protected]>

* Add "Add(IEnumerable<T> collection)" to ObservableRangeCollection<T> (#891)

* Create ObservableRangeCollectionEx.shared.cs

* Add test

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Extensions/ObservableRangeCollectionEx.shared.cs

* Resolve comments

* Add AddToNullCollection test

* Fix WeakSubscribe parameter type

* Revert "Fix WeakSubscribe parameter type"

This reverts commit 221ee0f.

Co-authored-by: Andrei <[email protected]>

* Update INotifyPropertyChangedEx.shared.cs (#918)

* [Breaking Changes] ValidationBehavior Async checks support (#912)

* Refactored validation behavior

* Refactored to ValueTask

* added configure await false

* Fixed isRunning

* LifeCycleEvents (#674)

* Created LifeCycleEffect and platform implementations

* Added sample to LifeCycle effect

* refactor UnLoaded logic

* clean up csproj

* Fixed NRE for shell

* Code Review fixes

* code style

* improved the sample

* fixed tizen path

* Fixed iOS support

* Implemented WeakEventManager

* Added inline docs/comments

* changed to nameof

* Msbuild hotfix (#946)

* fixed msbuild instructions

* revert android sample csproj

* Add `Grouping` class from Refractored.MvvmHelpers (#957)

* Fix LocalizedString gets unsubscribed while still in use (#987)

* Fixed all the things

* Make PersistentObservableObject abstract

* Reverse the inheritance

* Commit to rerun tests

* Remove PersistentObservableObject

* Grammar

* Feature/371 enum boolean converter (#925)

* Implement EnumToBoolConverter (#371)

* Add example for EnumToBoolConverter

* Make it work with flagged enums (#371)

* Simplify code (#371)

* Make the method an local static method (#371)

* Cache enum type info (#371)

Co-authored-by: Eugen Richter <[email protected]>

* Add VSM to ValidationBehavior (#955)

* Add VSM to ValidationBehavior

* dumb commit: Re trigger CI

* Fix typo

* Fix typo

Co-authored-by: Andrei <[email protected]>

* Change string properties to public

* Apply Pascal Case Naming

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/Validators/ValidationBehavior.shared.cs

Co-authored-by: Andrei <[email protected]>

* Fix Singleton Pattern for LocalizationResourceManager (#919)

* Update LocalizationResourceManager.shared.cs

* Implement Lazy Loading for Thread Safety

* Fix Namespace

* Removed changes from main branch

* Revert Commit

* Update LocalizationResourceManager.shared.cs

* Fix Unit Tests

* Add Collection to LocalizationResourceManagerTests

The `Collection` attribute prevents these tests from running in parallel https://xunit.net/docs/running-tests-in-parallel.html

* [Enhancement] Add Scale support for SideMenuView (#1011)

* SideMenu scaling #1007

* Added easing

* Update azure-pipelines.yml

* [iOS] Fix missing binding context for popup view (#1003)

* [iOS] Fix missing binding context for popup view

* Fix handle binding context changes.

* Enable Nullable (#1009)

* Enable Nullable on Unit Tests (#1008)

* Enable Nullability on Xamarin.CommunityToolkit.Markup (#1013)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullability on Xamarin.CommunityToolkit.Sample (#1014)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullability for Android, GTK, iOS, Tizen, UWP & WPF Sample Projects (#1015)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Enable Nullability on Xamarin.CommunityToolkit (#1016)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Add Nullability

* Enable Nullable on XamarinCommunityToolkit (#1023)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Add Nullability

* Resolve Possible Null References

* Removed Possible Null References

* Update AppResources.Designer.cs

* Handle Nullability

* Updated Nullabiltiy

* Update Converters & Unit Tests

* Resolve MediaSource Unit Tests

* Fix Unit Tests (#1036)

* Enable Nullable on Unit Tests

* Enable Nullable on Xamarin.CommunityToolkit.Markup

* Enable Nullable on Xamarin.CommunityToolkit.Sample

* Enable Nullable on Android, GTK, iOS and Tizen Samples

* Enable Nullable for UWP & WPF Sample Projects

* Add Nullability

* Resolve Possible Null References

* Removed Possible Null References

* Update AppResources.Designer.cs

* Handle Nullability

* Updated Nullabiltiy

* Update Converters & Unit Tests

* Resolve MediaSource Unit Tests

* Fix VariableMultiValueConverter

* Fixed ImpliedOrderGridBehavior

* Update NumericValidationBehavior.shared.cs

* Resolve Nullable in SideMenuView

* Move <Nullable>enable</Nullable> to Directory.Build.props

* Update Xamarin.CommunityToolkit.Sample.csproj

* Revert Designer.cs

* Update Xamarin.CommunityToolkit.Sample.csproj

* Update ItemSelectedEventArgsConverter_Tests.cs

* Update SearchViewModel.cs

* Update ItemTappedEventArgsConverter_Tests.cs

* Update Xamarin.CommunityToolkit.UnitTests.csproj

* Add Nullability

* Resolve Compiler Warnings

* Ignore Closing square brackets should be spaced correctly

With Nullable enabled, `byte[]?` is now valid, however SA1011 was still generating a warning

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Behaviors/ImpliedOrderGridBehavior.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update CameraFragment.android.cs

* Update CameraFragment.android.cs

* Update ImpliedOrderGridBehavior.shared.cs

* Update MaskedBehavior.shared.cs

* Update PopupRenderer.uwp.cs

* Use .NET 5.0

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add UWP to Release Build

* Update Nullability

* Update Nullablity

* Update TabView.shared.cs

* Update Nullability

* Revert "Update Nullability"

This reverts commit e391b9c.

* Resolved Nullable

* Update azure-pipelines.yml

* Revert UWP Build Properties

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit 0842280.

* Update azure-pipelines.yml

* Revert "Revert UWP Build Properties"

This reverts commit 77226bf.

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit 4eb36f4.

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit e41a477.

* Fix ValidationBehavior.ForceValidate and ValidationBehavior.DefaultForceValidateCommand

* Update SelectAllTextEffect.ios.cs

* Remove Nullabilty from LocalizedString.generator

* Update MediaElementRenderer.ios.cs

* Update PopupRenderer.uwp.cs

* Update PopupRenderer.ios.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/Helpers/iOS/SnackbarViews/BaseSnackBarView.ios.cs

Co-authored-by: Maksym Koshovyi <[email protected]>

* Update TranslateExtension.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/SnackBar.android.cs

Co-authored-by: Maksym Koshovyi <[email protected]>

* Update Logic

* Fix Failing ICommand Tests

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/SnackBar.tizen.cs

Co-authored-by: Maksym Koshovyi <[email protected]>

* Throw Faulted Task

* Use Cast instead of Pattern Matching

* Update RangeSlider.shared.cs

* Fix missing semi-colons

* Throw InvalidOperationException in LocalizationResourceManager

* Make TranslateExtension.StringFormat nullable

* Update UserStoppedTypingBehavior.shared.cs

* Update SearchPage.logic.cs

* Update TouchEffectCollectionViewPage.xaml.cs

* Update AppResources.Designer.cs

* Update AppResources.Designer.cs

* Update EnumToBoolConverterViewModel.cs

* Update EnumToBoolConverter_Tests.cs

* Update IntToBoolConverter_Tests.cs

* Update InvertedBoolConverter_Tests.cs

* Update IsNotNullOrEmptyConverter_Tests.cs

* Update MultiConverter_Tests.cs

* Update NotEqualConverter_Tests.cs

* Update TextCaseConverter_Tests.cs

* Update MockPlatformServices.cs

* Update MockPlatformServices.cs

* Update Namespace_Tests.cs

* Update ObservableRangeCollection_Tests.cs

* Update ObservableRangeCollection_Tests.cs

* Use `async Task` instead of `async void`

* Update MultiValidationBehavior.shared.cs

* Update EnumToBoolConverter.shared.cs

* Update EnumToBoolConverter.shared.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/NotEqualConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/StateToBooleanConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update IconTintColorEffectRouter.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/SelectAllText/SelectAllTextEffect.android.cs

Co-authored-by: Pedro Jesus <[email protected]>

* Update SelectAllTextEffect.android.cs

* Update SelectAllTextEffect.ios.cs

* Update PlatformTouchEffect.ios.cs

* Update PlatformTouchEffect.uwp.cs

* Update PlatformTouchEffect.uwp.cs

* Update PlatformTouchEffect.macos.cs

* Update PlatformTouchEffect.uwp.cs

* Update PlatformTouchEffect.uwp.cs

* Ensure nullable results from BindableProperties are still resolved

* Update ImageResourceExtension.shared.cs

* Update BaseCommand.android.cs

* Use protected private constructor for BaseCommand

* Update BadgeView.shared.cs

* Update CameraFragment.android.cs

* Fix Android Media Bugs

* Update async/await

* Update CameraView_Tests.cs

* Update CameraView

* Update UriTypeConverter.shared.cs

* Update PopupRenderer.uwp.cs

* Update PopoverArrowDirection.shared.cs

* Update PopoverArrowDirection.shared.cs

* Update TabView.shared.cs

* Improve AsyncCommand Tests

* Ensure Context is non nullable

* Remove Missing Translations

* Fix async/await in TouchEffect.shared.cs

* Make Easing Nullable

* Update Samples

* Fix Null Exception

* Resolve NullReferenceExceptions

* Make IBadgeAnimation Nullable

* Add ShutterCommandValueCreator null check

* Add Timeout to prevent race conditions from stalling tests

* Unsubscribe Event Handlers for AsyncCommand Tests

* Update azure-pipelines.yml

* For WPF, Use Cross-Platform Implementation for `BaseCommand.IsMainThread` and `BaseCommand.BeginInvokeOnMainThread` (#965)

* Add Non-WPF Support to .NET Core 3.1

* Update comments

* Merge .NET Standard and WPF Functionality

* Fix Null Reference

* Update ICommand_AsyncValueCommand_Tests.cs

* Add volatile keyword

* Update AsyncValueCommand_Tests.cs

* Remove Timeouts

* Fix Event Unsubscription

* Add .ConfigureAwait(false);

* Run dotnet test serially

* Use SemaphoreSlim to prevent Race Conditions

Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: Maksym Koshovyi <[email protected]>

* add SetFocusOnEntryCompleted (#841) (#911)

* add SetFocusOnEntryCompleted (#841)

* prevent SetFocusOnEntryCompleted memory leak (#841)

also force exception if used on non-Entry

* cleanup (reuse variable) (#841)

* change to attached behavior SetFocusOnEntryCompletedBehavior

* remove AttachedBehaviors sub-namespace

* fix SetFocusOnEntryCompleted_Tests

* simplify SetFocusOnEntryCompletedBehaviorPage

* fixed code to be nullable safe

* code style

Co-authored-by: Pedro Jesus <[email protected]>

* #1046 (#1052)

* #1025 (#1042)

* Merge fixing

* Implement SafeFireAndForgetExtensions (#1054)

* Implement Safe-Fire-And-Forget

* Change `public` to `internal`

* Update PlatformTouchEffect.android.cs

* Regression #853 (#1063)

* [iOS] Fix popup default color and dark mode (#1041)

* [iOS] Fix popup default color and dark mode

* [Android] Set correct background for default color

* [Android] GetWindowColor() for popup background color

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/Android/PopupRenderer.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/Android/PopupRenderer.android.cs

* Update BasePopup.shared.cs

* Update PopupRenderer.android.cs

* Update PopupRenderer.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/BasePopup.shared.cs

Co-authored-by: Andrei <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

* Add remove border effect implementation for uwp (#1048)

Co-authored-by: Alexander Witkowski <[email protected]>

* Added long press event #851 (#1064)

* Update LocalizedString.shared.cs (#1071)

* Image resource converter (#1068)

* Implement ImageResourceConverter

* Add a sample for ImageResource extension

* Fix nullable errors

* Rename converter file to be compiled.

* Better exception message

Co-authored-by: Andrei <[email protected]>

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/ImageResourceConverter.shared.cs

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Update samples/XCT.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs

* Fix GalleryPage and VM

* Update samples/XCT.Sample/ViewModels/Extensions/ExtensionsGalleryViewModel.cs

Co-authored-by: Andrei <[email protected]>

* Update samples/XCT.Sample/ViewModels/Extensions/ExtensionsGalleryViewModel.cs

Co-authored-by: Andrei <[email protected]>

* Replace Exception approach by extension used by XF (#1028)

* Replace Exception approach by extension used by XF

* Simplified syntax as requested

* Add a missing namespace

* Resolve `IAsyncCommand` / `IAsyncValueValueCommand` Unit Test Race Condition (#1076)

* Add Unit Test Timeouts

* Add macOS Unit Tests

* Build 'samples/XCT.Sample.sln' on macOS

* Restore Unit Test NuGet Packages

* Fix YAML formatting

* Add xunit.runner.console

* Use latest stable version of Microsoft.NET.Test.Sdk

* Fix Unit Tests on macos

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add SemaphoreSlim

* Add `dotnet restore`

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Revert "Add SemaphoreSlim"

This reverts commit 6875865.

* Revert BaseCommand.semaphoreSlim

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add ConfigureAwait(false) to ValueTaskDelay(int)

* Change Platform from NetCore to macOS

* Passthrough ValueTask

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit d7b2842.

* Use ConfigureAwait(false)

* Rename Task

* Remove `static`

* Remove `static`

* Revert p:BuildInParallel=false

* Update azure-pipelines.yml

* Revert "Update azure-pipelines.yml"

This reverts commit bf93f0c.

* Revert "Revert "Update azure-pipelines.yml""

This reverts commit 031121a.

* Revert "Revert "Revert "Update azure-pipelines.yml"""

This reverts commit 458feb2.

* #1066 (#1078)

Co-authored-by: Brandon Minnick <[email protected]>

* fix badge background color (#1080) (#1081)

Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* allow TextCaseConverter to handle any value type (#1053)

* allow TextCaseConverter to handle any value type

* remove duplicate Convert method

* fix nullability

* update TextCaseConverter tests

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Converters/TextCaseConverter.shared.cs

Co-authored-by: Andrei <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* #850 (#1056)

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>

* Platform specific API (#949)

* added iOS platformSpecific

* added UWP platform specific

* Changed the sample

* code clean up

* added null check for Element

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>

* Add some null checks (#1033)

Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>

* Migrate Unit Tests to NUnit (#1090)

* Migrate to NUnit

* Update Tests

* Update Azure Pipelines

* Update TextCaseConverter_Tests.cs

* Update DateTimeOffsetConverter_Tests.cs

* Increase Timeout

* Increase Timeout

* Add `const int defaultTimeoutThreshold`

Co-authored-by: Gerald Versluis <[email protected]>

* Enable Nullable for Xamarin.CommunityToolkit.Markup.UnitTests (#1086)

* Add Markup Unit Tests

* Add Nullable to Xamarin.CommunityToolkit.Markdown.UnitTests

* Update BindingHelpers.cs

* Fix Failing Unit Tests

* Don't capture XUnit's Synchronization Context

* Re-order Unit Tests

* Revert "Don't capture XUnit's Synchronization Context"

This reverts commit b8b3f16.

Co-authored-by: Javier Suárez <[email protected]>

* Implement a generic version of the EventToCommandBehavior (#1010)

* created ECBGeneric

* Added Generic implemention to the EventToCommandBehavior

* make EventToCommandBehavior<TType> sealed

* Fixed for value types

* added nullable notations

* update the comment

* fixed unit test

* Migrate Unit Tests to NUnit

* Fixed unitTest

* changed to use C#9 features

* removed Convert method

* Add Inheritance Test

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

* [UWP] TouchEffect OnPointerReleased crash (#1088)

* Fixed TouchEffect UWP crash

* Touch Effect more nullRef fixes

* fixed build

* fix build

Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>

Co-authored-by: Joacim Wall <[email protected]>
Co-authored-by: joacim wall <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Pedro Jesus <[email protected]>
Co-authored-by: Maksym Koshovyi <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Andrew Hoefling <[email protected]>
Co-authored-by: Cfun <[email protected]>
Co-authored-by: Sebastian Klatte <[email protected]>
Co-authored-by: Vladislav Antonyuk <[email protected]>
Co-authored-by: Sebastian Klatte <[email protected]>
Co-authored-by: Glenn Versweyveld <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: WillAutioItrax <[email protected]>
Co-authored-by: tranb3r <[email protected]>
Co-authored-by: Jacob Egner <[email protected]>
Co-authored-by: Alexander Witkowski <[email protected]>
Co-authored-by: Alexander Witkowski <[email protected]>
Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Dan Siegel <[email protected]>

* Generate Mdoc documentation files (#932)

* First bits

* frameworks

* Try some more

* Fix

* Update to monikers

* Update targets

* Last fixes I swear

* Cleanup comments

* Fix path

* API Docs fixes

* Prevent mdoc from becoming dep

Co-authored-by: Brandon Minnick <[email protected]>

* Show initials if stream is empty (#1125)

#1120

* Init previousState field with LayoutState.None (#1122)

* Init previousState field with LayoutState.None

* make previousState non nullable

* Fix Expander crash when Direction changed (#1147)

#1144

* #1059 a photoOutput != null check taken off. Rebased to develop (#1119)

Co-authored-by: Janis Paraschidis <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>

* Update PULL_REQUEST_TEMPLATE.md

* Fix animation behavior fires command twice (#1162)

* #1099

* Added unit tests

* Fix MultiValidationBehavior overwrites external BindingContext bindings (#1163)

* #1153

* Update methods to adhere to the `bool Try...` pattern

Co-authored-by: Brandon Minnick <[email protected]>

* Fix CI Build Errors on Build Windows Samples job (#1173)

* Update azure-pipelines.yml

* Clean + Build

* Revert "Clean + Build"

This reverts commit e93ca82.

* Add `dotnet clean`

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* Add link

* Automated dotnet-format update (#1082)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Remove Invalid Documentation

* Update dependencies (#1174)

Co-authored-by: Brandon Minnick <[email protected]>

* Fix XCT fails build in F# projects (#1133)

* Add "shared" to file name

* Revert "Add "shared" to file name"

This reverts commit 8760ddd.

* Include PreserveXamarinCommunityToolkit only in csproj

* Add PreserveXamarinCommunityToolkit.fs

* Resolve comments

* Revert "Resolve comments"

This reverts commit 7be495f.

* Revert "Add PreserveXamarinCommunityToolkit.fs"

This reverts commit 403f20c.

Co-authored-by: Brandon Minnick <[email protected]>

* Add F# Project (#1181)

* fixed merge

* Remove Duplicate `netstandard` configuration

* Add Missing `[Obsolete]` and Nullable

* fixed unit test

* Fix `dotnet test` Release Configuration

Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Joacim Wall <[email protected]>
Co-authored-by: joacim wall <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: Maksym Koshovyi <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Andrew Hoefling <[email protected]>
Co-authored-by: Cfun <[email protected]>
Co-authored-by: Sebastian Klatte <[email protected]>
Co-authored-by: Vladislav Antonyuk <[email protected]>
Co-authored-by: Sebastian Klatte <[email protected]>
Co-authored-by: Glenn Versweyveld <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: Eugen Richter <[email protected]>
Co-authored-by: WillAutioItrax <[email protected]>
Co-authored-by: tranb3r <[email protected]>
Co-authored-by: Jacob Egner <[email protected]>
Co-authored-by: Alexander Witkowski <[email protected]>
Co-authored-by: Alexander Witkowski <[email protected]>
Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Matthew S <[email protected]>
Co-authored-by: Dan Siegel <[email protected]>
Co-authored-by: Janis Paraschidis <[email protected]>
@YZahringer YZahringer mentioned this pull request Nov 2, 2021
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/views This issue/PR is related to views p/android This issue impacts Android p/iOS iOS platform issue. UWP UWP platform issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Spec] Popup Control