This is a migrated thread and some comments may be shown as answers.

NotifyIcon does not showing for Core project

6 Answers 79 Views
NotifyIcon
This is a migrated thread and some comments may be shown as answers.
Aleksey
Top achievements
Rank 1
Veteran
Iron
Aleksey asked on 25 Oct 2020, 10:05 AM

NotifyIcon does not showing for Core project with TargetFramework net452 or higher

TestNotifyIcon.csproj

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net452</TargetFramework>
    <UseWPF>true</UseWPF>
    <ApplicationIcon>Dashboard.ico</ApplicationIcon>
  </PropertyGroup>
  <ItemGroup>
    <None Remove="Dashboard.ico" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Telerik.Windows.Controls">
      <HintPath>..\Telerik.Windows.Controls.dll</HintPath>
    </Reference>
    <Reference Include="Telerik.Windows.Controls.Navigation">
      <HintPath>..\Telerik.Windows.Controls.Navigation.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Dashboard.ico" />
  </ItemGroup>
</Project>

MainWindow.xaml

<Window x:Class="TestNotifyIcon.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
  Title="MainWindow" Height="450" Width="800"
  x:Name="_this">
 <Grid>
  <TextBlock x:Name="MessageTextBlock"
       TextAlignment="Center"
       VerticalAlignment="Center"
       Text="Test"/>
  <telerik:RadNotifyIcon x:Name="NotifyIcon"
          ShowTrayIcon="True"
          TooltipContent="{Binding Title, ElementName=_this, Mode=OneWay}"
          TrayIconSource="/TestNotifyIcon;component/Dashboard.ico"
          PopupActivationMouseEvent="All"
          PopupContent="{Binding Text, ElementName=MessageTextBlock, Mode=OneWay}">
  </telerik:RadNotifyIcon>
 </Grid>
</Window>

6 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 28 Oct 2020, 02:16 PM

Hello Aleksey,

Thank you for the shared code snippet. 

Can you try setting the GuidItem property and let me know, if that helps? You can read some more about it in the Getting Started article. 

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Aleksey
Top achievements
Rank 1
Veteran
Iron
answered on 29 Oct 2020, 06:26 AM

 

 

Hello Vladimir,

I set GuidItem, but it did not help also

MainWindow.xaml

<Window x:Class="TestNotifyIcon.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow" Height="450" Width="800"
x:Name="_this">
<Grid>
<TextBlock x:Name="MessageTextBlock"
TextAlignment="Center"
VerticalAlignment="Center"
Text="Test"/>
<telerik:RadNotifyIcon x:Name="NotifyIcon"
ShowTrayIcon="True"
TooltipContent="{Binding Title, ElementName=_this, Mode=OneWay}"
TrayIconSource="/TestNotifyIcon;component/Dashboard.ico"
GuidItem="00000001-0002-0003-0004-000000000005"
PopupActivationMouseEvent="All"
PopupContent="{Binding Text, ElementName=MessageTextBlock, Mode=OneWay}">
</telerik:RadNotifyIcon>
</Grid>
</Window>

0
Vladimir Stoyanov
Telerik team
answered on 29 Oct 2020, 09:51 AM

Hello Aleksey,

Thank you for the updated.

I am attaching a sample project, which I prepared based on the shared description. On my end, the RadNotifyIcon is shown as intended with it. 

Can you try it out on your end and let me know how it goes?

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Aleksey
Top achievements
Rank 1
Veteran
Iron
answered on 30 Oct 2020, 04:51 AM

Hello Vladimir,

I tried your project - it's worked, the problem was in the GuidItem - need to use new guid ("00000001-0002-0003-0004-000000000005" is not working for me).

Thank you

0
Aleksey
Top achievements
Rank 1
Veteran
Iron
answered on 30 Oct 2020, 08:31 AM

Hello Vladimir,

Popup doesn't showing with current markup

MainWindow.xaml

<Window x:Class="TestNotifyIcon.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow"
Height="450"
Width="800">
<Grid>
<telerik:RadNotifyIcon x:Name="NotifyIcon"
GuidItem="020fea20-de2d-411f-87dd-111cd1e4f7fc"
PopupContent="Hello"
PopupActivationMouseEvent="All"
PopupCloseMode="Deactivate"
PopupShowDuration="3000"
ShowTrayIcon="True"
TrayIconSource="/TestNotifyIcon;component/SDK icon.ico">
<telerik:RadNotifyIcon.PopupContentTemplate>
<DataTemplate>
<Border Background="White">
<TextBlock Text="{Binding}" />
</Border>
</DataTemplate>
</telerik:RadNotifyIcon.PopupContentTemplate>
</telerik:RadNotifyIcon>
</Grid>
</Window>

0
Vladimir Stoyanov
Telerik team
answered on 03 Nov 2020, 10:46 AM

Hello Aleksey,

Thank you for the shared sample code. 

We are aware of this scenario and it is already logged in our feedback portal: NotifyIcon: The popup does not appear at the correct location under .Net Core.

For the time being, as a workaround, I can suggest manually opening the popup in the TrayIconMouseUp event. I am attaching the sample project updated to demonstrate a possible approach for your reference.

Hope this helps.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
NotifyIcon
Asked by
Aleksey
Top achievements
Rank 1
Veteran
Iron
Answers by
Vladimir Stoyanov
Telerik team
Aleksey
Top achievements
Rank 1
Veteran
Iron
Share this question
or