forked from telerik/xaml-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
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
f1424f8
commit 543a834
Showing
26 changed files
with
166 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Restore Focus## | ||
The example demonstrates how to restore the focus when the RadBusyIndicator is shown and then hidden for Silverlight and WPF. | ||
The example demonstrates how to restore the focus when the RadBusyIndicator is shown and then hidden for Silverlight and WPF. | ||
|
||
<keywords:hidden, shown, isbusy> |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
##Allowed Dates## | ||
This example demonstrates how to use the SelectableDateStart, SelectableDateEnd and BlackoutDates in order to create a selectable range of dates for Silverlight and WPF. | ||
|
||
In the example only the current weekdays (Monday-Friday) are selectable. | ||
In the example only the current weekdays (Monday-Friday) are selectable. | ||
|
||
<keywords: SelectableDateStart, SelectableDateEnd, BlackoutDates, selectable, days, raddatetimepicker, raddatepicker> |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
##Clear Button## | ||
This example demonstrates how to customize the Template of the RadDateTimePicker Style in order to add a 'Clear selection' button to it. | ||
The example is available for both Silverlight and WPF. | ||
The example is available for both Silverlight and WPF. | ||
|
||
<keywords: datetimepicker, style, customize, template, selection> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Custom HeaderTemplate## | ||
This example demonstrates how to customize the Header and HeaderTemplate of the RadTimePicker control in Silverlight and WPF. | ||
This example demonstrates how to customize the Header and HeaderTemplate of the RadTimePicker control in Silverlight and WPF. | ||
|
||
<keywords: datetimepicker, timepicker, header, cuztomize, radtimepicker> |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
##Readonly Input Field## | ||
This example demonstrates how to make the input field of the DateTimePicker/DatePicker controls read-only while the drop down calendar | ||
remains active for Silverlight and WPF. | ||
remains active for Silverlight and WPF. | ||
|
||
<keywords: datetimepicker, datepicker, calendar> |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
##Restrict The Entered Date## | ||
This example demonstrates how you can restrict the date that a user can type in the input field by implementing the ParseDateTimeValue event. | ||
The example is available for Silverlight and WPF. | ||
The example is available for Silverlight and WPF. | ||
|
||
<keywords: datetimepicker, timepicker, ParseDateTimeValue> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##String format in MVVM## | ||
This example demonstrates how to set the Date/Time patterns using an attached behavior (i.e. in a MVVM-friendly manner). | ||
This example demonstrates how to set the Date/Time patterns using an attached behavior (i.e. in a MVVM-friendly manner). | ||
|
||
<keywords: attached, behavior, set, patterns> |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
##Time Intervals Scroll Viewer## | ||
This example demonstrates how to add a scrollbar to the time intervals portion of the control. When setting a small TimeInterval this | ||
would help in not stretching the controls Tempalte for Silverlight and WPF. | ||
would help in not stretching the controls Tempalte for Silverlight and WPF. | ||
|
||
<keywords: scrollbar, datetimepicker, timepicker, TimeInterval, template, scrollviewer> |
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
32 changes: 32 additions & 0 deletions
32
PdfProcessing/ExportUIElement/PdfExport/ConcreteRenderers/TextBoxRenderer.cs
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,32 @@ | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media; | ||
|
||
namespace ExportUIElement | ||
{ | ||
internal class TextBoxRenderer : UIElementRendererBase | ||
{ | ||
internal override bool Render(UIElement element, PdfRenderContext context) | ||
{ | ||
TextBox textBox = element as TextBox; | ||
if (textBox == null) | ||
{ | ||
return false; | ||
} | ||
|
||
string text = textBox.Text; | ||
Brush foreground = textBox.Foreground; | ||
double width = textBox.ActualWidth; | ||
double height = textBox.ActualHeight; | ||
var fontFamily = textBox.FontFamily; | ||
double fontSize = textBox.FontSize; | ||
|
||
using (SaveClip(context.drawingSurface, new Rect(0, 0, textBox.ActualWidth, textBox.ActualHeight))) | ||
{ | ||
TextRenderer.DrawTextBlock(text, context, foreground, width, height, fontFamily, fontSize); | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
PdfProcessing/ExportUIElement/PdfExport/ConcreteRenderers/TextRenderer.cs
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,54 @@ | ||
using System; | ||
using System.Windows.Media; | ||
using Telerik.Windows.Documents.Fixed.Model.Editing; | ||
|
||
namespace ExportUIElement | ||
{ | ||
internal static class TextRenderer | ||
{ | ||
public static void DrawTextBlock(string text, PdfRenderContext context, Brush foreground, double width, double height, FontFamily fontFamily, double fontSize) | ||
{ | ||
if (!string.IsNullOrEmpty(text)) | ||
{ | ||
using (context.drawingSurface.SaveProperties()) | ||
{ | ||
UIElementRendererBase.SetFill(context, foreground, width, height); | ||
SetFontFamily(context.drawingSurface, fontFamily); | ||
context.drawingSurface.TextProperties.FontSize = fontSize; | ||
|
||
Block block = new Block(); | ||
block.TextProperties.CopyFrom(context.drawingSurface.TextProperties); | ||
block.GraphicProperties.CopyFrom(context.drawingSurface.GraphicProperties); | ||
string[] textLines = text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); | ||
|
||
foreach (string textLine in textLines) | ||
{ | ||
block.InsertText(textLine); | ||
block.InsertLineBreak(); | ||
} | ||
|
||
context.drawingSurface.DrawBlock(block); | ||
} | ||
} | ||
} | ||
|
||
private static void SetFontFamily(Telerik.Windows.Documents.Fixed.Model.Editing.FixedContentEditor drawingSurface, System.Windows.Media.FontFamily fontFamily) | ||
{ | ||
#if WPF | ||
if (!drawingSurface.TextProperties.TrySetFont(fontFamily)) | ||
{ | ||
throw new System.Exception("Unable to set font. Consider embedding the font."); | ||
} | ||
#elif SILVERLIGHT | ||
if (fontFamily.Source == "Times New Roman") | ||
{ | ||
drawingSurface.TextProperties.Font = Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.TimesRoman; | ||
} | ||
else | ||
{ | ||
throw new System.Exception("Unable to set font. Please see the RegisterAndExportPdfFonts sdk sample here https://github.com/telerik/xaml-sdk/tree/master/SpreadProcessing/RegisterAndExportPdfFonts"); | ||
} | ||
#endif | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Binding ItemsSource## | ||
This example demonstrates how to bind a collection of custom objects to the ItemsSource property of RadRadialMenu. | ||
This example demonstrates how to bind a collection of custom objects to the ItemsSource property of RadRadialMenu. | ||
|
||
<keywords: collection, custom, objects, radialmenu> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Customizing the center button## | ||
This example demonstrates how to customize the ContentTemplate and BackContentTemplate of the RadialMenuButton. | ||
This example demonstrates how to customize the ContentTemplate and BackContentTemplate of the RadialMenuButton. | ||
|
||
<keywords: ContentTemplate, BackContentTemplate, RadialMenuButton, customize> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Custom ToolTip## | ||
This example demonstrates how to customize the ToolTipContent and MenuToolTipStyle of the RadRadialMenuItem. | ||
This example demonstrates how to customize the ToolTipContent and MenuToolTipStyle of the RadRadialMenuItem. | ||
|
||
<keywords: customize, ToolTipContent, MenuToolTipStyle, RadRadialMenuItem, radialmenu> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##How to add Commands to RadRadialMenuItems## | ||
This example demonstrates how to add commands to the RadRadialMenuItems to a RadRadialMenu and RadRadialContextMenu which manipulate an Image's RenderTransform. | ||
This example demonstrates how to add commands to the RadRadialMenuItems to a RadRadialMenu and RadRadialContextMenu which manipulate an Image's RenderTransform. | ||
|
||
<keywords: RadRadialMenu, RadRadialContextMenu, RenderTransform> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Quick mode RadialMenu## | ||
This example demonstrates the expected behavior when the RadRadialMenu.EnableQuickMode is set to True. The default value of that static Boolean property is False. By design when the RadRadialMenu is being shown or closed its animation will be triggered. While that animation is being animated if a different animation is triggered it will not be executed and the initial animation will complete fully. When the EnableQuickMode is set to True that initial animation will be interrupted and the new one will be executed. | ||
This example demonstrates the expected behavior when the RadRadialMenu.EnableQuickMode is set to True. The default value of that static Boolean property is False. By design when the RadRadialMenu is being shown or closed its animation will be triggered. While that animation is being animated if a different animation is triggered it will not be executed and the initial animation will complete fully. When the EnableQuickMode is set to True that initial animation will be interrupted and the new one will be executed. | ||
|
||
<keywords: EnableQuickMode, animation> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Open RadialMenu on show## | ||
This example demonstrates how to achieve a behavior where the RadRadialMenu is directly shown in its opened state rather than the default one. | ||
This example demonstrates how to achieve a behavior where the RadRadialMenu is directly shown in its opened state rather than the default one. | ||
|
||
<keywords: directly> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##RadRadialMenu positioning## | ||
This example demonstrates how to set the postion where the RadRadialMenu would be placed when used a ContextMenu. | ||
This example demonstrates how to set the postion where the RadRadialMenu would be placed when used a ContextMenu. | ||
|
||
<keywords: set, position, contextmenu> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Show/Hide as ContextMenu## | ||
This example demonstrates how to set different events in order to show and hide the RadRadialMenu when it is used as ContextMenu of an element. The events could be set via the ShowEventName and HideEventName properties of the control or via KeyBinding. | ||
This example demonstrates how to set different events in order to show and hide the RadRadialMenu when it is used as ContextMenu of an element. The events could be set via the ShowEventName and HideEventName properties of the control or via KeyBinding. | ||
|
||
<keywords: radialmenu, events, ShowEventName, HideEventName, KeyBinding > |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##Declaring standalone RadRadialMenu## | ||
This example demonstrates how to declare the RadRadialMenu as a standalone menu. | ||
This example demonstrates how to declare the RadRadialMenu as a standalone menu. | ||
|
||
<keywords: declare, menu > |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
##TimeSpanPicker as custom FilterEditor## | ||
This example demonstrates how to easily use RadTimeSpanPicker as a filter editor in order to filter the rows of RadGridView. | ||
This example demonstrates how to easily use RadTimeSpanPicker as a filter editor in order to filter the rows of RadGridView. | ||
|
||
<keywords: filter, rows, gridview> |