Forum Widgets
Latest Discussions
Is it normal for CollectionView to lag on larger lists, or am I missing an optimizaiton ?
I've been working with .NET MAUI recently and have run into some performance concerns when using CollectionView. Specifically, when binding a large dataset ( let's say 500+ items), the scrolling becomes noticeably sluggish, especially on Android I've tried a few basic optimizations, like setting CachingStrategy = "RecycleElement" and minimizing the complexity of the DataTemplate, but the lag persists . I'm not using images or heavy UI elements either, it's just a simple text-based item template. is this kind of lag expected with MAUI's CollectionView or is there a known workaround ? Are there additional performance tuning steps I should try ( virtualization tricks, async loading, grouping) ?SolvedBonillaAug 07, 2025Iron Contributor115Views7likes2CommentsIs clean architecture overkill for small teams maintaining a single web app ?
I've been exploring clean architecture and while I appreciate its separation of concerns and testability, I can't help but wonder, it is over for small teams ( say 2-4 devs) maintaining a single, relatively stable web application ? Implementing clean architecture means more layers, more interfaces, and potenitally more ceremony, which might slow things down, especially if the team is trying to move quickly or lacks deep experience with the pattern. At the same time, I get the value of long-term maintainability and scalability, even for small projects that could grow. What pain points or benefits did you encounter ? Did it help or hinder onboarding, testing or refactoring ?SolvedJohnDobbinsAug 07, 2025Iron Contributor104Views5likes2CommentsUnique Device Identifier in MAUI
I am looking for a way to get a device identifier in NET MAUI that is cross platform compliant between Android/iOS/Windows. I originally had this code working in Xamarin Forms with the following: Android Context context = Application.Context; id = Settings.Secure.GetString(context.ContentResolver, Settings.Secure.AndroidId); iOS UIDevice.CurrentDevice.IdentifierForVendor.AsString().Replace("-", ""); Is there anything currently or planned in the future for use in NET MAUI. Thanks In Advance, Stuart FergusonStuartFerguson1980Mar 14, 2022Copper Contributor11KViews3likes1CommentWPF: Project doesn't find its own Classes ("tag not found in namespace")
Hi there, I've got a problem that's driving me crazy: c# WPF Custom Controls Project (NET 7), Base Namespace "UserControls". All the controls, styles and Converters existing in the project are in that namespace (I tripple checked, it's the only namespace used). All the controls and Converters are public classes. In the project, there is a Class named "EqualityToBooleanConverter.cs" Additionally, there is a Style file called Button.xaml. I need to use the aforementioned converter here, so I am referencing it like this: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:UserControls;assembly=UserControls"> <local:EqualityToBooleanConverter x:Key="ETBConverter" /> Intellisense does find the Namespace "UserControls", in fact, the namespace declaration AND the ressource declaration was done using intellisense. BUT as soon as I compile the project, the following error pops up: MC3074 - type "EqualityToBooleanConverter" does not exist in "clr-namespace:UserControls;assembly=UserControls" I just don't get it, as I said, all the files are in the same project, and they are - as of now - all using the root namespace "UserControls". Everything is fine until I start compiling. What I have tried so far: removing the "assembly"-part of the namespace-declaration changing the compile target from AnyCPU to x86 and back cleaning the solution creating a new solution, and re-adding all the files to it Also noteworthy: The same problem occurs when I try using one of the Usercontrols in that project WITHIN the project itself (like: creating a Window.xaml, defining the local-namespace, and trying to add the control leads to the same error as soon as I compile). I don't know what else could cause this...does anyone have any idea?SneetsAug 09, 2023Copper Contributor4.4KViews2likes5CommentsCan we use Maui.Essentials without Maui UI framework?
Previously Xamarin.Essencials was an independed library that could be used with non-XamarinForms applications. Currently this library was rebranded into Maui.Essentials. Which raises a question, if this library become a part of Maui framework with hard dependency on it, or if it still can be used without this GUI framework. I don't see any references to the Maui framework at the moment except Microsoft.Maui.Graphics. Still, I want to see official confirmation stated somewhere. Use cases: 1. We want to be able to build Avalonia applications and use helpers from Maui.Essentials without referencing whole Maui framework. 2. Same about Uno Platform. It should be possible to use it with Maui.Essentials without Maui framework. 3. I also can imagine applications that are built with "net6-ios/android" targets with native UIs without "Forms" from MAUI. These applications will benefit from Maui.Essentials without unnecessary dependency from Maui framework. Thanks, Max Katsydan.maxkatz6Apr 05, 2022Copper Contributor3.7KViews2likes2CommentsHow to decouple views from view models using CommunityToolKit.mvvm
I am writing my first MVVM app using CommunityTookit.mvvm. I am using as reference the Micrsoft Learning link https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/ioc. This link shows the setting of the viewmodel to the view DataContext using the following statement in the view's .cs file: this.DataContext = App.Current.Services.GetService<ContactsViewModel>(); The problem with this as I see it is that this statement couples the view to the view model, in this case ContactsViewModel. This means that in another app the view cannot be used with another viewmodel without modifying the view, i.e. changing ContactsViewModel above to another viewmodel type. This means that the view cannot be stored in a common library that is shared among different apps. There is a C# Corner example with the older MVVM TookKit that solved this problem using a ViewModelLocator class. This project is found https://www.c-sharpcorner.com/article/getting-started-with-mvvm-light-with-wpf/. The solution is to put the following code in the view's XAML file: DataContext="{Binding Main, Source={StaticResource Locator}}" The source object for the binding is found by looking for a ResourceDictionary that is in the scope of the view and which has an entry whose key is "Locator". In app.xaml which by definition is always in scope we have: <Application.Resources> <ResourceDictionary> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> </ResourceDictionary> </Application.Resources> The Dictionary element with key "Locator" is an object of type ViewModelLocator. In the ViewModelLocator class there is a Main property that always returns an instance of MainViewModel: public MainViewModel Main { get { return ServiceLocator.Current.GetInstance<MainViewModel>(); } } In our example, the view's DataContext binds to the Main property of the ViewModelLocator object. The value of the Main property is a MainViewModel object and this becomes the DataContext of the view. We can now in a different app re-use the view without changing it. All we have to do in the next app is to create a different ViewModelLocator object that specifies a different viewmodel in its Main property. The view is now completely decoupled from the view model. My question is, how would we de-couple the view from the view model using the CommunityToolkit.Mvvm? Do we also use a ViewModelLocator class? Is there a more elegant way with dependency injection? Another question I have is, suppose we want to use in one app the same view twice with different view models. An example of where we might want to do this is if we had a view that displayed a chart. It is conceivable that we might want to have more than one view model display its data using the same chart view. I cannot see how to do this in either of the above Microsoft or C# Corner examples.CSharpDevJul 12, 2025Copper Contributor100Views1like0CommentsSendKeys on the WinKeys button
I have looked at MS's list of available send keys on their site, but they don't seem to have one listed for the actual Windows Key. The only solution I found was.... SendKey.Send("^{ESC}") However, the key strokes to show the desktop is Winkey+D But, I can't seem to make using the ^{ESC} work with the letter "D" SendKey.Send("^{ESC}(d)") All I get is the Start menu popping up. So, exactly how do I simulate "Winkey+D" with SendKeys??? Any input will be greatly appreciatedPixel-InkJun 20, 2023Copper Contributor1.2KViews1like5Comments
Resources
Tags
- .NET MAUI155 Topics
- Windows Forms63 Topics
- android55 Topics
- ios39 Topics
- Xamarin.Forms34 Topics
- Blazor32 Topics
- Console Apps30 Topics
- WPF30 Topics
- UWP18 Topics
- macos17 Topics