mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 01:25:45 -05:00
ADD Git attributes.
CHG End of line conversion.
This commit is contained in:
@@ -1,51 +1,51 @@
|
||||
<Window
|
||||
x:Class="Samples.Tutorials.Balloons.BalloonSampleWindow"
|
||||
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"
|
||||
Height="300"
|
||||
Width="300">
|
||||
<Grid>
|
||||
|
||||
<!-- the ToolTipText property is bound to the TextBox below -->
|
||||
<tb:TaskbarIcon
|
||||
x:Name="MyNotifyIcon"
|
||||
IconSource="/Icons/Error.ico"
|
||||
ToolTipText="Balloon Sample Icon" />
|
||||
<Button
|
||||
x:Name="btnShowStandardBalloon"
|
||||
Click="btnShowStandardBalloon_Click"
|
||||
Margin="26,74,29,0"
|
||||
Content="Show Standard Balloon" Height="29" VerticalAlignment="Top" />
|
||||
<Button
|
||||
x:Name="btnShowCustomBalloon"
|
||||
Click="btnShowCustomBalloon_Click"
|
||||
Margin="26,0,29,49"
|
||||
VerticalAlignment="Bottom"
|
||||
Height="27"
|
||||
Content="Show Custom Balloon" />
|
||||
<TextBlock
|
||||
Margin="26,26,24,0"
|
||||
VerticalAlignment="Top"
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap">
|
||||
<Run
|
||||
Language="de-ch"
|
||||
Text="Clicking on buttons shows balloon tips" />
|
||||
</TextBlock>
|
||||
<Button
|
||||
x:Name="btnHideStandardBalloon"
|
||||
Click="btnHideStandardBalloon_Click"
|
||||
Margin="26,113,29,122"
|
||||
Content="Hide Standard Balloon" />
|
||||
<Button
|
||||
x:Name="btnCloseCustomBalloon"
|
||||
Click="btnCloseCustomBalloon_Click"
|
||||
Margin="26,0,29,12"
|
||||
VerticalAlignment="Bottom"
|
||||
Height="27"
|
||||
Content="Close Custom Balloon" />
|
||||
|
||||
|
||||
</Grid>
|
||||
<Window
|
||||
x:Class="Samples.Tutorials.Balloons.BalloonSampleWindow"
|
||||
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"
|
||||
Height="300"
|
||||
Width="300">
|
||||
<Grid>
|
||||
|
||||
<!-- the ToolTipText property is bound to the TextBox below -->
|
||||
<tb:TaskbarIcon
|
||||
x:Name="MyNotifyIcon"
|
||||
IconSource="/Icons/Error.ico"
|
||||
ToolTipText="Balloon Sample Icon" />
|
||||
<Button
|
||||
x:Name="btnShowStandardBalloon"
|
||||
Click="btnShowStandardBalloon_Click"
|
||||
Margin="26,74,29,0"
|
||||
Content="Show Standard Balloon" Height="29" VerticalAlignment="Top" />
|
||||
<Button
|
||||
x:Name="btnShowCustomBalloon"
|
||||
Click="btnShowCustomBalloon_Click"
|
||||
Margin="26,0,29,49"
|
||||
VerticalAlignment="Bottom"
|
||||
Height="27"
|
||||
Content="Show Custom Balloon" />
|
||||
<TextBlock
|
||||
Margin="26,26,24,0"
|
||||
VerticalAlignment="Top"
|
||||
FontWeight="Bold"
|
||||
TextWrapping="Wrap">
|
||||
<Run
|
||||
Language="de-ch"
|
||||
Text="Clicking on buttons shows balloon tips" />
|
||||
</TextBlock>
|
||||
<Button
|
||||
x:Name="btnHideStandardBalloon"
|
||||
Click="btnHideStandardBalloon_Click"
|
||||
Margin="26,113,29,122"
|
||||
Content="Hide Standard Balloon" />
|
||||
<Button
|
||||
x:Name="btnCloseCustomBalloon"
|
||||
Click="btnCloseCustomBalloon_Click"
|
||||
Margin="26,0,29,12"
|
||||
VerticalAlignment="Bottom"
|
||||
Height="27"
|
||||
Content="Close Custom Balloon" />
|
||||
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,65 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace Samples.Tutorials.Balloons
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for BalloonSampleWindow.xaml
|
||||
/// </summary>
|
||||
public partial class BalloonSampleWindow : Window
|
||||
{
|
||||
public BalloonSampleWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||
MyNotifyIcon.Dispose();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
|
||||
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FancyBalloon balloon = new FancyBalloon();
|
||||
balloon.BalloonText = "Custom Balloon";
|
||||
|
||||
//show balloon and close it after 4 seconds
|
||||
MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000);
|
||||
}
|
||||
|
||||
private void btnHideStandardBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MyNotifyIcon.HideBalloonTip();
|
||||
}
|
||||
|
||||
|
||||
private void btnShowStandardBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string title = "WPF NotifyIcon";
|
||||
string text = "This is a standard balloon";
|
||||
|
||||
MyNotifyIcon.ShowBalloonTip(title, text, MyNotifyIcon.Icon);
|
||||
}
|
||||
|
||||
private void btnCloseCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MyNotifyIcon.CloseBalloon();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace Samples.Tutorials.Balloons
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for BalloonSampleWindow.xaml
|
||||
/// </summary>
|
||||
public partial class BalloonSampleWindow : Window
|
||||
{
|
||||
public BalloonSampleWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||
MyNotifyIcon.Dispose();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
|
||||
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FancyBalloon balloon = new FancyBalloon();
|
||||
balloon.BalloonText = "Custom Balloon";
|
||||
|
||||
//show balloon and close it after 4 seconds
|
||||
MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000);
|
||||
}
|
||||
|
||||
private void btnHideStandardBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MyNotifyIcon.HideBalloonTip();
|
||||
}
|
||||
|
||||
|
||||
private void btnShowStandardBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string title = "WPF NotifyIcon";
|
||||
string text = "This is a standard balloon";
|
||||
|
||||
MyNotifyIcon.ShowBalloonTip(title, text, MyNotifyIcon.Icon);
|
||||
}
|
||||
|
||||
private void btnCloseCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MyNotifyIcon.CloseBalloon();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user