WPFを使ってシステムトレイへのアプリケーションを最小限にしたい。「NotifyIcon」がこの結果を達成する唯一の方法ですか? はいの場合、WPF で「NotifyIcon」を使用するために必要な名前空間はどれですか?
「NotifyIcon」で可能であれば、ヒントを提供してください。メインウィンドウでそれを使用するにはどうすればよいですか?
私のメインウィンドウは、
public partial class MonthView : MetroWindow
{
public DateTime SelectedDate { get; set; }
public MonthView()
{
InitializeComponent();
calMain.DisplayDate = DateTime.Today;
Globals._globalController = new AppController();
Globals._globalController.appTaskManager.setupLocal();
Globals._globalController.setMonthViewWindow(this);
}
public void calItemSelectedDate(object sender, SelectionChangedEventArgs e)
{
DateTime d;
if (sender is DateTime)
{
d = (DateTime)sender;
}
else
{
DateTime.TryParse(sender.ToString(), out d);
}
SelectedDate = d;
ShowActivity(d);
}
public void ShowActivity(DateTime date)
{
DayView Activity = new DayView(date);
Activity.Show();
this.Hide();
}
private void SetButton_Click(object sender, RoutedEventArgs e)
{
SettingsView set = new SettingsView();
set.Show();
this.Hide();
}
}