private static readonly DependencyProperty NotifyRequestProperty = DependencyProperty.Register( "NotifyRequest", // propertyName (определяется в XAML) typeof(NotifyRequestRecord), // propertyType typeof(NotifyIconWrapper), // ownerType (имя класса) new PropertyMetadata( // (PropertyChangedCallback propertyChangedCallback) (depObject, eventArg) => { NotifyRequestRecord record = (NotifyRequestRecord)eventArg.NewValue; ShowModifiedBallonTip(depObject, record); })); private static void ShowModifiedBallonTip(DependencyObject depObject, NotifyRequestRecord record) { ((NotifyIconWrapper)depObject)._notifyIcon?.ShowBalloonTip(record.Duration, record.Title, record.Text, record.Icon); } public class NotifyRequestRecord { public string Title { get; set; } = ""; public string Text { get; set; } = ""; public int Duration { get; set; } = 1000; public ToolTipIcon Icon { get; set; } = ToolTipIcon.Info; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)