123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <UserControl x:Class="InABox.DynamicGrid.RichTextEditor"
- 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:sf="http://schemas.syncfusion.com/wpf"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <sf:FontFamilyStringConverter x:Key="FontFamilyStringConverter" />
- <sf:UnderlineToggleConverter x:Key="UnderlineToggleConverter" />
- <sf:LeftAlignmentToggleConverter x:Key="LeftAlignmentToggleConverter" />
- <sf:RightAlignmentToggleConverter x:Key="RightAlignmentToggleConverter" />
- <sf:CenterAlignmentToggleConverter x:Key="CenterAlignmentToggleConverter" />
- <sf:JustifyAlignmentToggleConverter x:Key="JustifyAlignmentToggleConverter" />
- </UserControl.Resources>
- <Border BorderBrush="DarkGray" BorderThickness="0.75" CornerRadius="2">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <ToolBar x:Name="Toolbar" Grid.Row="0" IsTabStop="False">
- <ComboBox Margin="12 2 0 2" Focusable="False" Width="160" x:Name="FontFamilyComboBox"
- SelectionChanged="fontFamilyCombo_SelectionChanged"
- ItemsSource="{Binding Path=FontFamilySource}" />
- <ComboBox Margin="12 2 0 2" IsTabStop="False" Width="45" x:Name="FontSizeComboBox" SelectedIndex="3"
- ItemsSource="{Binding Path=FontSizeSource}" IsEditable="True"
- TextBoxBase.TextChanged="fontSizeCombo_TextChanged"/>
- <Separator/>
- <ToggleButton x:Name="BoldBtn"
- Command="EditingCommands.ToggleBold"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <ToggleButton x:Name="ItalicBtn"
- Command="EditingCommands.ToggleItalic"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <ToggleButton x:Name="UnderlineBtn"
- Command="EditingCommands.ToggleUnderline"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <Separator/>
- <ToggleButton x:Name="AlignLeftBtn"
- Command="EditingCommands.AlignLeft"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <ToggleButton x:Name="AlignCenterBtn"
- Command="EditingCommands.AlignCenter"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <ToggleButton x:Name="AlignRightBtn"
- Command="EditingCommands.AlignRight"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <ToggleButton x:Name="AlignJustifyBtn"
- Command="EditingCommands.AlignJustify"
- CommandTarget="{Binding ElementName=RtbEditor}"
- IsTabStop="False"
- Margin="2"/>
- <Separator/>
- <Button x:Name="HyperlinkBtn"
- Click="HyperlinkBtn_Click"
- IsTabStop="False"
- Margin="2"/>
- </ToolBar>
- <!--sf:ToolBarAdv x:Name="Toolbar" DockPanel.Dock="Top" Focusable="False" GripperVisibility="Collapsed"
- Grid.Row="0"
- IsOverflowOpen="False">
- <ComboBox Margin="12 2 0 2" Focusable="False" Width="160" x:Name="fontFamilyCombo"
- SelectedValue="{Binding Path=Selection.CharacterFormat.FontFamily, Mode=TwoWay, ElementName=Editor, Converter={StaticResource FontFamilyStringConverter}}"
- ItemsSource="{Binding Path=FontFamilySource}" />
- <ComboBox Margin="12 2 0 2" IsTabStop="False" Width="45" x:Name="fontSizeCombo" SelectedIndex="3"
- ItemsSource="{Binding Path=FontSizeSource}"
- SelectedValue="{Binding Path=Selection.CharacterFormat.FontSize ,Mode=TwoWay,ElementName=Editor}" />
- <sf:ColorPickerPalette x:Name="fontColorPicker" Margin="12 2 0 2" IsTabStop="False" Width="60"
- IsExpanded="False" MoreColorOptionVisibility="Collapsed"
- StandardPanelVisibility="Collapsed"
- Color="{Binding Path=Selection.CharacterFormat.FontColor ,Mode=TwoWay,ElementName=Editor}" />
- <sf:ToolBarItemSeparator Margin="12 2 0 2" />
- <sf:ButtonAdv x:Name="Hyperlink" Margin="12 2 0 2" Focusable="False" SizeMode="Small"
- Command="sf:SfRichTextBoxAdv.ShowHyperlinkDialogCommand"
- CommandTarget="{Binding ElementName=Editor}" />
- <sf:ButtonAdv x:Name="Picture" Margin="12 2 0 2" Focusable="False" SizeMode="Small"
- Command="sf:SfRichTextBoxAdv.InsertPictureCommand"
- CommandTarget="{Binding ElementName=Editor}" />
- <sf:ButtonAdv x:Name="Table" Margin="12 2 0 2" Focusable="False" SizeMode="Small"
- Command="sf:SfRichTextBoxAdv.ShowInsertTableDialogCommand"
- CommandTarget="{Binding ElementName=Editor}" />
- <sf:ToolBarItemSeparator Margin="12 2 0 2" />
- <sf:ButtonAdv x:Name="ZoomIn" Margin="12 2 0 2" Focusable="False" SizeMode="Small"
- SmallIcon="pack://application:,,,/Resources/zoomin.png" Click="ZoomIn_Click" />
- <sf:ButtonAdv x:Name="ZoomOut" Margin="12 2 0 2" Focusable="False" SizeMode="Small"
- SmallIcon="pack://application:,,,/Resources/zoomout.png" Click="ZoomOut_Click" />
- </sf:ToolBarAdv-->
- <!--sf:SfRichTextBoxAdv x:Name="Editor" DockPanel.Dock="Top" EnableMiniToolBar="False"
- ContentChanged="RichTextBoxAdv_ContentChanged" BorderThickness="0"
- LostFocus="RichTextBoxAdv_LostFocus" OverridesDocumentBackground="True"
- LayoutType="Continuous"
- VerticalScrollBarVisibility="False"
- Grid.Row="1"
- RequestNavigate="Editor_RequestNavigate"/-->
- <RichTextBox x:Name="RtbEditor"
- SelectionChanged="RtbEditor_SelectionChanged"
- TextChanged="RtbEditor_TextChanged"
- Grid.Row="1"/>
- </Grid>
- </Border>
- </UserControl>
|