Giter VIP home page Giter VIP logo

mdc-maui's Introduction

Material.Components.Maui

nuget

Documentation

mdc-maui.github.io/

The available controls

๐Ÿ˜„: ready ๐Ÿค”: unverified ๐Ÿ˜ญ: needs help

control android windows ios&mac
button ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
IconButton ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
Card ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
CheckBox ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
Chip ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
ComboBox ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜ญ
ContextMenu ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜ญ
FAB ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
Label ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
NavigationBar ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿค”
NavigationDrawer ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜ญ
Popup ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜ญ
ProgressIndicator ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
RadioButton ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
SplitView ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜ญ
Switch ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„
Tabs ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿค”
TextField ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜ญ
WrapLayout ๐Ÿ˜„ ๐Ÿ˜„ ๐Ÿ˜„

Contributing

Plan on contributing to the repository? We're glad to have you

Sponsor this project

If you like this project and want to support it, thanks!

mdc-maui's People

Contributors

hugovg avatar taublast avatar vhugogarcia avatar yiszza avatar ziomek64 avatar zzhorizonzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdc-maui's Issues

NavigationBarItems are not working properly after upgrading to 0.2.0 - preview

My code before upgrading the package:

<mdc:NavigationBar x:Name="bar" BackgroundColor="White">
<mdc:NavigationBarItem x:Name="home"
ActiveIndicatorColor="#ABB1D6"
IsActived="False"
BackgroundColour="Transparent" ActivedIconKind="Home" IconKind="Home" Text="Home" Clicked="HomeItem_Clicked">

    </mdc:NavigationBarItem>
    <mdc:NavigationBarItem x:Name="fav"
                           ActiveIndicatorColor="#ABB1D6"
                           BackgroundColour="Transparent"  ActivedIconKind="Star" IconKind="Star" Text="Favourites"   Clicked="FavItem_Clicked">
     
    </mdc:NavigationBarItem>
    <mdc:NavigationBarItem x:Name="menu"
                           ActiveIndicatorColor="Transparent"
                           BackgroundColour="Transparent"  ActivedIconKind="Menu" IconKind="Menu" Text="Menu" Clicked="MenuItem_Clicked">
    </mdc:NavigationBarItem>
</mdc:NavigationBar>

Screenshot:
image

After upgrade, i did the following changes:

<mdc:NavigationBar x:Name="bar" BackgroundColor="White">
<mdc:NavigationBarItem x:Name="home" FontSize="40"
IsActived="False" ActiveIndicatorColor="#ABB1D6"
BackgroundColor="Transparent" IconData="{Static icon:Material.Home}" FontFamily="Roboto" Text="Home" Clicked="HomeItem_Clicked">

 </mdc:NavigationBarItem>
 <mdc:NavigationBarItem x:Name="fav" ActiveIndicatorColor="#ABB1D6"
                        BackgroundColor="Transparent" IconData="{Static icon:Material.Star}" Text="Favourites" Clicked="FavItem_Clicked">
  
 </mdc:NavigationBarItem>
 <mdc:NavigationBarItem x:Name="menu"
                        ActiveIndicatorColor="Transparent"
                        BackgroundColor="Transparent" IconData="{Static icon:Material.Menu}" FontSize="50" Text="Menu" Clicked="MenuItem_Clicked">

 </mdc:NavigationBarItem>

</mdc:NavigationBar>

But the navigationbar not displaying properly, below is the screenshot:

image

What am i missing here? Please give some inputs on fixing up this.

Migrating to Microsoft.Maui.Graphics

Skiacanvasviewโ€™s performance lags behind native view, and it has poor fonts support, so I decided to Migrating to Microsoft.Maui.Graphics.

App crashes when I add <mdc:Button Text="button" IconKind="Add" /> to XAML file

For some reason, when I add <mdc:Button Text="button" IconKind="Add" /> to my MainPage.xaml file, the app crashes. Here are my files that I modified to import the project:
MauiProgram.cs

using Microsoft.Extensions.Logging;
using Material.Components.Maui.Extensions;


namespace MyFirstMauiApp
{
    public static class MauiProgram
    {
        public static MauiApp CreateMauiApp()
        {
            var builder = MauiApp.CreateBuilder();
            builder.UseMauiApp<App>().ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

            return builder.Build();
        }
    }
}

app.xaml

<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:MyFirstMauiApp"
             x:Class="MyFirstMauiApp.App">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/Styles/Colors.xaml" />
                <ResourceDictionary Source="Resources/Styles/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:mdc="clr-namespace:Material.Components.Maui;assembly=Material.Components.Maui"
             x:Class="MyFirstMauiApp.MainPage">

    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">

            <Button
                x:Name="CounterBtn"
                Text="Click me"
                SemanticProperties.Hint="Counts the number of times you click"
                Clicked="OnCounterClicked"
                HorizontalOptions="Center" />

            <mdc:Button Text="test"></mdc:Button>



        </VerticalStackLayout>
    </ScrollView>

</ContentPage>

When I run the program on "Windows Machine", it runs briefly, then redirects to App.g.i.cs file and highlights the global::System.Diagnostics.Debugger.Break(); line of code. Then no program appears.

So... My question: why does this happen and how can I just get the program to run? Am I missing a bit of code, or is my configuration bad? Or something else entirely?

Package does not work with Android in .NET8

Hello,

I tried installing the package but could not get my MAUI project to compile in .NET 8 when targetting Android, I systmatically get the following error:

Error XA8000 Could not find Android Resource '@styleable/SKCanvasView'. Please update @(AndroidResource) to add the missing resource.

No documentation for Tabs

I was trying to integrate the tabs into my MAUI project, but couldnt find documentation for the same.

Keyboard parameter not available in TextField

When using the Textfield it is not possible to provide a keyboard type for the TextField.

<Entry Keyboard="Numeric"/>

Or is there another way to have the appropriate keyboard show when entering the textfield?

Indicator is not redrawn when percent value is changed

In my app, I am using ProgressIndicator to display the progress. The Percent property of ProgressIndicator is bound to a property of my ViewModel. Whenever value of that property is changed, ProgressIndicator still displays initial progress, even though I see in debugger that new value was accepted by Percent property and OnPercentChanged method was triggered.
As for now I can work-around that issue by triggering OnPropertyChanged manually which causes ProgressIndicator to display valid progress, but it looks like a bug to me - it should be triggered automatically.
Please take a look at the pull request #20 which proposes a fix to this issue.

Bind Navigation Bar to a List

I want to fill my nav bar based on a DI injected list of every class that implements an interface.

I can't see any equivalent to ListView.ItemSource and ListView.ItemTemplate, so I've tried to do it like this:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:mdc="clr-namespace:Material.Components.Maui;assembly=Material.Components.Maui"
             xmlns:icon="clr-namespace:IconPacks.IconKind;assembly=IconPacks.Material"
             xmlns:main="clr-namespace:OpenEqiSports.Layouts.Main"
             x:Class="OpenEqiSports.MainLayout" x:DataType="main:MainLayoutViewModel">
    
    
    <ContentPage.Content>
        <mdc:NavigationBar Items="{Binding Items}"/>
    </ContentPage.Content>
</ContentPage>
public partial class MainLayout : ContentPage
{
    public MainLayout(MainLayoutViewModel viewModel)
    {
        BindingContext = viewModel;
        InitializeComponent();
    }
}

public class MainLayoutViewModel
{
    public List<NavigationBarItem> Items { get;  }

    public MainLayoutViewModel(IEnumerable<IModuleRootPage> moduleRootPages)
    {
        Items = GenerateNavigationBarItems(moduleRootPages);
    }

    private List<NavigationBarItem> GenerateNavigationBarItems(IEnumerable<IModuleRootPage> moduleRoots)
    {
        List<NavigationBarItem> items = moduleRoots.Select(moduleRoot => new NavigationBarItem { Text = moduleRoot.Title, IconData = moduleRoot.Icon }).ToList();
        return items;
    }
}

Stepping through, it seems like my item list is constructed correctly. However, when I hit InitializeComponent() in MainLayout my app bails out with this null ref exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor.SetPropertyValue(Object xamlelement, XmlName propertyName, Object value, Object rootElement, INode node, HydrationContext context, IXmlLineInfo lineInfo)
   at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor.Visit(ElementNode node, INode parentNode)
   at Microsoft.Maui.Controls.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Microsoft.Maui.Controls.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Microsoft.Maui.Controls.Xaml.XamlLoader.Visit(RootNode rootnode, HydrationContext visitorContext, Boolean useDesignProperties)
   at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, String xaml, Assembly rootAssembly, Boolean useDesignProperties)
   at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, String xaml, Boolean useDesignProperties)
   at Microsoft.Maui.Controls.Xaml.XamlLoader.Load(Object view, Type callingType)
   at Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml[MainLayout](MainLayout view, Type callingType)
   at OpenEqiSports.MainLayout.InitializeComponent() in /Users/james/repos/OpenEQiSports/src/OpenEqiSports/Microsoft.Maui.Controls.SourceGen/Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator/Layouts_Main_MainLayout.xaml.sg.cs:line 22
   at OpenEqiSports.MainLayout..ctor(MainLayoutViewModel viewModel) in /Users/james/repos/OpenEQiSports/src/OpenEqiSports/Layouts/Main/MainLayout.xaml.cs:line 15
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceIdentifier, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.Extensions.DependencyInjection.ServiceProvider.ServiceAccessor, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].GetOrAdd(ServiceIdentifier key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService(Type serviceType)
   at Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[IApplication](IServiceProvider provider)
   at Microsoft.Maui.MauiUIApplicationDelegate.FinishedLaunching(UIApplication application, NSDictionary launchOptions)
   at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 58
   at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94
   at OpenEqiSports.Program.Main(String[] args) in /Users/james/repos/OpenEQiSports/src/OpenEqiSports/Platforms/iOS/Program.cs:line 13

Looking at that, I can't really work out what the issue is...

My guess would be there's a bunch of required properties not being set on the item that would be filled with default values if they were in the xaml... So, I'm guessing I'm just diong this whole thing incorrectly.

How should I go about dynamically populating my NavigationBar?

Theming

How to change theme / change colors?

[Question]

Hi,
Thank you for the great library. I am planning to create my own library for .NET MAUI. Can I use this library as a base library? I am going to create .NET MAUI version of this WPF Library

NavigationBar in Shell

Is it possible to just replace the navbar in shell with the one in mdc-maui? I have my TabBar like this now -

    <TabBar Route="main">
        <Tab Title="Home" Icon="home.png">
            <ShellContent ContentTemplate="{DataTemplate Views:HomePage}" />
        </Tab>
        <Tab Title="Profile" Icon="user.png">
            <ShellContent ContentTemplate="{DataTemplate Views:ProfilePage}" />
        </Tab>
        <Tab Title="Anime" Icon="play_anime.png">
            <ShellContent ContentTemplate="{DataTemplate Views:AnimeListPage}" />
        </Tab>
        <Tab Title="Manga" Icon="read_manga.png">
            <ShellContent ContentTemplate="{DataTemplate Views:MangaListPage}" />
        </Tab>
        <Tab Title="Settings" Icon="settings.png">
            <ShellContent ContentTemplate="{DataTemplate Views:SettingsPage}" />
        </Tab>
    </TabBar>

So the tab bar is of route main and it contains 5 tabs/pages. I want to replace the look of it with the one in mdc-maui. I want to keep using shell. Btw, take a look here maybe dotnet/maui#15441

Material You color theme compatibility

Hi, I am a user of your mdc-maui library and I really appreciate your work.
I have a question: does your library support color sync with mobile devices that use Material You design system? Material You is a new design system that adapts the color scheme of the app to the wallpaper of the device, or can be set manually. I think it would be great if your library could also sync the color of the web app with the mobile device. Is this feature planned or already implemented? If not, do you have any suggestions on how to achieve this? Thank you for your time and attention.

IconKind breaking changes?

When I migrate to these

		<PackageReference Include="IconPacks.Material" Version="1.0.8737.1-build" />
		<PackageReference Include="Material.Components.Maui" Version="0.2.0-preview" />

The code is stop working, how to set the IconKind in c# now?

using IconPacks.Material;
using Material.Components.Maui;

namespace MAUIsland;

public interface IMaterialUIGalleryCardInfo : IGalleryCardInfo
{
    IconKind MaterialIcon { get; }
    List<PlatformInfo> SupportedPlatformsInfo { get; }
}

Card does not function with binding in data template

I have a CollectionView with a data template. In the data template I have a MDC Card. I cannot get bindings to function inside the DataTemplate for the card. Outside of the card in the DataTemplate, it works. I've tried adding Source="{x:Reference <many different components in the visual tree>}" but this also didn't work

Swapping the mdc:Card for a grid also works

Tested on Android A10 (emulator), A14 (physical device) and Windows 10.
MDC MAUI v0.2.1-preview
.NET 8

XAML

xmlns:mdc="clr-namespace:Material.Components.Maui;assembly=Material.Components.Maui"

<CollectionView
    Grid.Row="1"
    ItemsSource="{Binding SomeItemsCollection}">
    <CollectionView.ItemsLayout>
        <GridItemsLayout Orientation="Vertical" VerticalItemSpacing="5" />
    </CollectionView.ItemsLayout>
    <CollectionView.ItemTemplate>
        <DataTemplate>
        <VerticalStackLayout x:Name="vsl">
            <Label Text="{Binding Name}" /> <!-- Works -->
            <mdc:Card x:Name="card"
                Margin="5"
                Padding="5">
                <Grid>
                    <Label Text="{Binding Name}" /> <!-- Doesn't work -->
                    <Label Text="{Binding Name, Source={x:Reference vsl}" /> <!-- Doesn't work -->
                    <Label Text="{Binding Name, Source={x:Reference card}" /> <!-- Doesn't work -->
                </Grid>
            </mdc:Card>
        </VerticalStackLayout>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>
public partial class SomeItem: ObservableObject
{
    [ObservableProperty]
    private string _name;
}

VM

    [ObservableProperty]
    private ObservableCollection<SomeItem> _someItemsCollection = new ObservableCollection<SomeItem>();

    public SomeVM()
    {
         for (int i = 0; i < 100; i++)
         {
              var si = new SomeItem();
              si.Name = $"Name {i}";

              SomeItemsCollection.Add(si);
         }
    }

Code Behind View

 public partial class SomeView : ContentPage
 {
     public SomeView(SomeVM vm)
     {
         InitializeComponent();
         BindingContext = vm;
     }

MauiProgram

    ....
    builder.UseMaterialComponents();
    ....

[Microsoft.WindowsAppSDK = 1.3.230331000] TextField is not clickable/focusable

Currently a low priority bug

Exception thrown: 'SharpGen.Runtime.SharpGenException' in SharpGen.Runtime.dll An exception of type 'SharpGen.Runtime.SharpGenException' occurred in SharpGen.Runtime.dll but was not handled in user code HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is invalid.

In an application, e.g. MAUI using WindowsAppSDK 1.3.XYZ, it is impossible to click on the TextField. With Standard 1.2.XYZ. works correctly.
image

Error: System.NullReferenceException:** 'Object reference not set to an instance of an object.

Hello, firstly thank you for your beautiful plugin.
But I can not run my maui app with your plugin.

My Maui App package screenshots as following too.

image

And I am getting error as following.

Output Log

**System.NullReferenceException:** Object reference not set to an instance of an object.

[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.
[mono-rt]    at Material.Components.Maui.Extensions.CanvasExtension.DrawBackground(ICanvas canvas, IBackgroundElement element, RectF rect)
[mono-rt]    at Material.Components.Maui.ButtonDrawable.Draw(ICanvas canvas, RectF rect)
[mono-rt]    at Microsoft.Maui.Graphics.Platform.PlatformGraphicsView.Draw(Canvas androidCanvas) in D:\a\_work\1\s\src\Graphics\src\Graphics\Platforms\Android\PlatformGraphicsView.cs:line 74
[mono-rt]    at Android.Views.View.n_Draw_Landroid_graphics_Canvas_(IntPtr jnienv, IntPtr native__this, IntPtr native_canvas) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 16844
[mono-rt]    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 125
[mono-rt]    at Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualBooleanMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 20458
[mono-rt]    at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualBooleanMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 164
[mono-rt]    at Android.Views.ViewGroup.DrawChild(Canvas canvas, View child, Int64 drawingTime) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ViewGroup.cs:line 2839
[mono-rt]    at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.DrawChild(Canvas canvas, View child, Int64 drawingTime) in D:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\Android\ShellFlyoutRenderer.cs:line 172
[mono-rt]    at Android.Views.ViewGroup.n_DrawChild_Landroid_graphics_Canvas_Landroid_view_View_J(IntPtr jnienv, IntPtr native__this, IntPtr native_canvas, IntPtr native_child, Int64 drawingTime) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ViewGroup.cs:line 2824
[mono-rt]    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLJ_Z(_JniMarshal_PPLLJ_Z callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1, Int64 p2) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 323
[HostConnection] createUnique: call
[HostConnection] HostConnection::get() New Host Connection established 0x771419f3d4d0, tid 27087
[HostConnection] HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2 
`

Thank you in advance.

Need help!!!

Dear csharper:

If you have free time and want to contribute to mdc-maui, we are very much looking forward to your arrival. The most important work currently is:

  • IOS & MACCATALYST support.
  • The controls that have not yet been implemented.
  • The bugs that need to be fixed.
  • The documentation that needs to be kept up to date.

We need your help.

๐Ÿž Wraplayout crash application when set Spacing or HorizontalSpacing

Implementation

                    <mdc:WrapLayout
                        BindableLayout.ItemsSource="{x:Binding ComponentData.SupportedPlatformsInfo,
                                                               Source={x:Reference root}}"
                        HorizontalOptions="Start" 
                        Spacing="5"
                        VerticalOptions="Center">
                        <BindableLayout.ItemTemplate>
                            <DataTemplate x:DataType="app:PlatformInfo">
                                <Image
                                    HeightRequest="25"
                                    HorizontalOptions="Center"
                                    Source="{x:Binding Logo}"
                                    VerticalOptions="Center"
                                    WidthRequest="25" />
                            </DataTemplate>
                        </BindableLayout.ItemTemplate>
                    </mdc:WrapLayout>

Platforms

Windows: bug
Android: not tested
IOS: not tested
MacOS: not tested

Exception

Non-negative number required. (Parameter 'width')

Log

   at Windows.Foundation.Size..ctor(Single width, Single height)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.HorizontalStackLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCellsWithUnknowns()
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCells()
   at Microsoft.Maui.Layouts.GridLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.MeasureContent(IContentView contentView, Thickness inset, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.TemplatedView.Microsoft.Maui.IContentView.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer`2.GetDesiredSize(IPlatformViewHandler handler, Double widthConstraint, Double heightConstraint, Nullable`1 minimumSize)
   at Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer`2.GetDesiredSize(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer`2.Microsoft.Maui.IViewHandler.GetDesiredSize(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.TemplatedView.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCellsWithUnknowns()
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCells()
   at Microsoft.Maui.Layouts.GridLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.MeasureContent(IContentView contentView, Thickness inset, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.TemplatedView.Microsoft.Maui.IContentView.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.ContentPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.TemplatedView.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Material.Components.Maui.<WrapLayout>F18B24EE5785AB6A6442879F15BA99F4FECC04E2D7B65542222385381CE494BD6__WrapLayoutManager.HorizontalMeasure(Double widthConstraint, Double heightConstraint)
   at Material.Components.Maui.<WrapLayout>F18B24EE5785AB6A6442879F15BA99F4FECC04E2D7B65542222385381CE494BD6__WrapLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.VerticalStackLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCellsWithUnknowns()
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCells()
   at Microsoft.Maui.Layouts.GridLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.ScrollView.Microsoft.Maui.IContentView.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Handlers.ScrollViewHandler.InsetScrollView(Double widthConstraint, Double heightConstraint, Func`3 internalMeasure, IScrollView scrollView)
   at Microsoft.Maui.Handlers.ScrollViewHandler.<>c__DisplayClass22_0.<IncludeScrollViewInsets>b__0(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.ContentPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.ScrollView.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCellsWithUnknowns()
   at Microsoft.Maui.Layouts.GridLayoutManager.GridStructure.MeasureCells()
   at Microsoft.Maui.Layouts.GridLayoutManager.Measure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.LayoutPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.MeasureContent(IContentView contentView, Thickness inset, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Layouts.LayoutExtensions.MeasureContent(IContentView contentView, Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Controls.ContentPage.Microsoft.Maui.IContentView.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint)
   at Microsoft.Maui.Platform.ContentPanel.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)

ContextMenu only shows with long click

Tested on Android A10 (emulator), A14 (physical device) and Windows 10.

When using a context menu, it only will display if you long click on the icon, single clicks should expand the menu or there should be a property that allows either behavior
contextMenu

MDC MAUI v0.2.1-preview
.NET 8

xmlns:icon="clr-namespace:IconPacks.IconKind;assembly=IconPacks.Material"
xmlns:mdc="clr-namespace:Material.Components.Maui;assembly=Material.Components.Maui"
<mdc:IconButton
    BackgroundColor="Transparent"
    HorizontalOptions="Center"
    IconData="{Static icon:Material.MoreVert}"
    VerticalOptions="Center">
    <mdc:IconButton.ContextMenu>
        <mdc:ContextMenu>
            <mdc:MenuItem IconData="{Static icon:Material.Delete}" Text="Delete" />
            <mdc:MenuItem IconData="{Static icon:Material.Edit}" Text="Edit" />
            <mdc:MenuItem IconData="{Static icon:Material.ContentCopy}" Text="Copy" />
        </mdc:ContextMenu>
    </mdc:IconButton.ContextMenu>
</mdc:IconButton>

Context Menu and Combo box items don't appear on windows (works fine on android)

Hi thanks for this great package,

I tried to use combo box and context menu on windows (right click, left click and log press) but it shows nothing on windows.

I need your help with that

I used the sample xaml file as follows:

<ScrollView Padding="30,20">
    <VerticalStackLayout Spacing="15">
        <md:Label
            FontSize="18"
            HorizontalOptions="Start"
            Text="{OnIdiom Default=long press button  โ†“โ†“โ†“,
                           Desktop=right click button โ†“โ†“โ†“}" />

        <md:WrapLayout
            Padding="20"
            HorizontalSpacing="50"
            VerticalSpacing="15">
            <md:Button   
                IconKind="Menu"
                Text="button"
                VerticalOptions="Center">
                <md:Button.ContextMenu >
                    <md:ContextMenu  >
                        <md:MenuItem 
                            IconKind="Menu"
                            Text="item 1" />
                        <md:MenuItem  
                            IconKind="Menu"
                            Text="item 2" />
                        <md:MenuItem 
                            IconKind="Menu"
                            Text="item 3" />
                    </md:ContextMenu>
                </md:Button.ContextMenu>
            </md:Button>
            <md:IconButton IconKind="Menu" VerticalOptions="Center">
                <md:IconButton.ContextMenu>
                    <md:ContextMenu>
                        <md:MenuItem
                            Command="{Binding MenuItemClickedCommand}"
                            CommandParameter="{Binding Source={RelativeSource Self}, Path=Text}"
                            IconKind="Star"
                            Text="one" />
                        <md:MenuItem
                            Command="{Binding MenuItemClickedCommand}"
                            CommandParameter="{Binding Source={RelativeSource Self}, Path=Text}"
                            IconKind="Star"
                            Text="two" />
                        <md:MenuItem
                            Command="{Binding MenuItemClickedCommand}"
                            CommandParameter="{Binding Source={RelativeSource Self}, Path=Text}"
                            IconKind="Star"
                            Text="three" />
                    </md:ContextMenu>
                </md:IconButton.ContextMenu>
            </md:IconButton>
            <md:FAB IconKind="Settings" VerticalOptions="Center">
                <md:FAB.ContextMenu>
                    <md:ContextMenu>
                        <md:MenuItem
                            Command="{Binding MenuItemClickedCommand}"
                            CommandParameter="{Binding Source={RelativeSource Self}, Path=Text}"
                            IconKind="Park"
                            Text="item 1" />
                        <md:MenuItem
                            Command="{Binding MenuItemClickedCommand}"
                            CommandParameter="{Binding Source={RelativeSource Self}, Path=Text}"
                            IconKind="Park"
                            Text="item 2" />
                        <md:MenuItem
                            Command="{Binding MenuItemClickedCommand}"
                            CommandParameter="{Binding Source={RelativeSource Self}, Path=Text}"
                            IconKind="Park"
                            Text="item 3" />
                    </md:ContextMenu>
                </md:FAB.ContextMenu>
            </md:FAB>
        </md:WrapLayout>

        <md:Label
            FontSize="18"
            HorizontalOptions="Start"
            Text="{Binding TestString, Mode=TwoWay}" />
    </VerticalStackLayout>
</ScrollView>

Thanks

Java outofmemory

Am getting this error while launching.. please enlighten with basic steps...

Regards

๐Ÿž Textfield is not behave properly

What happened

I haven't had to fully text the TextField yet but this is what I'd pick up on Android Emulator. The input seems janky like in the video. The text won't show up until I paste the text from the clipboard and the TextField started to behave normally

Evidence

Implemetation

                <mdc:TextField
                    IconKind="Pets"
                    IsError="{x:Binding PetForm.PetNameValid}"
                    LabelText="Cung cแบฅp tรชn"
                    SupportingText="{x:Binding PetForm.PetNameInvalidMessage}"
                    Text="{x:Binding PetForm.PetName,
                                     Mode=TwoWay}" />

Platform tested

  1. Windows - fine ๐Ÿ‘๐Ÿฝ
  2. Android - issue happened ๐Ÿ’€

[enhancement Label] SearchBar with Suggestions and results.

I would like to thank you first for what you adding to the MAUI community.
I am really amazed by your library. I hope you find time to make some progress.
I believe MAUI needs it as a standard, like it was Material 2 in Xamarin.

I was wondering if there any plans in the future for the SearchBar control. with Suggestions and results. ( or even the avatars )
Until now i am using the TextField. With the icons i need.
I am trying to replicate the Search view as the Material 3 guidance.
I can replace it but i am not at the level of doing that with a seamless animation as the original.

Capture3

Any plans on implementing any of those two types?
Or the transition animation?

๐Ÿค” How can we set DynamicResource in style?

Scope

I'm currently working on cleaning up my XAML code by moving all properties to the Resources Group for better organization and reusability. However, I'm encountering an issue as shown in the example below:

    <mdc:Card
        HeightRequest="170"
        Style="{x:DynamicResource FilledCardStyle}"
        WidthRequest="350"/>

I would like to achieve the following result, but when I tried using BaseResourceKey and BasedOn, it caused the app to crash. Is there a way to achieve this?

 <ContentView.Resources>
        <<Style
            x:Key="MaterialUICardStyle"
            BaseResourceKey="{x:DynamicResource FilledCardStyle}"
            TargetType="mdc:Card">
            <Setter Property="HeightRequest" Value="170" />
            <Setter Property="WidthRequest" Value="350" />
        </Style>
    </ContentView.Resources>

    <mdc:Card
        Style="{x:StaticResource MaterialUICardStyle}"/>

Java.Lang.OutOfMemoryError

Hello
thanks for all your work

I am trying to use mdc.

  1. Created new maui project

  2. Install package from Nuget

  3. Added necessary things
    https://mdc-maui.github.io/getting-started

  4. Added label to the main page


       <mdc:Label Text="Login" />
    
     </VerticalStackLayout>
    

I am getting exception OutOfMemory, but without label on mainpage, app is running properly

thanks in advance

Support Commitment?

I like the look of this library a whole lot and I'm thinking of picking it up for a new project.

I'm just wondering what your feelings are regarding how committed you are to continuing development on it into the medium and long term?

Obviously, it's open source and I can't hold you to anything, but if you're already feeling like you've had enough, I might pick a different lib

Cheers!

Support for ICommand.CanExecute

Binding commands to the Command property of buttons should respect the ICommand.CanExecute(object?) method to determine if the command is executable, and use a different styling when CanExecute returns false.

Currently, buttons will still invoke the ICommand's behavior even if CanExecute returns false and does not use a different style.

.net 8 version

Hello,
When do you release .net 8 version or do we have to compile it ourselves? .net 8 released so it would be much appreciated.

iOS & macOS help

First, I would like to THANK YOU for this amazing repository. This is HUGE help because, if we have apps following Material You guidelines, this will help a lot to all of us as developers.

I downloaded the repository and noticed on the README.md that you are asking for help with iOS and macOS, I downloaded it locally on macOS and tried to compile it for macOS or iOS by adding the net7.0-ios;net7.0-maccatalyst to the .csproj file and I keep getting 4 errors that is preventing to run the sample app locally on iOS.

image

I believe you can find what our friend @jsuarezruiz did on his repository as experimental. Maybe even @jsuarezruiz can come here and provide some insights to solve the issue we are facing on iOS and macOS.

https://github.com/dotnet/Microsoft.Maui.Graphics.Controls

Controls don't respect FontFamily property

Hello, this package is great! However, I've noticed that the mdc controls do not respect the FontFamily property, which affects the look of my app.

Reproduction

  • Add a material control (e.g. mdc:Button)
  • Add FontFamily property to it
  • See that the font does not change

Expected behavior

  • The font changes according to the FontFamily property

Code

<VerticalStackLayout 
    Spacing="12" 
    VerticalOptions="Center">

    <!-- mdc button (doesn't work as expected) -->
    <mdc:Button 
        WidthRequest="256" 
        Text="Click me!" 
        FontFamily="RobotoRegular" />

    <!-- maui button (works) -->
    <Button 
        WidthRequest="256" 
        Text="Click me!" 
        FontFamily="RobotoRegular" />
</VerticalStackLayout>

Image

image

Elevated Button

<mdc:Button Style="{DynamicResource ElevatedButtonStyle}" Text="Elevated" />
image

Switch style broken after first toggle on Android

Still using 0.1.2-beta NuGet, but maybe someone has an idea why the Switch style is broken on Android after the first toggle. In the image below I toggle the switch two times and everything is fine on Windows. I included the default MAUI Switch for reference. When disabled, it seems to be "just" rotated 180ยฐ, but when re-enabled... well...

grafik

Tooltip not showing for IconButton

Hey,
Thanks for the great components for .NET MAUI.

Currently, I'm trying to use your package and I faced the issue that tooltip is not showing for the IconButton component.

<md:IconButton 
        Icon="Dot"
        ToolTipProperties.Text="Mark message as read"
        Command="{Binding Path=MarkAsReadCommand}"
        Style="{DynamicResource StandardIconButtonStyle}" />

Any idea what I'm doing wrong here?
Many thanks for any help.

Error: System.NullReferenceException:** 'Object reference not set to an instance of an object.

Hello, firstly thank you for your beautiful plugin. But I can not run my maui App. I am getting error as following.

My Maui App Pacakage like this

`System.NullReferenceException: 'Object reference not set to an instance of an object.'

System.NullReferenceException: 'Object reference not set to an instance of an object.'

System.NullReferenceException: 'Object reference not set to an instance of an object.'

[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.
[mono-rt] at Material.Components.Maui.Extensions.CanvasExtension.DrawBackground(ICanvas canvas, IBackgroundElement element, RectF rect)
[mono-rt] at Material.Components.Maui.ButtonDrawable.Draw(ICanvas canvas, RectF rect)
[mono-rt] at Microsoft.Maui.Graphics.Platform.PlatformGraphicsView.Draw(Canvas androidCanvas) in D:\a_work\1\s\src\Graphics\src\Graphics\Platforms\Android\PlatformGraphicsView.cs:line 74
[mono-rt] at Android.Views.View.n_Draw_Landroid_graphics_Canvas_(IntPtr jnienv, IntPtr native__this, IntPtr native_canvas) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.View.cs:line 16844
[mono-rt] at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 125
[mono-rt] at Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualBooleanMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 20458
[mono-rt] at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualBooleanMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:line 164
[mono-rt] at Android.Views.ViewGroup.DrawChild(Canvas canvas, View child, Int64 drawingTime) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ViewGroup.cs:line 2839
[mono-rt] at Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.DrawChild(Canvas canvas, View child, Int64 drawingTime) in D:\a_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\Android\ShellFlyoutRenderer.cs:line 172
[mono-rt] at Android.Views.ViewGroup.n_DrawChild_Landroid_graphics_Canvas_Landroid_view_View_J(IntPtr jnienv, IntPtr native__this, IntPtr native_canvas, IntPtr native_child, Int64 drawingTime) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.Views.ViewGroup.cs:line 2824
[mono-rt] at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLJ_Z(_JniMarshal_PPLLJ_Z callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1, Int64 p2) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 323
[HostConnection] createUnique: call
[HostConnection] HostConnection::get() New Host Connection established 0x771419f3d4d0, tid 27087
[HostConnection] HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
`

Typing into a TextField does not have the text appear

When I type into the text field, the keyboard acts as there is text because the word suggestions change, but no text appears in the field. Setting the text in XAML works, clicking on suggestions in the android keyboard works, and backspace removes the text, but actual typing does not have any text appear.

TextField with password

The TextField component cannot be set as a password type to hide the actual password characters and display them as asterisks instead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.