Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ActivityIndicatorHandler in WinUI #761

Merged
merged 14 commits into from
May 18, 2021
Merged

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Implement ActivityIndicatorHandler in WinUI.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Adds the property to the appropriate interface
  • Avoids any changes not essential to the handler property
  • Adds the mapping to the PropertyMapper in the handler
  • Adds the mapping method to the Android, iOS, and Standard aspects of the handler
  • Implements the actual property updates (usually in extension methods in the Platform section of Core)
  • Tags ported renderer methods with [PortHandler]
  • Adds an example of the property to the sample project (MainPage)
  • Adds the property to the stub class
  • Implements basic property tests in DeviceTests

Does this PR touch anything that might effect accessibility?

No

element.SetBinding(GetForegroundProperty(element), binding);
}

internal static IEnumerable<T?> GetDescendantsByName<T>(this DependencyObject parent, string elementName) where T : DependencyObject
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
internal static IEnumerable<T?> GetDescendantsByName<T>(this DependencyObject parent, string elementName) where T : DependencyObject
internal static IEnumerable<T> GetDescendantsByName<T>(this DependencyObject parent, string elementName) where T : DependencyObject

return foregroundProperty;
}

internal static IEnumerable<T?> GetChildren<T>(this DependencyObject parent) where T : DependencyObject
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
internal static IEnumerable<T?> GetChildren<T>(this DependencyObject parent) where T : DependencyObject
internal static IEnumerable<T> GetChildren<T>(this DependencyObject parent) where T : DependencyObject

src/Core/src/Platform/Windows/MauiActivityIndicator.cs Outdated Show resolved Hide resolved
src/Core/src/Platform/Windows/MauiActivityIndicator.cs Outdated Show resolved Hide resolved
Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

I get a crash when try to run it .. added some other comments..

image

using System.Linq;
using System.Reflection;

namespace Microsoft.Maui
Copy link
Member

Choose a reason for hiding this comment

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

Do we want this public ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was internal in Xamarin.Forms, should we changed it?, any reason to not be public?

public static void UpdateIsRunning(this MauiActivityIndicator mauiActivityIndicator, IActivityIndicator activityIndicator)
{
// TODO: Use IView Opacity if the ActivityIndicator is running.
mauiActivityIndicator.ElementOpacity = activityIndicator.IsRunning ? 1 : 0;
Copy link
Member

Choose a reason for hiding this comment

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

No other way to do this? @PureWeen any ideas?


namespace Microsoft.Maui
{
public static class FrameworkElementExtensions
Copy link
Member

Choose a reason for hiding this comment

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

Do we want this to be public ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was internal in Xamarin.Forms, should we changed it?, any reason to not be public?

@jsuarezruiz
Copy link
Contributor Author

@rmarinho Fixed the issue you described.

@rmarinho
Copy link
Member

Seem to work fine,

image

Did some other comments

@rmarinho rmarinho self-requested a review May 18, 2021 16:59
@rmarinho rmarinho merged commit 4641d1d into main May 18, 2021
@rmarinho rmarinho deleted the winui-activityindicator branch May 18, 2021 16:59
lytico pushed a commit to lytico/maui that referenced this pull request May 20, 2021
* Implement ActivityIndicatorHandler in WinUI

* Fix build error

* Enable nullable in ActivityIndicatorExtensions

* Added nullable enable flag in WinUI ActivityIndicatorHandler

* Fix build error

* Apply suggestions from code review

Co-authored-by: Hadrian Tang <hadrianwttang@outlook.com>

* Fix merge

* Fixed ResourceDictionary error

* Move extensions to be internal

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Hadrian Tang <hadrianwttang@outlook.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2023
@samhouts samhouts added the fixed-in-6.0.100-preview.5 Look for this fix in 6.0.100-preview.5! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-6.0.100-preview.5 Look for this fix in 6.0.100-preview.5! platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants