Skip to content

Commit

Permalink
Merge pull request #54 from telerik/sdkUpdates
Browse files Browse the repository at this point in the history
New version of Telerik SDK examples.
  • Loading branch information
martinivanoff authored Oct 23, 2023
2 parents fa3ac1a + faa8cf0 commit 76321ad
Show file tree
Hide file tree
Showing 39 changed files with 1,381 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ChartView/WPF/TrackBallLikeAnnotations/ChartUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private static void Chart_MouseMove(object sender, System.Windows.Input.MouseEve
object currentXCategory = GetCurrentXCategory(chart);

Point position = e.GetPosition(chart);
if (!chart.PlotAreaClip.Contains(position.X, position.Y))
if (!chart.PlotAreaClip.Contains(position.X - chart.PanOffset.X, position.Y - chart.PanOffset.Y))
{
if (HidesAnnotationsOnMouseLeave && currentXCategory != null)
{
Expand Down
6 changes: 6 additions & 0 deletions ChartView/WPF/TrackBallLikeAnnotations/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Both"/>
</telerik:RadCartesianChart.Behaviors>
<telerik:RadCartesianChart.Series>
<telerik:BarSeries CategoryBinding="Date"
ValueBinding="YVal"
Expand All @@ -70,6 +73,9 @@
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis />
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Both"/>
</telerik:RadCartesianChart.Behaviors>
<telerik:RadCartesianChart.Series>
<telerik:LineSeries CategoryBinding="Date"
ValueBinding="YVal"
Expand Down
2 changes: 1 addition & 1 deletion PdfViewer/CustomCommandDescriptor/FitToWidthCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public FitToWidthCommand(FixedDocumentViewerBase fixedDocumentViewerBase)
public override void Execute(object parameter)
{
double width = this.Viewer.ActualWidth - 2 * PageMargin;
double pageWidth = this.Viewer.CurrentPage.ActualWidth;
double pageWidth = this.Viewer.CurrentPage.Size.Width;
this.Viewer.ScaleFactor = width / pageWidth;
}
}
Expand Down
2 changes: 1 addition & 1 deletion PdfViewer/CustomPresenter/SinglePageLayoutManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public bool GetLocationFromViewPoint(Point viewPoint, Size viewport, out RadFixe
}

SinglePageInfo pageInfo = this.visiblePage;
if (pageInfo == null || !pageInfo.FixedPage.HasContent)
if (pageInfo == null || pageInfo.FixedPage.Content == null)
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Telerik.Windows.Documents.Fixed.FormatProviders;
#if WPF
using Microsoft.Win32;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import;
#endif

namespace PdfViewerCustomSaveCommand.Commands
Expand Down Expand Up @@ -49,7 +50,7 @@ public override void Execute(object parameter)
str.Flush();
str.Seek(0, SeekOrigin.Begin);
stream.Flush();
PdfDocumentSource source = new PdfDocumentSource(str, FormatProviderSettings.ReadOnDemand);
PdfDocumentSource source = new PdfDocumentSource(str, PdfImportSettings.ReadOnDemand);
source.Loaded += (s, e) =>
{
str.Close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</Reference>
<Reference Include="Telerik.Windows.Controls">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Binaries\WPF\Telerik.Windows.Controls.dll</HintPath>
<HintPath>$(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
Expand Down
2 changes: 1 addition & 1 deletion Theming/PaletteResourcesExtractor/Resources.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PaletteResourcesExtractor">
<local:ItemsCountToVisibilityConverter x:Key="ItemsCountToVisibilityConverter" />
Expand Down
6 changes: 6 additions & 0 deletions ToolBar/ToolBarCustomComboBoxStyle/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
17 changes: 17 additions & 0 deletions ToolBar/ToolBarCustomComboBoxStyle/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Application x:Class="CustomRadComboBoxStyle.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CustomRadComboBoxStyle"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/System.Windows.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
<ResourceDictionary Source="CustomStyles/Office_BlackCustomStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
11 changes: 11 additions & 0 deletions ToolBar/ToolBarCustomComboBoxStyle/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Windows;

namespace CustomRadComboBoxStyle
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using System.Windows.Media;

namespace CustomRadComboBoxStyle.Converters
{
public class GlobalThemeToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var tokens = value.ToString().Split('_').ToArray();

if (tokens.Length <= 1)
{
return Brushes.White;
}

var themeVariation = tokens[1];

if (themeVariation == "Dark")
{
return Brushes.Black;
}
else if (themeVariation == "Gray")
{
return Brushes.Gray;
}
else if (themeVariation == "LightGray")
{
return Brushes.LightGray;
}
else if (themeVariation == "DarkGray")
{
return Brushes.DarkGray;
}
else if (themeVariation == "Blue")
{
return Brushes.MediumPurple;
}
else if (themeVariation == "HighContrast")
{
return Brushes.Black;
}

return Brushes.White;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using System.Windows.Media;

namespace CustomRadComboBoxStyle.Converters
{
public class InvertedGlobalThemeToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var tokens = value.ToString().Split('_').ToArray();

if (tokens.Length <= 1)
{
return Brushes.Black;
}

var themeVariation = tokens[1];

if (themeVariation == "Dark" || themeVariation == "HighContrast")
{
return Brushes.White;
}

return Brushes.Black;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
Loading

0 comments on commit 76321ad

Please sign in to comment.