![](/img/trans.png)
[英]The type or namespace name 'Window' does not exist in the namespace 'System.Windows'
[英]WPF The type or namespace name 'Browser' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)
我目前將我的應用程序從Silverlight更改為WPF。 我有這段代碼,在wpf中給我一個錯誤。
我得到的錯誤是:
錯誤1類型或名稱空間名稱“瀏覽器”在名稱空間“ System.Windows”中不存在(您是否缺少程序集引用?)C:\\ Users \\ sahluwai \\ Desktop \\ cusControls2 \\ leitch \\ HarrisSilverlightToolkit \\ Toolkit \\ Source \\ Core \\ BaseComponents \\ HelpManager.cs 148 52 BaseComponents
private void OpenHelpFileForThisControl(Control passedControl)
{
if (passedControl != null)
{
//////////////////This line gives an error as System.windows.Brower is not present in wpf
string uriCurrent = System.Windows.Browser.HtmlPage.Document.DocumentUri.OriginalString;
if ((uriCurrent.LastIndexOf('/') + 1) < uriCurrent.Length)
{
uriCurrent = uriCurrent.Remove(uriCurrent.LastIndexOf('/') + 1);
}
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(uriCurrent + HTMLPrefix + ((string)passedControl.Tag)), "_blank");
}
}
所以現在的問題是我現在應該用什么替換它,以便在wpf中起作用
在WPF中,您應該使用System.Windows.Controls.WebBrowser而不是瀏覽器
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.