Added Surface sample application

This commit is contained in:
ClemensF 2012-07-04 17:19:48 +02:00
parent e77e3d8562
commit 6b25260536
27 changed files with 564 additions and 45 deletions

View file

@ -397,7 +397,7 @@ namespace Caching
{ {
if (fileDb.IsOpen) if (fileDb.IsOpen)
{ {
Trace.TraceWarning("FileDbCache is reindexing database"); Trace.TraceWarning("FileDbCache is reindexing the cache database");
fileDb.Reindex(); fileDb.Reindex();
return true; return true;
} }

View file

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("FileDbCache")] [assembly: AssemblyTitle("FileDbCache")]
[assembly: AssemblyDescription("ObjectCache implementation based on EzTools FileDb")] [assembly: AssemblyDescription("ObjectCache implementation based on EzTools FileDb")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyProduct("FileDbCache")] [assembly: AssemblyProduct("FileDbCache")]
[assembly: AssemblyCopyright("Copyright © 2012 Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2012 Clemens Fischer")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View file

@ -3,10 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 # Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl", "MapControl\MapControl.csproj", "{06481252-2310-414A-B9FC-D5739FDF6BD3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl", "MapControl\MapControl.csproj", "{06481252-2310-414A-B9FC-D5739FDF6BD3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication", "TestApplication\TestApplication.csproj", "{CCBCDAE5-E68F-43A8-930A-0749E476D29D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDbCache", "Caching\FileDbCache\FileDbCache.csproj", "{EF44F661-B98A-4676-927F-85D138F82300}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDbCache", "Caching\FileDbCache\FileDbCache.csproj", "{EF44F661-B98A-4676-927F-85D138F82300}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApplication", "SampleApps\SampleApplication\SampleApplication.csproj", "{CCBCDAE5-E68F-43A8-930A-0749E476D29D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SurfaceApplication", "SampleApps\SurfaceApplication\SurfaceApplication.csproj", "{6285FB9D-B7EA-469A-B464-224077967167}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -27,16 +29,6 @@ Global
{06481252-2310-414A-B9FC-D5739FDF6BD3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {06481252-2310-414A-B9FC-D5739FDF6BD3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{06481252-2310-414A-B9FC-D5739FDF6BD3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {06481252-2310-414A-B9FC-D5739FDF6BD3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{06481252-2310-414A-B9FC-D5739FDF6BD3}.Release|x86.ActiveCfg = Release|Any CPU {06481252-2310-414A-B9FC-D5739FDF6BD3}.Release|x86.ActiveCfg = Release|Any CPU
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|Any CPU.ActiveCfg = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|Mixed Platforms.Build.0 = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|x86.ActiveCfg = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|x86.Build.0 = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|Any CPU.ActiveCfg = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|Mixed Platforms.ActiveCfg = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|Mixed Platforms.Build.0 = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|x86.ActiveCfg = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|x86.Build.0 = Release|x86
{EF44F661-B98A-4676-927F-85D138F82300}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EF44F661-B98A-4676-927F-85D138F82300}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF44F661-B98A-4676-927F-85D138F82300}.Debug|Any CPU.Build.0 = Debug|Any CPU {EF44F661-B98A-4676-927F-85D138F82300}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF44F661-B98A-4676-927F-85D138F82300}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {EF44F661-B98A-4676-927F-85D138F82300}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -47,6 +39,26 @@ Global
{EF44F661-B98A-4676-927F-85D138F82300}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {EF44F661-B98A-4676-927F-85D138F82300}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{EF44F661-B98A-4676-927F-85D138F82300}.Release|Mixed Platforms.Build.0 = Release|Any CPU {EF44F661-B98A-4676-927F-85D138F82300}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{EF44F661-B98A-4676-927F-85D138F82300}.Release|x86.ActiveCfg = Release|Any CPU {EF44F661-B98A-4676-927F-85D138F82300}.Release|x86.ActiveCfg = Release|Any CPU
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|Any CPU.ActiveCfg = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|Mixed Platforms.Build.0 = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|x86.ActiveCfg = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Debug|x86.Build.0 = Debug|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|Any CPU.ActiveCfg = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|Mixed Platforms.ActiveCfg = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|Mixed Platforms.Build.0 = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|x86.ActiveCfg = Release|x86
{CCBCDAE5-E68F-43A8-930A-0749E476D29D}.Release|x86.Build.0 = Release|x86
{6285FB9D-B7EA-469A-B464-224077967167}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Debug|x86.ActiveCfg = Debug|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Release|Any CPU.Build.0 = Release|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6285FB9D-B7EA-469A-B464-224077967167}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -3,7 +3,6 @@
// Licensed under the Microsoft Public License (Ms-PL) // Licensed under the Microsoft Public License (Ms-PL)
using System; using System;
using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
@ -395,7 +394,7 @@ namespace MapControl
{ {
SetTransformOrigin(origin); SetTransformOrigin(origin);
updateTransform = false; updateTransform = false;
Heading += rotation; Heading = (((Heading + rotation) % 360d) + 360d) % 360d;
ZoomLevel += Math.Log(scale, 2d); ZoomLevel += Math.Log(scale, 2d);
updateTransform = true; updateTransform = true;
UpdateViewTransform(); UpdateViewTransform();

View file

@ -12,8 +12,8 @@ using System.Windows.Shapes;
namespace MapControl namespace MapControl
{ {
/// <summary> /// <summary>
/// Draws a graticule overlay. The minimum spacing in pixels between adjacent graticule lines /// Draws a graticule overlay. The minimum spacing in pixels between adjacent
/// is specified by the MinSpacingPixels property. /// graticule lines is specified by the MinLineSpacing property.
/// </summary> /// </summary>
public class MapGraticule : MapElement public class MapGraticule : MapElement
{ {
@ -41,8 +41,8 @@ namespace MapControl
public static readonly DependencyProperty StrokeThicknessProperty = Shape.StrokeThicknessProperty.AddOwner( public static readonly DependencyProperty StrokeThicknessProperty = Shape.StrokeThicknessProperty.AddOwner(
typeof(MapGraticule), new FrameworkPropertyMetadata(0.5, (o, e) => ((MapGraticule)o).pen.Thickness = (double)e.NewValue)); typeof(MapGraticule), new FrameworkPropertyMetadata(0.5, (o, e) => ((MapGraticule)o).pen.Thickness = (double)e.NewValue));
public static readonly DependencyProperty MinSpacingPixelsProperty = DependencyProperty.Register( public static readonly DependencyProperty MinLineSpacingProperty = DependencyProperty.Register(
"MinSpacingPixels", typeof(double), typeof(MapGraticule), new FrameworkPropertyMetadata(100d)); "MinLineSpacing", typeof(double), typeof(MapGraticule), new FrameworkPropertyMetadata(100d));
public static double[] Spacings = public static double[] Spacings =
new double[] { 1d / 60d, 1d / 30d, 1d / 12d, 1d / 6d, 1d / 4d, 1d / 3d, 1d / 2d, 1d, 2d, 5d, 10d, 15d, 20d, 30d, 45d }; new double[] { 1d / 60d, 1d / 30d, 1d / 12d, 1d / 6d, 1d / 4d, 1d / 3d, 1d / 2d, 1d, 2d, 5d, 10d, 15d, 20d, 30d, 45d };
@ -106,10 +106,13 @@ namespace MapControl
set { SetValue(StrokeThicknessProperty, value); } set { SetValue(StrokeThicknessProperty, value); }
} }
public double MinSpacingPixels /// <summary>
/// Minimum spacing in pixels between adjacent graticule lines.
/// </summary>
public double MinLineSpacing
{ {
get { return (double)GetValue(MinSpacingPixelsProperty); } get { return (double)GetValue(MinLineSpacingProperty); }
set { SetValue(MinSpacingPixelsProperty, value); } set { SetValue(MinLineSpacingProperty, value); }
} }
protected override int VisualChildrenCount protected override int VisualChildrenCount
@ -127,7 +130,7 @@ namespace MapControl
Rect bounds = parentMap.ViewportTransform.Inverse.TransformBounds(new Rect(parentMap.RenderSize)); Rect bounds = parentMap.ViewportTransform.Inverse.TransformBounds(new Rect(parentMap.RenderSize));
Location loc1 = parentMap.MapTransform.TransformBack(bounds.TopLeft); Location loc1 = parentMap.MapTransform.TransformBack(bounds.TopLeft);
Location loc2 = parentMap.MapTransform.TransformBack(bounds.BottomRight); Location loc2 = parentMap.MapTransform.TransformBack(bounds.BottomRight);
double minSpacing = MinSpacingPixels * 360d / (Math.Pow(2d, parentMap.ZoomLevel) * 256d); double minSpacing = MinLineSpacing * 360d / (Math.Pow(2d, parentMap.ZoomLevel) * 256d);
double spacing = Spacings[Spacings.Length - 1]; double spacing = Spacings[Spacings.Length - 1];
if (spacing >= minSpacing) if (spacing >= minSpacing)

View file

@ -82,12 +82,12 @@ namespace MapControl
this.tileLayer = tileLayer; this.tileLayer = tileLayer;
} }
internal void StartDownloadTiles(ICollection<Tile> tiles) internal void BeginDownloadTiles(ICollection<Tile> tiles)
{ {
ThreadPool.QueueUserWorkItem(StartDownloadTilesAsync, new List<Tile>(tiles.Where(t => t.Image == null && t.Uri == null))); ThreadPool.QueueUserWorkItem(BeginDownloadTilesAsync, new List<Tile>(tiles.Where(t => t.Image == null && t.Uri == null)));
} }
internal void StopDownloadTiles() internal void CancelDownloadTiles()
{ {
lock (pendingTiles) lock (pendingTiles)
{ {
@ -103,7 +103,7 @@ namespace MapControl
} }
} }
private void StartDownloadTilesAsync(object newTilesList) private void BeginDownloadTilesAsync(object newTilesList)
{ {
List<Tile> newTiles = (List<Tile>)newTilesList; List<Tile> newTiles = (List<Tile>)newTilesList;
@ -223,7 +223,7 @@ namespace MapControl
{ {
TraceInformation("{0} - {1}", tile.Uri, ((HttpWebResponse)exc.Response).StatusCode); TraceInformation("{0} - {1}", tile.Uri, ((HttpWebResponse)exc.Response).StatusCode);
} }
else if (exc.Status == WebExceptionStatus.RequestCanceled) else if (exc.Status == WebExceptionStatus.RequestCanceled) // by HttpWebRequest.Abort in CancelDownloadTiles
{ {
TraceInformation("{0} - {1}", tile.Uri, exc.Status); TraceInformation("{0} - {1}", tile.Uri, exc.Status);
} }
@ -283,7 +283,7 @@ namespace MapControl
private static void TraceInformation(string format, params object[] args) private static void TraceInformation(string format, params object[] args)
{ {
Trace.TraceInformation("[{0:00}] {1}", Thread.CurrentThread.ManagedThreadId, string.Format(format, args)); //Trace.TraceInformation("[{0:00}] {1}", Thread.CurrentThread.ManagedThreadId, string.Format(format, args));
} }
} }
} }

View file

@ -58,21 +58,21 @@ namespace MapControl
this.grid = grid; this.grid = grid;
this.zoomLevel = zoomLevel; this.zoomLevel = zoomLevel;
tileImageLoader.StopDownloadTiles(); tileImageLoader.CancelDownloadTiles();
if (VisualParent != null && TileSource != null) if (VisualParent != null && TileSource != null)
{ {
SelectTiles(); SelectTiles();
RenderTiles(); RenderTiles();
tileImageLoader.StartDownloadTiles(tiles); tileImageLoader.BeginDownloadTiles(tiles);
} }
} }
public void ClearTiles() public void ClearTiles()
{ {
tiles.Clear(); tiles.Clear();
tileImageLoader.StopDownloadTiles(); tileImageLoader.CancelDownloadTiles();
} }
private void SelectTiles() private void SelectTiles()

View file

@ -1,4 +1,4 @@
<Application x:Class="MapControlTestApp.App" <Application x:Class="SampleApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">

View file

@ -1,6 +1,6 @@
using System.Windows; using System.Windows;
namespace MapControlTestApp namespace SampleApplication
{ {
public partial class App : Application public partial class App : Application
{ {

View file

@ -1,8 +1,8 @@
<Window x:Class="MapControlTestApp.MainWindow" <Window x:Class="SampleApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl;assembly=MapControl" xmlns:map="clr-namespace:MapControl;assembly=MapControl"
xmlns:local="clr-namespace:MapControlTestApp" xmlns:local="clr-namespace:SampleApplication"
Title="MainWindow" Height="600" Width="800"> Title="MainWindow" Height="600" Width="800">
<Window.Resources> <Window.Resources>
<map:TileLayer x:Key="SeamarksTileLayer" <map:TileLayer x:Key="SeamarksTileLayer"

View file

@ -9,7 +9,7 @@ using System.Windows.Media;
using MapControl; using MapControl;
using Caching; using Caching;
namespace MapControlTestApp namespace SampleApplication
{ {
public partial class MainWindow : Window public partial class MainWindow : Window
{ {

View file

@ -7,8 +7,8 @@ using System.Windows;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("TestApplication")] [assembly: AssemblyTitle("SampleApplication")]
[assembly: AssemblyDescription("WPF Map Control Test Application")] [assembly: AssemblyDescription("WPF Map Control Sample Application")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyProduct("WPF Map Control")] [assembly: AssemblyProduct("WPF Map Control")]

View file

@ -8,8 +8,8 @@
<ProjectGuid>{CCBCDAE5-E68F-43A8-930A-0749E476D29D}</ProjectGuid> <ProjectGuid>{CCBCDAE5-E68F-43A8-930A-0749E476D29D}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MapControlTestApp</RootNamespace> <RootNamespace>SampleApplication</RootNamespace>
<AssemblyName>MapControlTestApp</AssemblyName> <AssemblyName>SampleApplication</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
@ -75,11 +75,11 @@
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Caching\FileDbCache\FileDbCache.csproj"> <ProjectReference Include="..\..\Caching\FileDbCache\FileDbCache.csproj">
<Project>{EF44F661-B98A-4676-927F-85D138F82300}</Project> <Project>{EF44F661-B98A-4676-927F-85D138F82300}</Project>
<Name>FileDbCache</Name> <Name>FileDbCache</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\MapControl\MapControl.csproj"> <ProjectReference Include="..\..\MapControl\MapControl.csproj">
<Project>{06481252-2310-414A-B9FC-D5739FDF6BD3}</Project> <Project>{06481252-2310-414A-B9FC-D5739FDF6BD3}</Project>
<Name>MapControl</Name> <Name>MapControl</Name>
</ProjectReference> </ProjectReference>

View file

@ -1,7 +1,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using MapControl; using MapControl;
namespace MapControlTestApp namespace SampleApplication
{ {
class SamplePoint class SamplePoint
{ {

View file

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View file

@ -0,0 +1,12 @@
<Application x:Class="SurfaceApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Microsoft.Surface.Presentation.Generic;v2.0.0.0;31bf3856ad364e35;component/themes\styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View file

@ -0,0 +1,8 @@
using System.Windows;
namespace SurfaceApplication
{
public partial class App : Application
{
}
}

View file

@ -0,0 +1,14 @@
<s:SurfaceWindow x:Class="SurfaceApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="http://schemas.microsoft.com/surface/2008"
xmlns:m="clr-namespace:MapControl;assembly=MapControl"
Title="SurfaceApplication">
<Grid>
<m:Map Center="54,8" ZoomLevel="10"
LightForeground="Black" LightBackground="LightGray"
IsManipulationEnabled="True" TouchDown="MapTouchDown">
<m:MapGraticule Opacity="0.5" MinLineSpacing="200"/>
</m:Map>
</Grid>
</s:SurfaceWindow>

View file

@ -0,0 +1,28 @@
using System.Windows.Input;
using Microsoft.Surface;
using Microsoft.Surface.Presentation.Controls;
using Microsoft.Surface.Presentation.Input;
namespace SurfaceApplication
{
public partial class MainWindow : SurfaceWindow
{
public MainWindow()
{
InitializeComponent();
}
private void MapTouchDown(object sender, TouchEventArgs e)
{
if (SurfaceEnvironment.IsSurfaceEnvironmentAvailable &&
!e.Device.GetIsFingerRecognized())
{
// If touch event is from a blob or tag, prevent touch capture by setting
// TouchEventArgs.Handled = true. Hence no manipulation will be started.
// See http://msdn.microsoft.com/en-us/library/ms754010#touch_and_manipulation
e.Handled = true;
}
}
}
}

View file

@ -0,0 +1,64 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Resources;
using System.Globalization;
using System.Windows;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SurfaceApplication")]
[assembly: AssemblyDescription("WPF Map Control Sample SurfaceApplication")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyProduct("WPF Map Control")]
[assembly: AssemblyCopyright("Copyright © 2012 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
// Specifies the location in which theme dictionaries are stored for types in an assembly.
[assembly: ThemeInfo(
// Specifies the location of system theme-specific resource dictionaries for this project.
// The default setting in this project is "None" since this default project does not
// include these user-defined theme files:
// Themes\Aero.NormalColor.xaml
// Themes\Classic.xaml
// Themes\Luna.Homestead.xaml
// Themes\Luna.Metallic.xaml
// Themes\Luna.NormalColor.xaml
// Themes\Royale.NormalColor.xaml
ResourceDictionaryLocation.None,
// Specifies the location of the system non-theme specific resource dictionary:
// Themes\generic.xaml
ResourceDictionaryLocation.SourceAssembly)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SurfaceApplication.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SurfaceApplication.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View file

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SurfaceApplication.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View file

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View file

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6285FB9D-B7EA-469A-B464-224077967167}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SurfaceApplication</RootNamespace>
<AssemblyName>SurfaceApplication</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Microsoft.Surface" />
<Reference Include="Microsoft.Surface.Presentation" />
<Reference Include="Microsoft.Surface.Presentation.Generic" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="App.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Content Include="SurfaceApplication.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\MapControl\MapControl.csproj">
<Project>{06481252-2310-414A-B9FC-D5739FDF6BD3}</Project>
<Name>MapControl</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains the information needed to install your application
with the Surface Shell. Please refer to the documentation for deployment
instructions.
-->
<ss:ApplicationInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ss="http://schemas.microsoft.com/Surface/2007/ApplicationMetadata">
<Application>
<Title>SurfaceApplication</Title>
<Description>SurfaceApplication</Description>
<ExecutableFile>SurfaceApplication.exe</ExecutableFile>
<Arguments>
</Arguments>
<IconImageFile>Resources\icon.png</IconImageFile>
<Tags>
<!--
If your application uses tagged objects, please uncomment this section to register the tags with the Shell.
You can register Tags by using the appropriate instructions below.
-->
<!--
To register a specific value Tag:
1. Please uncomment the Tag Element below.
2. Replace "C0" below with the value of your Tag (in hexadecimal format). Repeat this section (this element and its children) for other Tags
3. Please remove the Launch element if you do not want to register the tag with Object Routing.
-->
<!--
<Tag Value="0xC0">
<Actions>
<Launch />
</Actions>
</Tag>
-->
<!--
To register all Tags in a series:
1. Please uncomment the Tag Element below.
2. Replace "0000000000000000" below with the series of your Tag (in hexadecimal format). Repeat this section (this element and its children) for other Tags
3. Please remove the Launch element if you do not want to register the tag with Object Routing.
-->
<!--
<Tag Series="0x0000000000000000">
<Actions>
<Launch />
</Actions>
</Tag>
-->
</Tags>
</Application>
</ss:ApplicationInfo>