mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 01:25:45 -05:00
-------------- Initial import git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@52 9f600761-6f11-4665-b6dc-0185e9171623
44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace Sample_Project
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for Window1.xaml
|
|
/// </summary>
|
|
public partial class Window1 : Window
|
|
{
|
|
public Window1()
|
|
{
|
|
InitializeComponent();
|
|
|
|
//set icon in code - setting the IconSource in XAML
|
|
//works just fine but breaks the VS designer
|
|
tb.Icon = Properties.Resources.Computers;
|
|
}
|
|
|
|
private void OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
if (tb.Visibility == System.Windows.Visibility.Visible)
|
|
{
|
|
tb.Visibility = System.Windows.Visibility.Collapsed;
|
|
}
|
|
else
|
|
{
|
|
tb.Visibility = Visibility.Visible;
|
|
}
|
|
}
|
|
}
|
|
}
|