[英]Is it possible to add hyperlink to WPF Window title?
我只是想知道是否可以將超鏈接添加到WPF窗口標題,並且是否有可能做到這一點的最佳方法是什么?
我想要這樣的標題:
程序名稱,版本以及指向我的網站的鏈接(例如http://mysite.com )
開箱即用不支持此功能。
但是,您可以使用“控制模板”來實現此目的或創建自己的整個自定義窗口。
您可以為窗口創建控件模板。 像這樣:
<Window.Template>
<ControlTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0">
<Hyperlink NavigateUri="http://mysite.com">
My Program, version 1
</Hyperlink>
</TextBlock>
<!-- Implement your own control box control -->
<ContentPresenter />
</Grid>
</ControlTemplate>
</Window.Template>
您還必須將窗口的樣式設置為“ None
,如下所示:
WindowStyle="None"
這也意味着您必須使用最小,最大化和關閉按鈕來實現自己的controlBox。
查看此鏈接以獲取更多信息:
http://www.codeproject.com/Articles/140267/Create-Custom-Windows-in-WPF-with-Ease
http://blog.magnusmontin.net/2013/03/16/how-to-create-a-custom-window-in-wpf/
祝好運
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.