0

I'm unable to use the DropDownButton in my UWP app. Is there an extension or reference that I need to use before the control name?

If not, is there an alternative of the control?
I can't use the ComboBox as I need the header text in the button, not above it.

3
  • By unable to use, what exactly do you mean? It's just not appearing? Have you addded Microsoft,UI,XAML to your toolbox? Commented Jun 28, 2019 at 11:45
  • @McNline I get the message "Dropdown button is not supported in UWP" Commented Jun 28, 2019 at 12:03
  • Set minimum version to 1809 Commented Jun 28, 2019 at 12:19

3 Answers 3

2

Set the target version to 1809 or higher or install the Windows UI Library.

Don't fortget to add <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/> to your Application.Resources as explained in the docs.

Or add xmlns:controls="using:Microsoft.UI.Xaml.Controls" at the top of your XAML file and then add the control using <controls:DropDownButton />.

Sign up to request clarification or add additional context in comments.

3 Comments

@BellaSwan: Did you add <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/> to your Application.Resources as explained in the docs? Or ` xmlns:controls="using:Microsoft.UI.Xaml.Controls"` at the top of your XAML file and then <controls:DropDownButton />?
May I know how to set the target version?
@BellaSwan: You get to select it when you create a new app. You can change it under Project->Properties->Application or by editing the .appxmanifest file.
1

You need to target the proper minimum version. It should work without any additional settings if you set the min target to Windows 10, version 1809.

4 Comments

WinUI provides backward compatibility.
@mm8 it still requires some min version, though different one.
Yes, the supported versions are listed in the docs. Upgrading to 1809 isn't required.
Also, it's the target version that determines which APIs that are available when building.
0

Set Minimum Target version to 1809

Right click on Toolbox -> Choose Items -> Microsoft.UI.XAML

You should just be able to drag and drop like normal.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.