Skip to content

Update Sample App for .NET MAUI Preview 14#329

Merged
TheCodeTraveler merged 8 commits intomainfrom
Update-Sample-App-for-Preview-14
Mar 18, 2022
Merged

Update Sample App for .NET MAUI Preview 14#329
TheCodeTraveler merged 8 commits intomainfrom
Update-Sample-App-for-Preview-14

Conversation

@TheCodeTraveler
Copy link
Copy Markdown
Collaborator

@TheCodeTraveler TheCodeTraveler commented Mar 17, 2022

Description of Change

This PR makes the following updates for CommunityToolkit.Maui.Samples following the release of .NET MAUI Preview 14:

  • Inject Microsoft.Maui.Essentials Interfaces
services.AddSingleton<IDeviceInfo, DeviceInfoImplementation>();
services.AddSingleton<IDeviceDisplay, DeviceDisplayImplementation>();
  • Remove Unnecessary Usings
  • Fix TextCaseConverterPage
  • Fix ColorsConverterPage
  • Fix ItemSelectedEventArgsPage
  • Fix ItemTappedEventArgsPage
  • Fix BoolToObjectConverterPage
  • Fix ListToStringConverterPage
  • Fix TransparentPopup
  • Fix TransparentPopupCSharp
  • Update Microsoft.WindowsAppSDK to v1.01

@TheCodeTraveler
Copy link
Copy Markdown
Collaborator Author

TheCodeTraveler commented Mar 17, 2022

I've opened this as a Draft PR because of the Flyout / Shell problems on iOS + MacCatalyst.

@pictos @VladislavAntonyuk - any thoughts on how to fix this? Or is this is a .NET MAUI Bug?

I tried setting different values of FlyoutWidth, but it always consumes the entire width of the screen on iOS + macOS.
(The background on macOS is black because I am running Dark Mode on my Mac)
Screen Shot 2022-03-17 at 4 08 01 PM

Edit: Confirmed to be a .NET MAUI bug dotnet/maui#5396

Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Base/BasePage.cs Outdated
Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Base/BaseGalleryPage.cs Outdated
Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Base/BaseGalleryPage.cs Outdated
public partial class XamlBindingPopup : Popup
{
public XamlBindingPopup() => InitializeComponent();
public XamlBindingPopup(PopupSizeConstants popupSizeConstants)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have one example without PopupSize?
What will happen if we don't set the size? I expect to see Medium size popup

namespace CommunityToolkit.Maui.Sample.Models;

static class PopupSizeConstants
public class PopupSizeConstants
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably it should be renamed because it is not Constant.
Can we make make it a configuration with predefined values?
So if I want to set custom size for all small popups, I need to change the config value only once. Example: https://github.com/xamarin/XamarinCommunityToolkit/blob/6a8c500ce087363cff0dd75514dcdf15de6f407d/src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/Options/ToastOptions.shared.cs#L19


static void RegisterEssentials(in IServiceCollection services)
{
services.AddSingleton<IDeviceInfo, DeviceInfoImplementation>();
Copy link
Copy Markdown
Contributor

@VladislavAntonyuk VladislavAntonyuk Mar 18, 2022

Choose a reason for hiding this comment

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

Does static DeviceInfo use the injected class or does it create a new instance?
DeviceInfo.Current == services.GetService<IDeviceInfo>???

TheCodeTraveler and others added 3 commits March 18, 2022 09:49
Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com>
…e.cs

Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com>
…e.cs

Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com>
@TheCodeTraveler TheCodeTraveler marked this pull request as ready for review March 18, 2022 17:05
@TheCodeTraveler TheCodeTraveler merged commit 1f409ae into main Mar 18, 2022
@delete-merged-branch delete-merged-branch bot deleted the Update-Sample-App-for-Preview-14 branch March 18, 2022 18:47
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants