-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WinUI] The property ContextMenu
was not found in type TaskbarIcon
#80
Comments
ContextMenu
was not found in type TaskbarIcon
ContextMenu
was not found in type TaskbarIcon
WinUI uses |
Thank for getting back so quickly! Though I still can't get it to work. I'm getting following error message when running:
I'm aware this is probably because I didn't define that resource nowhere. I searched the Internet and found some sample code for
<Application
x:Class="WinUITrayTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUITrayTest">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
<MenuFlyout x:Key="TrayMenu">
<MenuFlyoutItem Text="Red" Tag="red" />
<MenuFlyoutItem Text="Green" Tag="green"/>
</MenuFlyout>
<Border x:Key="TrayStatusPopup" Background="White" BorderBrush="Gray" BorderThickness="1" CornerRadius="3" Width="auto" Height="auto">
<StackPanel>
<Button Name="btnSetupTray" Content="Setup" Margin="5" Width="70"></Button>
<Button Name="btnExitTray" Content="Exit" Margin="5" Width="50"></Button>
</StackPanel>
</Border>
</ResourceDictionary>
</Application.Resources>
</Application> As for the last resource, I didn't define anything, because I just wanted to test it out quickly. So this exception appears when building the code:
Also, if I can suggest. Wouldn't it be much clearer if in the README it'd be specified that for WinUI 3 apps, the property Also, I think that it'd be very useful to include some sample code for all three resources: |
@symonxdd I thought to add examples for WinUI3 because I use it. |
There are two applications here as examples: |
Describe the bug
The XAML compiler gives following errors when using the template code from the README:
ContextMenu
on elementTaskbarIcon
ContextMenu
was not found in typeTaskbarIcon
Steps to reproduce the bug
Expected behavior
The app is supposed to compile / build fine.
Screenshots
NuGet package version
Microsoft.Windows.SDK.BuildTools
: v10.0.22621.755Microsoft.WindowsAppSDK
: v1.2.230217.4H.NotifyIcon.WinUI
: v2.0.93The
Microsoft.WindowsAppSDK
library needed to updated as instructed in the Error List view when trying to install this repo's libraryH.NotifyIcon.WinUI
Platform
WinUI
IDE
Visual Studio 2022
Windows Version
Windows 11
WindowsAppSDK Version
Other
WindowsAppSDK Type
Packaged
Manifest
I don't know what is meant by this, but I assume the content's of my
app.manifest
? I didn't change it.app.manifest
:Additional context
Here's my full MainWindow XAML -and code-behind code:
MainWindow.xaml
:MainWindow.xaml.cs
:The text was updated successfully, but these errors were encountered: