mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-16 17:28:43 -05:00
WPF NotifyIcon
-------------- Initial import git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@52 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
43
Source/Sample Project/Window1.xaml.cs
Normal file
43
Source/Sample Project/Window1.xaml.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user