首次提交:添加src文件夹代码
This commit is contained in:
26
Cowain.Bake.UI/Helper/Views/AboutWindowView.xaml
Normal file
26
Cowain.Bake.UI/Helper/Views/AboutWindowView.xaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<UserControl x:Class="Cowain.Bake.UI.Helper.Views.AboutWindowView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Cowain.Bake.UI.Helper.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<DockPanel Margin="0">
|
||||
<!-- 标题 & 版本 -->
|
||||
<TextBlock DockPanel.Dock="Top" FontSize="18" FontWeight="SemiBold"
|
||||
Text="{Binding Heading}" Margin="0 0 0 10"/>
|
||||
|
||||
<TextBlock DockPanel.Dock="Top" FontSize="18" FontWeight="SemiBold"
|
||||
Text="{Binding WindowTitle}" Margin="0 0 0 10"/>
|
||||
<!-- Release Notes -->
|
||||
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto">
|
||||
|
||||
<TextBlock Text="{Binding Notes}"
|
||||
TextWrapping="Wrap"
|
||||
FontFamily="Consolas" FontSize="16"/>
|
||||
</ScrollViewer>
|
||||
|
||||
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
28
Cowain.Bake.UI/Helper/Views/AboutWindowView.xaml.cs
Normal file
28
Cowain.Bake.UI/Helper/Views/AboutWindowView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Cowain.Bake.UI.Helper.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// AboutWindowView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AboutWindowView : UserControl
|
||||
{
|
||||
public AboutWindowView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Cowain.Bake.UI/Helper/Views/HelpWindowView.xaml
Normal file
14
Cowain.Bake.UI/Helper/Views/HelpWindowView.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<UserControl x:Class="Cowain.Bake.UI.Helper.Views.HelpWindowView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Cowain.Bake.UI.Helper.Views"
|
||||
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
<Grid>
|
||||
<WebBrowser x:Name="webBrowser"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
31
Cowain.Bake.UI/Helper/Views/HelpWindowView.xaml.cs
Normal file
31
Cowain.Bake.UI/Helper/Views/HelpWindowView.xaml.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Spire.Doc;
|
||||
using System.IO;
|
||||
|
||||
|
||||
namespace Cowain.Bake.UI.Helper.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// HelpWindowView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class HelpWindowView : System.Windows.Controls.UserControl
|
||||
{
|
||||
public HelpWindowView()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadWordAsHtml(".\\doc.docx");
|
||||
}
|
||||
|
||||
private void LoadWordAsHtml(string filePath)
|
||||
{
|
||||
Document doc = new Document();
|
||||
doc.LoadFromFile(filePath);
|
||||
|
||||
// 转换为HTML
|
||||
string tempHtml = Path.Combine(Path.GetTempPath(), "temp.html");
|
||||
doc.SaveToFile(tempHtml, FileFormat.Html);
|
||||
|
||||
// 显示在WebBrowser
|
||||
webBrowser.Navigate(tempHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user