Skip to content

Commit

Permalink
Examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
martinivanoff committed Jan 18, 2017
1 parent f8a16f4 commit c67c3b4
Show file tree
Hide file tree
Showing 87 changed files with 979 additions and 1,843 deletions.
7 changes: 6 additions & 1 deletion ImageEditor/CustomImageFormatProvider/ImageEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@
</tools:ShapeTool>
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>

<telerik:ImageToolItem ImageKey="Pan" telerik:LocalizationManager.ResourceKey="ImageEditor_Pan"
Command="commands:ImageEditorRoutedCommands.ExecuteTool">
<telerik:ImageToolItem.CommandParameter>
<tools:PanTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
</telerik:ImageToolsSection>

<telerik:ImageToolsSection telerik:LocalizationManager.ResourceKey="ImageEditor_Adjust" >
Expand Down
7 changes: 6 additions & 1 deletion ImageEditor/CustomWatermarkTool/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@
</tools:ShapeTool>
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>

<telerik:ImageToolItem ImageKey="Pan" telerik:LocalizationManager.ResourceKey="ImageEditor_Pan"
Command="commands:ImageEditorRoutedCommands.ExecuteTool">
<telerik:ImageToolItem.CommandParameter>
<tools:PanTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
</telerik:ImageToolsSection>
<telerik:ImageToolsSection Header="Custom Tools">
<telerik:ImageToolItem Text="Watermark" Command="commands:ImageEditorRoutedCommands.ExecuteTool"
Expand Down
7 changes: 6 additions & 1 deletion ImageEditor/Localization/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@
</tools:ShapeTool>
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>

<telerik:ImageToolItem ImageKey="Pan" telerik:LocalizationManager.ResourceKey="ImageEditor_Pan"
Command="commands:ImageEditorRoutedCommands.ExecuteTool">
<telerik:ImageToolItem.CommandParameter>
<tools:PanTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
</telerik:ImageToolsSection>

<telerik:ImageToolsSection telerik:LocalizationManager.ResourceKey="ImageEditor_Adjust" >
Expand Down
7 changes: 6 additions & 1 deletion ImageEditor/RadImageEditorUIFirstLook/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@
</tools:ShapeTool>
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>

<telerik:ImageToolItem ImageKey="Pan" telerik:LocalizationManager.ResourceKey="ImageEditor_Pan"
Command="commands:ImageEditorRoutedCommands.ExecuteTool">
<telerik:ImageToolItem.CommandParameter>
<tools:PanTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
</telerik:ImageToolsSection>

<telerik:ImageToolsSection telerik:LocalizationManager.ResourceKey="ImageEditor_Adjust" >
Expand Down
6 changes: 6 additions & 0 deletions ImageEditor/RadUploadIntegration/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<tools:DrawTextTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
<telerik:ImageToolItem ImageKey="Pan" telerik:LocalizationManager.ResourceKey="ImageEditor_Pan"
Command="commands:ImageEditorRoutedCommands.ExecuteTool">
<telerik:ImageToolItem.CommandParameter>
<tools:PanTool />
</telerik:ImageToolItem.CommandParameter>
</telerik:ImageToolItem>
</telerik:ImageToolsSection>

<telerik:ImageToolsSection Header="Adjust" >
Expand Down
1 change: 1 addition & 0 deletions MSControls/ThemingExample/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</Border.Resources>
<ScrollViewer BorderThickness="0" Style="{StaticResource ScrollViewerStyle}">
<StackPanel Margin="11,6,0,8">
<RadioButton x:Name="Office2016Touch" Checked="Office2016Touch_Checked" FontFamily="Segoe UI" VerticalContentAlignment="Center" FontSize="14" Margin="0,4" Content="Office2016Touch" Foreground="#CC000000"/>
<RadioButton x:Name="Office2016" Checked="Office2016_Checked" FontFamily="Segoe UI" VerticalContentAlignment="Center" FontSize="14" Margin="0,4" Content="Office2016" Foreground="#CC000000"/>
<RadioButton x:Name="Green_Light" Checked="Green_Light_Checked" FontFamily="Segoe UI" VerticalContentAlignment="Center" FontSize="14" Margin="0,4" Content="Green_Dark" Foreground="#CC000000"/>
<RadioButton x:Name="Green_Dark" Checked="Green_Dark_Checked" FontFamily="Segoe UI" VerticalContentAlignment="Center" FontSize="14" Margin="0,4" Content="Green_Light" Foreground="#CC000000"/>
Expand Down
14 changes: 14 additions & 0 deletions MSControls/ThemingExample/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,19 @@ private void Office2016_Checked(object sender, RoutedEventArgs e)
});
this.container.Background = new SolidColorBrush(Colors.White);
}

private void Office2016Touch_Checked(object sender, RoutedEventArgs e)
{
Application.Current.Resources.MergedDictionaries.Clear();
Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
{
Source = new Uri("/Telerik.Windows.Themes.Office2016Touch;component/Themes/System.Windows.xaml", UriKind.RelativeOrAbsolute)
});
Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
{
Source = new Uri("/Telerik.Windows.Themes.Office2016Touch;component/Themes/Telerik.Windows.Controls.xaml", UriKind.RelativeOrAbsolute)
});
this.container.Background = new SolidColorBrush(Colors.White);
}
}
}
8 changes: 6 additions & 2 deletions MSControls/ThemingExample/Theming_WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<Reference Include="Telerik.Windows.Controls">
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Controls.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Themes.Office2016Touch">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Office2016Touch.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Themes.Office_Black">
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Office_Black.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -91,10 +95,10 @@
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Windows8Touch.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Themes.Green">
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Green.dll</HintPath>
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Green.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Themes.Office2016">
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Office2016.dll</HintPath>
<HintPath>$(TELERIKWPFDIR)\Binaries.NoXaml\WPF40\Telerik.Windows.Themes.Office2016.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
Expand Down
43 changes: 27 additions & 16 deletions Map/Silverlight/Geocode/Geocode/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Geocode
{
public partial class MainPage : UserControl
{
BingGeocodeProvider geocodeProvider;
BingRestMapProvider restProvider;

public MainPage()
{
Expand All @@ -18,36 +18,47 @@ private void Button_Click_1(object sender, RoutedEventArgs e)
{
string bingMapsKey = this.BingMapsKey.Text;

this.radMap.Provider = new BingMapProvider(MapMode.Aerial, true, bingMapsKey);

this.geocodeProvider = new BingGeocodeProvider();
this.geocodeProvider.ApplicationId = (this.radMap.Provider as BingMapProvider).ApplicationId;
this.geocodeProvider.MapControl = this.radMap;
this.geocodeProvider.GeocodeCompleted += this.geocodeProvider_GeocodeCompleted;

this.restProvider = new BingRestMapProvider(MapMode.Aerial, true, bingMapsKey);
this.radMap.Provider = this.restProvider;
this.restProvider.SearchLocationCompleted += this.restProvider_SearchLocationCompleted;
this.restProvider.SearchLocationError += this.restProvider_SearchLocationError;
this.GeocodeButton.IsEnabled = true;
}

private void geocodeProvider_GeocodeCompleted(object sender, GeocodeCompletedEventArgs e)
private void restProvider_SearchLocationError(object sender, BingRestSearchLocationErrorEventArgs e)
{
MessageBox.Show(e.Error.ToString());
}

private void restProvider_SearchLocationCompleted(object sender, BingRestSearchLocationCompletedEventArgs e)
{
foreach (GeocodeResult result in e.Response.Results)
double[] bbox = e.Locations[0].BoundingBox;
LocationRect rect = new LocationRect(new Location(bbox[2], bbox[1]), new Location(bbox[0], bbox[3]));
this.radMap.SetView(rect);

foreach (Telerik.Windows.Controls.DataVisualization.Map.BingRest.Location location in e.Locations)
{
MessageBox.Show(string.Format("Longitude: {0}, Latitude: {1}, Address: {2}", result.Locations.First().Longitude, result.Locations.First().Latitude, result.DisplayName));
var coordinates = location.GeocodePoints[0].Coordinates;
double latitude = coordinates[0];
double longitude = coordinates[1];
MessageBox.Show(string.Format("Longitude: {0}, Latitude: {1}, Address: {2}", longitude, latitude, location.Address.FormattedAddress));
}
}

private void GeocodeButton_Click(object sender, RoutedEventArgs e)
{
GeocodeRequest request = new GeocodeRequest();
// Search Location by string Query. Geocode.
BingRestSearchLocationRequest request = new BingRestSearchLocationRequest();
request.Query = this.InputBox.Text;
this.geocodeProvider.GeocodeAsync(request);
this.restProvider.SearchLocationAsync(request);
}

private void radMap_MapMouseDoubleClick(object sender, MapMouseRoutedEventArgs e)
{
ReverseGeocodeRequest reverseRequest = new ReverseGeocodeRequest();
reverseRequest.Location = e.Location;
this.geocodeProvider.ReverseGeocodeAsync(reverseRequest);
// Search Address by Location. Reversed geocode.
BingRestSearchLocationRequest reverseRequest = new BingRestSearchLocationRequest();
reverseRequest.Query = e.Location.ToString();
this.restProvider.SearchLocationAsync(reverseRequest);
}
}
}
5 changes: 3 additions & 2 deletions Map/Silverlight/Geocode/Geocode/Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
##Geocode##
The RadMap provides unified geocoding architecture, which uses the functionality of the different geocoding services. This allows you to easily convert a location point to an address and the opposite - address to a location point.
The RadMap provides unified geocoding architecture, incorporated in the BingRestMapProvider SearchLocation API.
This allows you to easily convert a location point to an address and the opposite - address to a location point.

To see and run the example, please use the 'Open in VS' button and execute the project inside Visual Studio.

<keywords: GeocodeProvider, ReverseGeocodeRequest, Location, Address, Service>
<keywords: GeocodeProvider, ReverseGeocodeRequest, Location, Address, Service, BingRestMapProvider>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private void Button_Click_1(object sender, RoutedEventArgs e)
{
string bingMapsKey = this.BingMapsKey.Text;

BingMapProvider bingMap = new BingMapProvider(MapMode.Aerial, true, bingMapsKey);
BingRestMapProvider bingMap = new BingRestMapProvider(MapMode.Aerial, true, bingMapsKey);
this.radMap.Provider = bingMap;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##Providers Bing Map Provider##
The RadMap control doesn't display a map on itself, it needs a map provider from which to consume the required data. This example demonstrates the BingMapProvider.
The RadMap control doesn't display a map on itself, it needs a map provider from which to consume the required data. This example demonstrates the BingRestMapProvider.

To see and run the example, please use the 'Open in VS' button and execute the project inside Visual Studio.

<keywords:MapMode>
<keywords:MapMode, BingMapProvider, BingRestMap>

This file was deleted.

Loading

0 comments on commit c67c3b4

Please sign in to comment.