我正在使用 WpfNotifyIcon,我已将其声明为如下资源:
<Application x:Class="NotifyIconScratchPad2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tb="http://www.hardcodet.net/taskbar"
StartupUri="MainWindow.xaml">
<Application.Resources>
<tb:TaskbarIcon x:Key="MyNotifyIcon" IconSource="Icons/stopwatch_start.ico" ToolTipText="Hello world" >
<tb:TaskbarIcon.TrayToolTip>
<TextBlock x:Name="ChangeThis" Text="Hello world" />
</tb:TaskbarIcon.TrayToolTip>
</tb:TaskbarIcon>
</Application.Resources>
</Application>
为了使用它,我声明它MainWindow.xaml.cs
:
public TaskbarIcon tb;
public Window1 myWindow;
public MainWindow()
{
InitializeComponent();
tb = (TaskbarIcon) FindResource("MyNotifyIcon");
}
如何ChangeThis
从另一个窗口访问文本框?