_______ _ _ _ _ _ __ _ _ _ ___
|__ __| | | | | | | | (_)/ _(_) | | (_) |__
| | ___ __ _ ___| |_| | | ___ | |_ _| |_ _ ___ __ _| |_ _ ___ _ __ ___ __ __ ) |
| |/ _ / _` / __| __| . ` |/ _ | __| | _| |/ __/ _` | __| |/ _ | '_ / __| / // /
| | (_) | (_| __ |_| | | (_) | |_| | | | | (_| (_| | |_| | (_) | | | __ V // /_
|_|___/ __,_|___/__|_| _|___/ __|_|_| |_|_____,_|__|_|___/|_| |_|___/ _/|____|
ToastNotifications ช่วยให้คุณสร้างและแสดงการแจ้งเตือนที่หลากหลายในแอปพลิเคชัน WPF มันสามารถกำหนดค่าได้สูงด้วยชุดของตัวเลือกในตัวเช่นตำแหน่งพฤติกรรมธีมและอื่น ๆ อีกมากมาย มันขยายได้มันช่วยให้คุณมีความเป็นไปได้ที่จะสร้างการแจ้งเตือนแบบกำหนดเองและแบบโต้ตอบในลักษณะง่ายๆ
รหัสตัวอย่าง
toastnotifications และ toastnotifications.messages
Install-Package ToastNotifications
Install-Package ToastNotifications.Messages
ToastNotifications v2 เป็นปลั๊กอินที่มุ่งเน้น
Nugget "ToastNotifications" เป็นแกนหลักซึ่งมีกลไกหลักเฉพาะสำหรับการสร้างและแสดงการแจ้งเตือน ข้อความที่กำหนดไว้ล่วงหน้าและฟังก์ชันอื่น ๆ ที่ไม่สำคัญนั้นจัดทำโดยนักเก็ตแยกต่างหาก
Nugget ToastNotifications.Sessages มีข้อความพื้นฐานเช่นข้อผิดพลาดข้อมูลคำเตือนความสำเร็จ ไม่จำเป็นต้องใช้ในกรณีที่คุณต้องการสร้างข้อความของคุณเอง
< Application .Resources>
< ResourceDictionary >
< ResourceDictionary .MergedDictionaries>
< ResourceDictionary Source = " pack://application:,,,/ToastNotifications.Messages;component/Themes/Default.xaml " />
</ ResourceDictionary .MergedDictionaries>
</ ResourceDictionary >
</ Application .Resources> using ToastNotifications ;
using ToastNotifications . Lifetime ;
using ToastNotifications . Position ;
/* * */
Notifier notifier = new Notifier ( cfg =>
{
cfg . PositionProvider = new WindowPositionProvider (
parentWindow : Application . Current . MainWindow ,
corner : Corner . TopRight ,
offsetX : 10 ,
offsetY : 10 ) ;
cfg . LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor (
notificationLifetime : TimeSpan . FromSeconds ( 3 ) ,
maximumNotificationCount : MaximumNotificationCount . FromCount ( 5 ) ) ;
cfg . Dispatcher = Application . Current . Dispatcher ;
} ) ; using ToastNotifications . Messages ;
/* * */
notifier . ShowInformation ( message ) ;
notifier . ShowSuccess ( message ) ;
notifier . ShowWarning ( message ) ;
notifier . ShowError ( message ) ; /* * */
notifier . Dispose ( ) ; บันทึกย่อของ Relesae Notes, คำอธิบายของคุณสมบัติใหม่, การแก้ไขข้อผิดพลาดและการเปลี่ยนแปลงการเปลี่ยนแปลง
การอัพเกรดจาก V1 ToastNotifications V2 เป็นการใช้งานใหม่อย่างสมบูรณ์และไม่สามารถประกอบกับเวอร์ชัน 1 ได้ตามคำแนะนำการโยกย้ายเพื่ออัพเกรดเป็นเวอร์ชันใหม่
การกำหนดค่า toastNotifications v2 มีตัวเลือกการกำหนดค่ามากมายสำหรับตำแหน่งอายุการใช้งานข้อความและอื่น ๆ อีกมากมายเอกสารนี้อธิบายทั้งหมด
การสร้างการแจ้งเตือนที่กำหนดเองเอกสารนี้อธิบายถึงวิธีการสร้างการแจ้งเตือนของคุณเอง
แอสเซมบลีที่มีชื่ออย่างยิ่งมีการลงนามประกอบ V2 Assembies อ่านเอกสารนี้สำหรับรายละเอียดเพิ่มเติม
Andy Li (https://github.com/oneandy)
B. Micka (https://github.com/b-mi)
Cuiliang (https://github.com/cuiliang)
Braincrumbz (https://github.com/braincrumbz)
Fischjoghurt (https://github.com/fischjoghurt)
Francois Botha Igitur (https://github.com/igitur)
Jan M. (https://github.com/pantheas)
Johannes Jidel (https://github.com/jidel)
Kostiandynn (https://github.com/dualbios)
Krzysztof Zmorzyński (https://github.com/zmorzynskik)
Robin Krom Lakritzator (https://github.com/lakritzator)
Uwy (https://github.com/uwy)
William David Cossey (https://github.com/wdcossey)
ก่อนที่คุณจะสร้างปัญหาใหม่โปรดตรวจสอบเอกสารเนื่องจากมีคุณสมบัติและตัวเลือกมากมายอยู่แล้ว (https://github.com/raflop/toastnotifications/tree/master-v2/docs)
หากยังมีปัญหาโปรดสร้างปัญหา/คำถามใหม่การกรอกข้อมูลต่อไปนี้ หากเป็นไปได้โปรดระบุรหัสตัวอย่างเพื่อทำซ้ำปัญหา