-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6493a1
commit 380a2ef
Showing
7 changed files
with
125 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<UserControl x:Class="MarkDownEditor.View.PreviewToolBarControl" | ||
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:MarkDownEditor.View" | ||
xmlns:p="clr-namespace:MarkDownEditor.Properties" | ||
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="300"> | ||
<WrapPanel Orientation="Horizontal"> | ||
<WrapPanel.Resources> | ||
<Style TargetType="StackPanel"> | ||
<Setter Property="Margin" Value="5,0,5,0"></Setter> | ||
<Setter Property="Orientation" Value="Horizontal"></Setter> | ||
</Style> | ||
</WrapPanel.Resources> | ||
<StackPanel> | ||
<ToggleButton ToolTip="{x:Static p:Resources.Reading_Preview_Mode}" IsChecked="{Binding IsReadingMode}" | ||
Style="{DynamicResource EditorToggleButton}" > | ||
<Rectangle Width="16" Height="16" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"> | ||
<Rectangle.OpacityMask> | ||
<VisualBrush Stretch="Uniform" | ||
Visual="{DynamicResource appbar_arrow_expand}" /> | ||
</Rectangle.OpacityMask> | ||
</Rectangle> | ||
</ToggleButton> | ||
<ToggleButton ToolTip="{x:Static p:Resources.Scrollbar_Synchronization}" IsChecked="{Binding IsSynchronize}" | ||
Style="{DynamicResource EditorToggleButton}" > | ||
<Rectangle Width="16" Height="16" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=ToggleButton}}"> | ||
<Rectangle.OpacityMask> | ||
<VisualBrush Stretch="Uniform" | ||
Visual="{DynamicResource appbar_arrow_up_down}" /> | ||
</Rectangle.OpacityMask> | ||
</Rectangle> | ||
</ToggleButton> | ||
</StackPanel> | ||
<StackPanel> | ||
<Button ToolTip="{x:Static p:Resources.RefreshCommand}" Command="{Binding RefreshPreviewCommand}" | ||
Style="{DynamicResource EditorButton}" > | ||
<Rectangle Width="16" Height="16" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"> | ||
<Rectangle.OpacityMask> | ||
<VisualBrush Stretch="Uniform" | ||
Visual="{DynamicResource appbar_refresh}" /> | ||
</Rectangle.OpacityMask> | ||
</Rectangle> | ||
</Button> | ||
<Button ToolTip="{x:Static p:Resources.Open_In_External_Browser}" Command="{Binding ExternalBrowserCommand}" | ||
Style="{DynamicResource EditorButton}" > | ||
<Rectangle Width="16" Height="16" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"> | ||
<Rectangle.OpacityMask> | ||
<VisualBrush Stretch="Uniform" | ||
Visual="{DynamicResource appbar_browser}" /> | ||
</Rectangle.OpacityMask> | ||
</Rectangle> | ||
</Button> | ||
</StackPanel> | ||
<StackPanel> | ||
<Controls:DropDownButton ToolTip="{x:Static p:Resources.ExportTo}" Style="{StaticResource CircleDropDownButton}" | ||
ItemsSource="{Binding ExportFileTypes}" DisplayMemberPath="Name"> | ||
<Controls:DropDownButton.Icon> | ||
<Rectangle Width="16" Height="16" Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}"> | ||
<Rectangle.OpacityMask> | ||
<VisualBrush Stretch="Uniform" | ||
Visual="{DynamicResource appbar_chevron_right}" /> | ||
</Rectangle.OpacityMask> | ||
</Rectangle> | ||
</Controls:DropDownButton.Icon> | ||
<Controls:DropDownButton.ItemContainerStyle> | ||
<Style TargetType="MenuItem"> | ||
<Setter Property="Padding" Value="3"></Setter> | ||
<Setter Property="FontSize" Value="15"></Setter> | ||
<Setter Property="Command" Value="{Binding ExportCommand}"/> | ||
<Setter Property="ToolTip"> | ||
<Setter.Value> | ||
<TextBlock Text="{Binding ToolTip}" TextWrapping="WrapWithOverflow" MaxWidth="250"></TextBlock> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</Controls:DropDownButton.ItemContainerStyle> | ||
</Controls:DropDownButton> | ||
</StackPanel> | ||
</WrapPanel> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 MarkDownEditor.View | ||
{ | ||
/// <summary> | ||
/// PreviewToolBarControl.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class PreviewToolBarControl : UserControl | ||
{ | ||
public PreviewToolBarControl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters