|
1 | | -<?xml version="1.0" encoding="UTF-8"?> |
2 | | -<telerik:RadContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
3 | | - xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
4 | | - xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui" |
5 | | - xmlns:behaviors="clr-namespace:QSF.Behaviors" |
6 | | - xmlns:local="clr-namespace:QSF.Examples.RichTextEditorControl.CustomToolbarExample" |
7 | | - x:Class="QSF.Examples.RichTextEditorControl.CustomToolbarExample.CustomToolbarView" |
8 | | - Padding="{OnIdiom Default='16, 20', Phone=16}"> |
9 | | - <telerik:RadContentView.Behaviors> |
10 | | - <behaviors:AndroidResizeSoftInputModeBehavior /> |
11 | | - </telerik:RadContentView.Behaviors> |
12 | | - |
13 | | - <telerik:RadContentView.Resources> |
14 | | - <Color x:Key="ToolbarItemTextColor">White</Color> |
15 | | - <Color x:Key="ToolbarItemInvertedTextColor">Black</Color> |
16 | | - <Color x:Key="ToolbarItemPointerOverColor">#506976</Color> |
17 | | - <Color x:Key="ToolbarAccentColor">#057C9B</Color> |
18 | | - <Color x:Key="ToolbarDisabledColor">#61000000</Color> |
19 | | - |
20 | | - <Color x:Key="CustomToolbarGroupItemPointerOverColor">#FABB5C</Color> |
21 | | - <Color x:Key="CustomToolbarGroupAccentColor">#F9AA34</Color> |
22 | | - |
23 | | - <FontImageSource x:Key="EmojiPickerToolbarItemIcon" |
24 | | - Glyph="" |
25 | | - FontFamily="TelerikFontExamples" |
26 | | - Color="{Binding TextColor, Source={RelativeSource AncestorType={x:Type telerik:RichTextEditorImagePickerToolbarItem}}}" |
27 | | - Size="14" |
28 | | - AutomationId="imagePickerToolbarItem"/> |
29 | | - |
30 | | - <Style x:Key="CommonButtonToolbarItemViewStyle" TargetType="telerik:ButtonToolbarItemView"> |
31 | | - <Setter Property="TextColor" Value="{StaticResource ToolbarItemTextColor}" /> |
32 | | - <Setter Property="VisualStateManager.VisualStateGroups"> |
33 | | - <VisualStateGroupList> |
34 | | - <VisualStateGroup Name="CommonStates"> |
35 | | - <VisualState Name="Normal" /> |
36 | | - <VisualState Name="PointerOver"> |
37 | | - <VisualState.Setters> |
38 | | - <Setter Property="BackgroundColor" Value="{StaticResource ToolbarItemPointerOverColor}" /> |
39 | | - </VisualState.Setters> |
40 | | - </VisualState> |
41 | | - <VisualState Name="Opened"> |
42 | | - <VisualState.Setters> |
43 | | - <Setter Property="BackgroundColor" Value="{StaticResource ToolbarAccentColor}" /> |
44 | | - </VisualState.Setters> |
45 | | - </VisualState> |
46 | | - <VisualState Name="Disabled"> |
47 | | - <VisualState.Setters> |
48 | | - <Setter Property="TextColor" Value="{StaticResource ToolbarDisabledColor}" /> |
49 | | - </VisualState.Setters> |
50 | | - </VisualState> |
51 | | - </VisualStateGroup> |
52 | | - </VisualStateGroupList> |
53 | | - </Setter> |
54 | | - </Style> |
55 | | - |
56 | | - <Style x:Key="CustomGroupToolbarItemStyle" TargetType="telerik:ToggleButtonToolbarItemView"> |
57 | | - <Setter Property="TextColor" Value="{StaticResource ToolbarItemTextColor}" /> |
58 | | - <Setter Property="VisualStateManager.VisualStateGroups"> |
59 | | - <VisualStateGroupList> |
60 | | - <VisualStateGroup Name="CommonStates"> |
61 | | - <VisualState Name="Normal" /> |
62 | | - <VisualState Name="PointerOver"> |
63 | | - <VisualState.Setters> |
64 | | - <Setter Property="BackgroundColor" Value="{StaticResource CustomToolbarGroupItemPointerOverColor}" /> |
65 | | - <Setter Property="TextColor" Value="{StaticResource ToolbarItemInvertedTextColor}" /> |
66 | | - </VisualState.Setters> |
67 | | - </VisualState> |
68 | | - <VisualState Name="Selected"> |
69 | | - <VisualState.Setters> |
70 | | - <Setter Property="BackgroundColor" Value="{StaticResource CustomToolbarGroupAccentColor}" /> |
71 | | - <Setter Property="TextColor" Value="{StaticResource ToolbarItemInvertedTextColor}" /> |
72 | | - </VisualState.Setters> |
73 | | - </VisualState> |
74 | | - <VisualState Name="Disabled"> |
75 | | - <VisualState.Setters> |
76 | | - <Setter Property="TextColor" Value="{StaticResource ToolbarDisabledColor}" /> |
77 | | - </VisualState.Setters> |
78 | | - </VisualState> |
79 | | - </VisualStateGroup> |
80 | | - </VisualStateGroupList> |
81 | | - </Setter> |
82 | | - </Style> |
83 | | - |
84 | | - <Style x:Key="CustomGroupToolbarItemViewStyle" TargetType="telerik:GroupToolbarItemView"> |
85 | | - <Setter Property="BorderBrush" Value="{StaticResource CustomToolbarGroupAccentColor}" /> |
86 | | - <Setter Property="BorderThickness" Value="1" /> |
87 | | - <Setter Property="CornerRadius" Value="4" /> |
88 | | - <Setter Property="Margin" Value="0, 0, 4, 0" /> |
89 | | - </Style> |
90 | | - |
91 | | - <Style x:Key="RichTextEditorToolbarStyle" TargetType="telerik:RadRichTextEditorToolbar"> |
92 | | - <Setter Property="BackgroundColor" Value="#344955" /> |
93 | | - <Setter Property="BorderThickness" Value="0" /> |
94 | | - <Setter Property="CornerRadius" Value="4" /> |
95 | | - </Style> |
96 | | - </telerik:RadContentView.Resources> |
97 | | - |
98 | | - <Grid RowDefinitions="{OnIdiom Desktop='Auto, *', Phone='*, Auto'}" |
99 | | - RowSpacing="8"> |
100 | | - <telerik:RadRichTextEditorToolbar x:Name="richTextToolbar" |
101 | | - Grid.Row="{OnIdiom Desktop=0, Phone=1}" |
102 | | - ZIndex="10" |
103 | | - RichTextEditor="{x:Reference richTextEditor}" |
104 | | - AutoGenerateItems="False" |
105 | | - AutomationId="richTextEditorToolbar" |
106 | | - Style="{StaticResource RichTextEditorToolbarStyle}"> |
107 | | - <telerik:RichTextEditorUndoToolbarItem Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
108 | | - <telerik:RichTextEditorRedoToolbarItem Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
109 | | - <telerik:SeparatorToolbarItem/> |
110 | | - <telerik:GroupToolbarItem Style="{StaticResource CustomGroupToolbarItemViewStyle}"> |
111 | | - <telerik:RichTextEditorBoldToolbarItem Style="{StaticResource CustomGroupToolbarItemStyle}" /> |
112 | | - <telerik:RichTextEditorItalicToolbarItem Style="{StaticResource CustomGroupToolbarItemStyle}" /> |
113 | | - <telerik:RichTextEditorUnderlineToolbarItem Style="{StaticResource CustomGroupToolbarItemStyle}" /> |
114 | | - </telerik:GroupToolbarItem> |
115 | | - <telerik:RichTextEditorTextColorToolbarItem Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
116 | | - <telerik:RichTextEditorColorPickerToolbarItem x:Name="colorPicker" |
117 | | - IsVisible="{OnPlatform WinUI=False}" |
118 | | - Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
119 | | - </telerik:RadRichTextEditorToolbar> |
120 | | - <telerik:RadRichTextEditor x:Name="richTextEditor" |
121 | | - Source="{Binding RTSource}" |
122 | | - Grid.Row="{OnIdiom Desktop=1, Phone=0}" |
123 | | - AutomationId="richTextEditor"/> |
124 | | - </Grid> |
125 | | -</telerik:RadContentView> |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<telerik:RadContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 4 | + xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui" |
| 5 | + xmlns:behaviors="clr-namespace:QSF.Behaviors" |
| 6 | + xmlns:local="clr-namespace:QSF.Examples.RichTextEditorControl.CustomToolbarExample" |
| 7 | + x:Class="QSF.Examples.RichTextEditorControl.CustomToolbarExample.CustomToolbarView" |
| 8 | + Padding="{OnIdiom Default='16, 20', Phone=16}"> |
| 9 | + <telerik:RadContentView.Behaviors> |
| 10 | + <behaviors:AndroidResizeSoftInputModeBehavior /> |
| 11 | + </telerik:RadContentView.Behaviors> |
| 12 | + |
| 13 | + <telerik:RadContentView.Resources> |
| 14 | + <Color x:Key="ToolbarItemTextColor">White</Color> |
| 15 | + <Color x:Key="ToolbarItemInvertedTextColor">Black</Color> |
| 16 | + <Color x:Key="ToolbarItemPointerOverColor">#506976</Color> |
| 17 | + <Color x:Key="ToolbarAccentColor">#057C9B</Color> |
| 18 | + <Color x:Key="ToolbarDisabledColor">#61000000</Color> |
| 19 | + |
| 20 | + <Color x:Key="CustomToolbarGroupItemPointerOverColor">#FABB5C</Color> |
| 21 | + <Color x:Key="CustomToolbarGroupAccentColor">#F9AA34</Color> |
| 22 | + |
| 23 | + <FontImageSource x:Key="EmojiPickerToolbarItemIcon" |
| 24 | + Glyph="" |
| 25 | + FontFamily="TelerikFontExamples" |
| 26 | + Color="{Binding TextColor, Source={RelativeSource AncestorType={x:Type telerik:RichTextEditorImagePickerToolbarItem}}}" |
| 27 | + Size="14" |
| 28 | + AutomationId="imagePickerToolbarItem"/> |
| 29 | + |
| 30 | + <Style x:Key="CommonButtonToolbarItemViewStyle" TargetType="telerik:ButtonToolbarItemView"> |
| 31 | + <Setter Property="TextColor" Value="{StaticResource ToolbarItemTextColor}" /> |
| 32 | + <Setter Property="VisualStateManager.VisualStateGroups"> |
| 33 | + <VisualStateGroupList> |
| 34 | + <VisualStateGroup Name="CommonStates"> |
| 35 | + <VisualState Name="Normal" /> |
| 36 | + <VisualState Name="PointerOver"> |
| 37 | + <VisualState.Setters> |
| 38 | + <Setter Property="BackgroundColor" Value="{StaticResource ToolbarItemPointerOverColor}" /> |
| 39 | + </VisualState.Setters> |
| 40 | + </VisualState> |
| 41 | + <VisualState Name="Opened"> |
| 42 | + <VisualState.Setters> |
| 43 | + <Setter Property="BackgroundColor" Value="{StaticResource ToolbarAccentColor}" /> |
| 44 | + </VisualState.Setters> |
| 45 | + </VisualState> |
| 46 | + <VisualState Name="Disabled"> |
| 47 | + <VisualState.Setters> |
| 48 | + <Setter Property="TextColor" Value="{StaticResource ToolbarDisabledColor}" /> |
| 49 | + </VisualState.Setters> |
| 50 | + </VisualState> |
| 51 | + </VisualStateGroup> |
| 52 | + </VisualStateGroupList> |
| 53 | + </Setter> |
| 54 | + </Style> |
| 55 | + |
| 56 | + <Style x:Key="CustomGroupToolbarItemStyle" TargetType="telerik:ToggleButtonToolbarItemView"> |
| 57 | + <Setter Property="TextColor" Value="{StaticResource ToolbarItemTextColor}" /> |
| 58 | + <Setter Property="VisualStateManager.VisualStateGroups"> |
| 59 | + <VisualStateGroupList> |
| 60 | + <VisualStateGroup Name="CommonStates"> |
| 61 | + <VisualState Name="Normal" /> |
| 62 | + <VisualState Name="PointerOver"> |
| 63 | + <VisualState.Setters> |
| 64 | + <Setter Property="BackgroundColor" Value="{StaticResource CustomToolbarGroupItemPointerOverColor}" /> |
| 65 | + <Setter Property="TextColor" Value="{StaticResource ToolbarItemInvertedTextColor}" /> |
| 66 | + </VisualState.Setters> |
| 67 | + </VisualState> |
| 68 | + <VisualState Name="Selected"> |
| 69 | + <VisualState.Setters> |
| 70 | + <Setter Property="BackgroundColor" Value="{StaticResource CustomToolbarGroupAccentColor}" /> |
| 71 | + <Setter Property="TextColor" Value="{StaticResource ToolbarItemInvertedTextColor}" /> |
| 72 | + </VisualState.Setters> |
| 73 | + </VisualState> |
| 74 | + <VisualState Name="Disabled"> |
| 75 | + <VisualState.Setters> |
| 76 | + <Setter Property="TextColor" Value="{StaticResource ToolbarDisabledColor}" /> |
| 77 | + </VisualState.Setters> |
| 78 | + </VisualState> |
| 79 | + </VisualStateGroup> |
| 80 | + </VisualStateGroupList> |
| 81 | + </Setter> |
| 82 | + </Style> |
| 83 | + |
| 84 | + <Style x:Key="CustomGroupToolbarItemViewStyle" TargetType="telerik:GroupToolbarItemView"> |
| 85 | + <Setter Property="BorderBrush" Value="{StaticResource CustomToolbarGroupAccentColor}" /> |
| 86 | + <Setter Property="BorderThickness" Value="1" /> |
| 87 | + <Setter Property="CornerRadius" Value="4" /> |
| 88 | + <Setter Property="Margin" Value="0, 0, 4, 0" /> |
| 89 | + </Style> |
| 90 | + |
| 91 | + <Style x:Key="RichTextEditorToolbarStyle" TargetType="telerik:RadRichTextEditorToolbar"> |
| 92 | + <Setter Property="BackgroundColor" Value="#344955" /> |
| 93 | + <Setter Property="BorderThickness" Value="0" /> |
| 94 | + <Setter Property="CornerRadius" Value="4" /> |
| 95 | + </Style> |
| 96 | + </telerik:RadContentView.Resources> |
| 97 | + |
| 98 | + <Grid RowDefinitions="{OnIdiom Desktop='Auto, *', Phone='*, Auto'}" |
| 99 | + RowSpacing="8"> |
| 100 | + <telerik:RadRichTextEditorToolbar x:Name="richTextToolbar" |
| 101 | + Grid.Row="{OnIdiom Desktop=0, Phone=1}" |
| 102 | + ZIndex="10" |
| 103 | + RichTextEditor="{x:Reference richTextEditor}" |
| 104 | + AutoGenerateItems="False" |
| 105 | + AutomationId="richTextEditorToolbar" |
| 106 | + Style="{StaticResource RichTextEditorToolbarStyle}"> |
| 107 | + <telerik:RichTextEditorUndoToolbarItem Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
| 108 | + <telerik:RichTextEditorRedoToolbarItem Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
| 109 | + <telerik:SeparatorToolbarItem/> |
| 110 | + <telerik:GroupToolbarItem Style="{StaticResource CustomGroupToolbarItemViewStyle}"> |
| 111 | + <telerik:RichTextEditorBoldToolbarItem Style="{StaticResource CustomGroupToolbarItemStyle}" /> |
| 112 | + <telerik:RichTextEditorItalicToolbarItem Style="{StaticResource CustomGroupToolbarItemStyle}" /> |
| 113 | + <telerik:RichTextEditorUnderlineToolbarItem Style="{StaticResource CustomGroupToolbarItemStyle}" /> |
| 114 | + </telerik:GroupToolbarItem> |
| 115 | + <telerik:RichTextEditorTextColorToolbarItem Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
| 116 | + <telerik:RichTextEditorColorPickerToolbarItem x:Name="colorPicker" |
| 117 | + IsVisible="{OnPlatform WinUI=False}" |
| 118 | + Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
| 119 | + <telerik:RichTextEditorImagePickerToolbarItem ItemsSource="{Binding EmojiSource}" |
| 120 | + ImageSource="{StaticResource EmojiPickerToolbarItemIcon}" |
| 121 | + Style="{StaticResource CommonButtonToolbarItemViewStyle}" /> |
| 122 | + </telerik:RadRichTextEditorToolbar> |
| 123 | + <telerik:RadRichTextEditor x:Name="richTextEditor" |
| 124 | + Source="{Binding RTSource}" |
| 125 | + Grid.Row="{OnIdiom Desktop=1, Phone=0}" |
| 126 | + AutomationId="richTextEditor"/> |
| 127 | + </Grid> |
| 128 | +</telerik:RadContentView> |
0 commit comments