refactor: 将Framework库和RT、UI放在同一个解决方案中。

This commit is contained in:
SL
2026-06-01 17:48:28 +08:00
parent 1948f4290d
commit b73d39a6b1
4331 changed files with 506148 additions and 49363 deletions
@@ -0,0 +1,46 @@
// /************************************************************************
// * @file BrowserBehavior.cs
// * @author Su Liang
// * @date 2023/04/14
// *
// * @copyright &copy Sicentury Inc.
// *
// * @brief
// *
// * @details
// *
// *
// * *****************************************************************************/
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
namespace MECF.Framework.UI.Core.Behaviors
{
public class BrowserBehavior
{
public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached(
"Html", typeof(string), typeof(BrowserBehavior), new FrameworkPropertyMetadata(OnHtmlChanged));
[AttachedPropertyBrowsableForType(typeof(WebBrowser))]
public static string GetHtml(WebBrowser browser)
{
return (string)browser.GetValue(HtmlProperty);
}
public static void SetHtml(WebBrowser browser, string value)
{
browser.SetValue(HtmlProperty, value);
}
static void OnHtmlChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
var browser = dependencyObject as WebBrowser;
var html = e.NewValue.ToString();
Debug.WriteLine(html);
browser?.NavigateToString(html);
}
}
}