microsoft / XamlBehaviors

This is the official home for UWP XAML Behaviors on GitHub.
MIT License
692 stars 110 forks source link

Cannot install Microsoft.Xaml.Behaviors.WinUI.Managed package in WinUI UWP project #210

Open KarthikRajaAKR opened 3 years ago

KarthikRajaAKR commented 3 years ago

I'm trying to use behaviors in WinUI project, but unable to install Microsoft.Xaml.Behaviors.WinUI.Managed package in my WinUI UWP project. Installation cancelled with below error messages

image

My configuration are as follows IDE - VS 2019 v168.3 Minimum version - Windows 10.0 Build 17134 Target version - Windows 10.0 Build 19041

Ultimately I'm trying to achieve DataTriggers, Please let me know if there is some other package I can use in WinUI project.

KarthikRajaAKR commented 3 years ago

Hi Team,

In further I tried to use Microsoft.Xaml.Behaviors.UWP.Managed package, but I'm facing below issue with that

image

Please check and suggest a solution to use behaviors in the WinUI UWP project.

michael-hawker commented 3 years ago

@DVaughan @azchohfi is the min version of the package set too high compared to what WinUI 3 uses?

@KarthikRajaAKR if you raise the min-version of your app the specified 18362 in the error message, does it work? (Also, why are you trying to build a WinUI 3 UWP project instead of a regular UWP project or WinUI 3 Desktop project?)

azchohfi commented 3 years ago

The Behaviors SDK support for WinUI3 is the same as the Toolkit's, at least for now. We don't support UWP yet. You can't install the toolkit in a UWP WinUI3 app, and you can't use Microsoft.Xaml.Behaviors.WinUI.Managed. The UWP version is not WinUI3 based.

KarthikRajaAKR commented 3 years ago

Hi @michael-hawker, I'm working on custom controls under WPF and UWP platforms. Now we are checking the same with WinUI Desktop and UWP projects.

In WinUI UWP project we are facing this issue, and in WinUI desktop project element binding is not working with behaviors I've logged another issue regarding this. FYI Issue - 4057

michael-hawker commented 3 years ago

@KarthikRajaAKR you can see in the updated WinUI 3 Roadmap that "WinUI 3 in UWP apps" is still planned for a future update. In your matrix for comparing technology against WPF, it should just be on UWP today with WinUI 2.x, and then WinUI 3 Desktop.

Both WPF and WinUI 3 Desktop give you full access to the Win32 API suite, where as UWP will give you the sandbox for better privacy, security, and battery life for your users.

Both UWP+WinUI 2.x and WinUI 3 Desktop will give you access to the latest UX framework, styles, and controls. The Windows Community Toolkit will support both these technologies until WinUI 3 for UWP is supported and has support from our community.

Unfortunately, you've hit an issue in the current WinUI 3 preview, but hopefully it should be fixed in the future. For now anything UX/Behavior related you're trying to do, you can evaluate against the current UWP base. It will be comparable. The main advantage of moving to WinUI 3 now is if you need the Win32 access and to be outside the sandbox.

Noemata commented 3 years ago

@michael-hawker , suggestion, don't release a "prerelease" that has significant gaps in functionality, or change the nomenclature. Prerelease has always implied an early viewing of something that is likely to be fully functional. The old school "alpha" designation had a very clear meaning. "WinUI 3 in UWP" is alpha level at this stage. Such a designation makes it clear what can be expected. As tempting as it may be to bait adoption through naming, it winds up creating the wrong level of expectations.

tekrg commented 3 months ago

add value to collection of type microsoft.xaml.behaviours.behaviourcollection threw an exception