diff --git a/WPF控件-7-Popup/App.xaml b/WPF控件-7-Popup/App.xaml new file mode 100644 index 0000000..9521693 --- /dev/null +++ b/WPF控件-7-Popup/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/WPF控件-7-Popup/App.xaml.cs b/WPF控件-7-Popup/App.xaml.cs new file mode 100644 index 0000000..1a25223 --- /dev/null +++ b/WPF控件-7-Popup/App.xaml.cs @@ -0,0 +1,12 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WPF控件_7_Popup; + +/// +/// Interaction logic for App.xaml +/// +public partial class App : Application +{ +} \ No newline at end of file diff --git a/WPF控件-7-Popup/AssemblyInfo.cs b/WPF控件-7-Popup/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/WPF控件-7-Popup/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] \ No newline at end of file diff --git a/WPF控件-7-Popup/MainWindow.xaml b/WPF控件-7-Popup/MainWindow.xaml new file mode 100644 index 0000000..a4c4d38 --- /dev/null +++ b/WPF控件-7-Popup/MainWindow.xaml @@ -0,0 +1,23 @@ + + + + 那年国破,皇上自缢,将军带着妻子出逃。行至十里镇,和妻子被伏兵暗算,双双中箭。香消玉殒前,妻子爬向他低语:“若来世你我皆为人,再做夫妻。若只你为人,我便做那每天陪你之物。”说罢气绝。“后来呢?”小和尚睁着眼问道。方丈默默地转着手串上那唯一的一颗念珠,青灯幽暗,不言不语。 + 这个有提示的 + + + + + + 小兔子画面生成 + 打开 + + + + + \ No newline at end of file diff --git a/WPF控件-7-Popup/MainWindow.xaml.cs b/WPF控件-7-Popup/MainWindow.xaml.cs new file mode 100644 index 0000000..26c91a6 --- /dev/null +++ b/WPF控件-7-Popup/MainWindow.xaml.cs @@ -0,0 +1,28 @@ +using System.Diagnostics; +using System.Windows; +using System.Windows.Documents; +using System.Windows.Input; + +namespace WPF控件_7_Popup; + +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + + private void ContentElement_OnMouseEnter(object sender, MouseEventArgs e) + { + PopupLink.IsOpen = true; + } + + private void Hyperlink_OnClick(object sender, RoutedEventArgs e) + { + var hyperlink = (Hyperlink)sender; + Process.Start(new ProcessStartInfo(hyperlink.NavigateUri.AbsoluteUri) { UseShellExecute = true }); + } +} \ No newline at end of file diff --git a/WPF控件-7-Popup/WPF控件-7-Popup.csproj b/WPF控件-7-Popup/WPF控件-7-Popup.csproj new file mode 100644 index 0000000..5c31b56 --- /dev/null +++ b/WPF控件-7-Popup/WPF控件-7-Popup.csproj @@ -0,0 +1,12 @@ + + + + WinExe + net8.0-windows + WPF控件_7_Popup + enable + enable + true + + + diff --git a/WPF控件.sln b/WPF控件.sln index 1b1434a..3425fd5 100644 --- a/WPF控件.sln +++ b/WPF控件.sln @@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-5-RadioButton", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-6-工具提示", "WPF控件-6-工具提示\WPF控件-6-工具提示.csproj", "{C7D48A55-D0A4-4C5C-BC04-FD9F0F39803F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF控件-7-Popup", "WPF控件-7-Popup\WPF控件-7-Popup.csproj", "{1C272D2C-BAC3-4D94-9491-E05B688B9A98}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -42,5 +44,9 @@ Global {C7D48A55-D0A4-4C5C-BC04-FD9F0F39803F}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7D48A55-D0A4-4C5C-BC04-FD9F0F39803F}.Release|Any CPU.ActiveCfg = Release|Any CPU {C7D48A55-D0A4-4C5C-BC04-FD9F0F39803F}.Release|Any CPU.Build.0 = Release|Any CPU + {1C272D2C-BAC3-4D94-9491-E05B688B9A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C272D2C-BAC3-4D94-9491-E05B688B9A98}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C272D2C-BAC3-4D94-9491-E05B688B9A98}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C272D2C-BAC3-4D94-9491-E05B688B9A98}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal