source: trunk/CrypPlugins/WorkspaceManager/View/VisualComponents/TextInputWrapper.xaml @ 1892

Last change on this file since 1892 was 1892, checked in by matkovic, 11 years ago

-Fullscreen enhanced
-TextInput added
-Picture scaling added
-Textinput scaling added
-Textinput format command added
-Several style changes
-Progressbar redesigned
-Last log message now appearing
-IControlContainer commenced
-Several icons added
-Plugin state now stored and loaded
-Plugin height and width now storing and loading
-Several misc changes

File size: 9.1 KB
Line 
1<UserControl x:Class="WorkspaceManager.View.VisualComponents.TextInputWrapper"
2             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6             xmlns:e="clr-namespace:WorkspaceManager.View.VisualComponents"
7             xmlns:z="clr-namespace:WorkspaceManager.View.Converter"
8             mc:Ignorable="d"
9             MinHeight="100" MinWidth="150" Width="200">
10    <UserControl.Resources>
11        <ResourceDictionary>
12            <ResourceDictionary.MergedDictionaries>
13                <ResourceDictionary Source="../Resource/Styles.xaml"/>
14                <ResourceDictionary Source="../Resource/Animations.xaml"/>
15            </ResourceDictionary.MergedDictionaries>
16            <z:SelectedContentVisibilityConverter x:Key="SContentVisibilityConverter"></z:SelectedContentVisibilityConverter>
17            <z:SelectedContentBrushConverter x:Key="SelectedContentBrushConverter"></z:SelectedContentBrushConverter>
18            <z:ContextMenuFixUnfixConverter x:Key="ContextMenuFixUnfixConverter"></z:ContextMenuFixUnfixConverter>
19            <z:ToolbarVisibilityConverter x:Key="ToolbarVisibilityConverter"></z:ToolbarVisibilityConverter>
20        </ResourceDictionary>
21    </UserControl.Resources>
22    <UserControl.ContextMenu>
23        <ContextMenu x:Name="ContextMenu">
24            <MenuItem x:Name="DeleteMenuItem" Header="Delete" Click="MenuItem_Click"></MenuItem>
25            <MenuItem x:Name="FixUnfixMenuItem" Click="MenuItem_Click_1"></MenuItem>
26        </ContextMenu>
27    </UserControl.ContextMenu>
28    <Grid>
29
30        <Grid.Resources>
31            <Style TargetType="{x:Type Button}" x:Key="formatTextStyle">
32                <Setter Property="FontFamily" Value="Palatino Linotype"></Setter>
33                <Setter Property="Width" Value="30"></Setter>
34                <Setter Property="FontSize" Value ="14"></Setter>
35                <Setter Property="CommandTarget" Value="{Binding ElementName=mainRTB}"></Setter>
36            </Style>
37
38            <Style TargetType="{x:Type Button}" x:Key="formatImageStyle">
39                <Setter Property="Width" Value="30"></Setter>
40                <Setter Property="CommandTarget" Value="{Binding ElementName=mainRTB}"></Setter>
41            </Style>
42        </Grid.Resources>
43
44        <Grid x:Name="ParentPanel" Panel.ZIndex="201" IsEnabledChanged="IsEnabledChanged">
45            <Thumb x:Name="OverLayingControl" Opacity="0.01" DragDelta="OverLayingControl_DragDelta_Move" IsEnabled="{Binding Path=IsSelected}"></Thumb>
46            <Grid x:Name="root" Margin="10">
47                <DockPanel Name="mainPanel">
48
49                    <!-- This tool bar contains all the editing buttons. -->
50                    <ToolBar Name="mainToolBar" Height="30" DockPanel.Dock="Top" Visibility="{Binding Path=IsSelected, Converter={StaticResource ResourceKey=ToolbarVisibilityConverter}}">
51
52                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Cut" ToolTip="Cut">
53                            <Image Source="/WorkspaceManager;component/View/Image/EditCut.png"></Image>
54                        </Button>
55                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Copy" ToolTip="Copy">
56                            <Image Source="/WorkspaceManager;component/View/Image/EditCopy.png"></Image>
57                        </Button>
58                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Paste" ToolTip="Paste">
59                            <Image Source="/WorkspaceManager;component/View/Image/EditPaste.png"></Image>
60                        </Button>
61                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Undo" ToolTip="Undo">
62                            <Image Source="/WorkspaceManager;component/View/Image/EditUndo.png"></Image>
63                        </Button>
64                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Redo" ToolTip="Redo">
65                            <Image Source="/WorkspaceManager;component/View/Image/EditRedo.png"></Image>
66                        </Button>
67
68                        <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleBold" ToolTip="Bold">
69                            <TextBlock FontWeight="Bold">B</TextBlock>
70                        </Button>
71                        <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleItalic" ToolTip="Italic">
72                            <TextBlock FontStyle="Italic" FontWeight="Bold">I</TextBlock>
73                        </Button>
74                        <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleUnderline" ToolTip="Underline">
75                            <TextBlock TextDecorations="Underline" FontWeight="Bold">U</TextBlock>
76                        </Button>
77                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseFontSize" ToolTip="Grow Font">
78                            <Image Source="/WorkspaceManager;component/View/Image/CharacterGrowFont.png"></Image>
79                        </Button>
80                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseFontSize" ToolTip="Shrink Font">
81                            <Image Source="/WorkspaceManager;component/View/Image/CharacterShrinkFont.png"></Image>
82                        </Button>
83
84                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleBullets" ToolTip="Bullets">
85                            <Image Source="/WorkspaceManager;component/View/Image/ListBullets.png"></Image>
86                        </Button>
87                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleNumbering" ToolTip="Numbering">
88                            <Image Source="/WorkspaceManager;component/View/Image/ListNumbering.png"></Image>
89                        </Button>
90                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignLeft" ToolTip="Align Left">
91                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphLeftJustify.png"></Image>
92                        </Button>
93                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignCenter" ToolTip="Align Center">
94                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphCenterJustify.png"></Image>
95                        </Button>
96                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignRight" ToolTip="Align Right">
97                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphRightJustify.png"></Image>
98                        </Button>
99                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignJustify" ToolTip="Align Justify">
100                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphFullJustify.png"></Image>
101                        </Button>
102                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseIndentation" ToolTip="Increase Indent">
103                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphIncreaseIndentation.png"></Image>
104                        </Button>
105                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseIndentation" ToolTip="Decrease Indent">
106                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphDecreaseIndentation.png"></Image>
107                        </Button>
108
109                    </ToolBar>
110
111                    <!-- By default pressing tab moves focus to the next control. Setting AcceptsTab to true allows the
112           RichTextBox to accept tab characters. -->
113                    <RichTextBox x:Name="mainRTB" AcceptsTab="True"></RichTextBox>
114                </DockPanel>
115            </Grid>
116            <Border x:Name="Border" Margin="4.5" BorderBrush="WhiteSmoke" BorderThickness="{Binding Path=IsSelected, Converter={StaticResource ResourceKey=SelectedContentBrushConverter}, FallbackValue=1}"></Border>
117            <Thumb Margin="15" Panel.ZIndex="200" Style="{StaticResource ResourceKey=ImageWrapperThumbStyle}" Name="BottomRightDelta" Opacity="1" Visibility="{Binding Path=IsSelected, Converter={StaticResource ResourceKey=SContentVisibilityConverter}, FallbackValue=Visible}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Cursor="SizeNWSE" DragDelta="Thumb_DragDelta">
118                <Thumb.Background>
119                    <SolidColorBrush Opacity="0.01" Color="Black"></SolidColorBrush>
120                </Thumb.Background>
121            </Thumb>
122        </Grid>
123
124    </Grid>
125</UserControl>
Note: See TracBrowser for help on using the repository browser.