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

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

-fixed pathfinding
-fixed line drawing
-added Colorpicker
-fixed lock/unlock at TextInputWrapper
-feature: Background and TextForeground in TextInputWrapper added
-fixed a issue With loading and such
-WorkspaceModel doesn't throw exception anymore (Samples functional again)
-fixed some Styles
-Startable implemented and loaded right
-Startable Logo moved

File size: 10.7 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            <z:TransparentColorConverter x:Key="TransparentColorConverter"></z:TransparentColorConverter>
21            <z:MenuItemHeaderFixedConverter x:Key="MenuItemHeaderFixedConverter"></z:MenuItemHeaderFixedConverter>
22        </ResourceDictionary>
23    </UserControl.Resources>
24    <UserControl.ContextMenu>
25        <ContextMenu x:Name="ContextMenu">
26            <MenuItem x:Name="DeleteMenuItem" Header="Delete" Click="MenuItem_Click"></MenuItem>
27            <MenuItem x:Name="FixUnfixMenuItem" Click="MenuItem_Click_1" Header="{Binding Path=IsFixed, Converter={StaticResource ResourceKey=MenuItemHeaderFixedConverter}, FallbackValue=Error}"></MenuItem>
28        </ContextMenu>
29    </UserControl.ContextMenu>
30    <Grid>
31
32        <Grid.Resources>
33            <Style TargetType="{x:Type Button}" x:Key="formatTextStyle">
34                <Setter Property="FontFamily" Value="Palatino Linotype"></Setter>
35                <Setter Property="Width" Value="30"></Setter>
36                <Setter Property="FontSize" Value ="14"></Setter>
37                <Setter Property="CommandTarget" Value="{Binding ElementName=mainRTB}"></Setter>
38            </Style>
39
40            <Style TargetType="{x:Type Button}" x:Key="formatImageStyle">
41                <Setter Property="Width" Value="30"></Setter>
42                <Setter Property="CommandTarget" Value="{Binding ElementName=mainRTB}"></Setter>
43            </Style>
44        </Grid.Resources>
45
46        <Grid x:Name="ParentPanel" Panel.ZIndex="201">
47            <Thumb x:Name="OverLayingControl" Opacity="0.01" DragDelta="OverLayingControl_DragDelta_Move" IsEnabled="{Binding Path=IsSelected}"></Thumb>
48            <Grid x:Name="root" Margin="10">
49                <DockPanel Name="mainPanel">
50
51                    <!-- This tool bar contains all the editing buttons. -->
52                    <ToolBar Foreground="Black" Name="mainToolBar" Background="{StaticResource ResourceKey=ToolBarBrush}" Height="30" DockPanel.Dock="Top" Visibility="{Binding Path=IsSelected, Converter={StaticResource ResourceKey=ToolbarVisibilityConverter}}">
53                        <StackPanel Orientation="Horizontal">
54                            <TextBlock Text="BG" VerticalAlignment="Center" FontSize="11"></TextBlock>
55                            <Rectangle x:Name="BGColor" Fill="White" Margin="5,0,5,0" Width="23" Height="20" Stroke="#555" StrokeThickness="0.8" MouseLeftButtonDown="BGColor_MouseLeftButtonDown"></Rectangle>
56                        </StackPanel>
57
58                        <StackPanel Orientation="Horizontal">
59                            <TextBlock Text="Font" VerticalAlignment="Center" FontSize="11"></TextBlock>
60                            <Rectangle x:Name="FontColor" Fill="Black" Margin="5,0,5,0" Width="23" Height="20" Stroke="#555" StrokeThickness="0.8" MouseLeftButtonDown="FontColor_MouseLeftButtonDown"></Rectangle>
61                        </StackPanel>
62
63
64                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Cut" ToolTip="Cut">
65                            <Image Source="/WorkspaceManager;component/View/Image/EditCut.png"></Image>
66                        </Button>
67                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Copy" ToolTip="Copy">
68                            <Image Source="/WorkspaceManager;component/View/Image/EditCopy.png"></Image>
69                        </Button>
70                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Paste" ToolTip="Paste">
71                            <Image Source="/WorkspaceManager;component/View/Image/EditPaste.png"></Image>
72                        </Button>
73                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Undo" ToolTip="Undo">
74                            <Image Source="/WorkspaceManager;component/View/Image/EditUndo.png"></Image>
75                        </Button>
76                        <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Redo" ToolTip="Redo">
77                            <Image Source="/WorkspaceManager;component/View/Image/EditRedo.png"></Image>
78                        </Button>
79
80                        <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleBold" ToolTip="Bold">
81                            <TextBlock FontWeight="Bold">B</TextBlock>
82                        </Button>
83                        <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleItalic" ToolTip="Italic">
84                            <TextBlock FontStyle="Italic" FontWeight="Bold">I</TextBlock>
85                        </Button>
86                        <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleUnderline" ToolTip="Underline">
87                            <TextBlock TextDecorations="Underline" FontWeight="Bold">U</TextBlock>
88                        </Button>
89                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseFontSize" ToolTip="Grow Font">
90                            <Image Source="/WorkspaceManager;component/View/Image/CharacterGrowFont.png"></Image>
91                        </Button>
92                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseFontSize" ToolTip="Shrink Font">
93                            <Image Source="/WorkspaceManager;component/View/Image/CharacterShrinkFont.png"></Image>
94                        </Button>
95
96                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleBullets" ToolTip="Bullets">
97                            <Image Source="/WorkspaceManager;component/View/Image/ListBullets.png"></Image>
98                        </Button>
99                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleNumbering" ToolTip="Numbering">
100                            <Image Source="/WorkspaceManager;component/View/Image/ListNumbering.png"></Image>
101                        </Button>
102                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignLeft" ToolTip="Align Left">
103                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphLeftJustify.png"></Image>
104                        </Button>
105                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignCenter" ToolTip="Align Center">
106                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphCenterJustify.png"></Image>
107                        </Button>
108                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignRight" ToolTip="Align Right">
109                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphRightJustify.png"></Image>
110                        </Button>
111                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignJustify" ToolTip="Align Justify">
112                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphFullJustify.png"></Image>
113                        </Button>
114                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseIndentation" ToolTip="Increase Indent">
115                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphIncreaseIndentation.png"></Image>
116                        </Button>
117                        <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseIndentation" ToolTip="Decrease Indent">
118                            <Image Source="/WorkspaceManager;component/View/Image/ParagraphDecreaseIndentation.png"></Image>
119                        </Button>
120
121                    </ToolBar>
122
123                    <!-- By default pressing tab moves focus to the next control. Setting AcceptsTab to true allows the
124           RichTextBox to accept tab characters. -->
125                    <RichTextBox x:Name="mainRTB" Foreground="{Binding ElementName=FontColor, Path=Fill, Converter={StaticResource ResourceKey=TransparentColorConverter}}" AcceptsTab="True" OverridesDefaultStyle="True" BorderBrush="Transparent" BorderThickness="0" Background="{Binding ElementName=BGColor, Path=Fill, Converter={StaticResource ResourceKey=TransparentColorConverter}}" Margin="3"></RichTextBox>
126                </DockPanel>
127            </Grid>
128            <Border x:Name="Border" Margin="4.5"></Border>
129            <!--<Border x:Name="Border" Margin="4.5" BorderBrush="WhiteSmoke" BorderThickness="{Binding Path=IsSelected, Converter={StaticResource ResourceKey=SelectedContentBrushConverter}, FallbackValue=1}"></Border>-->
130            <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">
131                <Thumb.Background>
132                    <SolidColorBrush Opacity="0.01" Color="Black"></SolidColorBrush>
133                </Thumb.Background>
134            </Thumb>
135        </Grid>
136
137    </Grid>
138</UserControl>
Note: See TracBrowser for help on using the repository browser.