From 2047d43cba5d2edcb36314cfc31a8198d8151d39 Mon Sep 17 00:00:00 2001 From: martinivanoff Date: Tue, 18 Dec 2018 12:14:25 +0200 Subject: [PATCH] Update examples --- ChartView/WPF/ChartView_WPF.sln | 116 ++++++++ ChartView/WPF/DataVirtualization/App.xaml | 9 + ChartView/WPF/DataVirtualization/App.xaml.cs | 16 + .../ChartDataVirtualizationViewModel.cs | 105 +++++++ .../DataVirtualization.csproj | 141 +++++++++ .../WPF/DataVirtualization/MainWindow.xaml | 32 ++ .../WPF/DataVirtualization/MainWindow.xaml.cs | 20 ++ ChartView/WPF/DataVirtualization/PlotInfo.cs | 8 + .../Properties/AssemblyInfo.cs | 55 ++++ .../Properties/Resources.Designer.cs | 71 +++++ .../Properties/Resources.resx | 117 ++++++++ .../Properties/Settings.Designer.cs | 30 ++ .../Properties/Settings.settings | 7 + ChartView/WPF/DataVirtualization/Readme.md | 5 + ChartView/WPF/ErrorBars/Readme.md | 2 +- Diagram/Diagrams_WPF.sln | 29 +- Diagram/ExportToHighQualityImage/App.xaml | 9 + Diagram/ExportToHighQualityImage/App.xaml.cs | 16 + .../CustomExportExtensions.cs | 151 ++++++++++ .../ExportToHighQualityImage_WPF.csproj | 114 ++++++++ .../ExportToHighQualityImage/MainWindow.xaml | 26 ++ .../MainWindow.xaml.cs | 33 +++ .../Properties/AssemblyInfo.cs | 55 ++++ .../Properties/Resources.Designer.cs | 71 +++++ .../Properties/Resources.resx | 117 ++++++++ .../Properties/Settings.Designer.cs | 30 ++ .../Properties/Settings.settings | 7 + Diagram/ExportToHighQualityImage/readme.md | 5 + DragDrop/CustomArrowCue/App.xaml | 9 + DragDrop/CustomArrowCue/App.xaml.cs | 16 + DragDrop/CustomArrowCue/ArrowShape.cs | 62 ++++ .../CustomArrowCue/CustomArrowCue_WPF.csproj | 99 +++++++ .../DragDropManagerUtilities.cs | 123 ++++++++ DragDrop/CustomArrowCue/MainWindow.xaml | 40 +++ DragDrop/CustomArrowCue/MainWindow.xaml.cs | 27 ++ .../CustomArrowCue/Properties/AssemblyInfo.cs | 55 ++++ .../Properties/Resources.Designer.cs | 71 +++++ .../CustomArrowCue/Properties/Resources.resx | 117 ++++++++ .../Properties/Settings.Designer.cs | 30 ++ .../Properties/Settings.settings | 7 + DragDrop/CustomArrowCue/Readme.md | 5 + Map/WPF/AsyncSqlGeospatialDataReader/App.xaml | 9 + .../AsyncSqlGeospatialDataReader/App.xaml.cs | 16 + .../AsyncSqlGeospatialDataReader.csproj | 111 +++++++ .../MainWindow.xaml | 39 +++ .../MainWindow.xaml.cs | 13 + .../Properties/AssemblyInfo.cs | 55 ++++ .../Properties/Resources.Designer.cs | 71 +++++ .../Properties/Resources.resx | 117 ++++++++ .../Properties/Settings.Designer.cs | 30 ++ .../Properties/Settings.settings | 7 + .../AsyncSqlGeospatialDataReader/Readme.md | 5 + .../WktDataStorage.cs | 273 ++++++++++++++++++ .../WktItemModel.cs | 8 + Map/WPF/Map_WPF.sln | 13 +- PdfViewer/CustomPrinting/Readme.md | 4 +- 56 files changed, 2819 insertions(+), 10 deletions(-) create mode 100644 ChartView/WPF/DataVirtualization/App.xaml create mode 100644 ChartView/WPF/DataVirtualization/App.xaml.cs create mode 100644 ChartView/WPF/DataVirtualization/ChartDataVirtualizationViewModel.cs create mode 100644 ChartView/WPF/DataVirtualization/DataVirtualization.csproj create mode 100644 ChartView/WPF/DataVirtualization/MainWindow.xaml create mode 100644 ChartView/WPF/DataVirtualization/MainWindow.xaml.cs create mode 100644 ChartView/WPF/DataVirtualization/PlotInfo.cs create mode 100644 ChartView/WPF/DataVirtualization/Properties/AssemblyInfo.cs create mode 100644 ChartView/WPF/DataVirtualization/Properties/Resources.Designer.cs create mode 100644 ChartView/WPF/DataVirtualization/Properties/Resources.resx create mode 100644 ChartView/WPF/DataVirtualization/Properties/Settings.Designer.cs create mode 100644 ChartView/WPF/DataVirtualization/Properties/Settings.settings create mode 100644 ChartView/WPF/DataVirtualization/Readme.md create mode 100644 Diagram/ExportToHighQualityImage/App.xaml create mode 100644 Diagram/ExportToHighQualityImage/App.xaml.cs create mode 100644 Diagram/ExportToHighQualityImage/CustomExportExtensions.cs create mode 100644 Diagram/ExportToHighQualityImage/ExportToHighQualityImage_WPF.csproj create mode 100644 Diagram/ExportToHighQualityImage/MainWindow.xaml create mode 100644 Diagram/ExportToHighQualityImage/MainWindow.xaml.cs create mode 100644 Diagram/ExportToHighQualityImage/Properties/AssemblyInfo.cs create mode 100644 Diagram/ExportToHighQualityImage/Properties/Resources.Designer.cs create mode 100644 Diagram/ExportToHighQualityImage/Properties/Resources.resx create mode 100644 Diagram/ExportToHighQualityImage/Properties/Settings.Designer.cs create mode 100644 Diagram/ExportToHighQualityImage/Properties/Settings.settings create mode 100644 Diagram/ExportToHighQualityImage/readme.md create mode 100644 DragDrop/CustomArrowCue/App.xaml create mode 100644 DragDrop/CustomArrowCue/App.xaml.cs create mode 100644 DragDrop/CustomArrowCue/ArrowShape.cs create mode 100644 DragDrop/CustomArrowCue/CustomArrowCue_WPF.csproj create mode 100644 DragDrop/CustomArrowCue/DragDropManagerUtilities.cs create mode 100644 DragDrop/CustomArrowCue/MainWindow.xaml create mode 100644 DragDrop/CustomArrowCue/MainWindow.xaml.cs create mode 100644 DragDrop/CustomArrowCue/Properties/AssemblyInfo.cs create mode 100644 DragDrop/CustomArrowCue/Properties/Resources.Designer.cs create mode 100644 DragDrop/CustomArrowCue/Properties/Resources.resx create mode 100644 DragDrop/CustomArrowCue/Properties/Settings.Designer.cs create mode 100644 DragDrop/CustomArrowCue/Properties/Settings.settings create mode 100644 DragDrop/CustomArrowCue/Readme.md create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/App.xaml create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/App.xaml.cs create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/AsyncSqlGeospatialDataReader.csproj create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml.cs create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/Properties/AssemblyInfo.cs create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.Designer.cs create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.resx create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.Designer.cs create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.settings create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/Readme.md create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/WktDataStorage.cs create mode 100644 Map/WPF/AsyncSqlGeospatialDataReader/WktItemModel.cs diff --git a/ChartView/WPF/ChartView_WPF.sln b/ChartView/WPF/ChartView_WPF.sln index 93a0d759b..3be7615ab 100644 --- a/ChartView/WPF/ChartView_WPF.sln +++ b/ChartView/WPF/ChartView_WPF.sln @@ -105,6 +105,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxisLikeAnnotations", "Axis EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ErrorBars", "ErrorBars\ErrorBars.csproj", "{3DCF18D5-6A82-4861-85C7-7F177E3D6828}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataVirtualization", "DataVirtualization\DataVirtualization.csproj", "{3529A289-59B7-49F8-A306-3AA51BBC53B4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.NoXaml|Any CPU = Debug.NoXaml|Any CPU @@ -3666,6 +3668,120 @@ Global {3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU {3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU {3DCF18D5-6A82-4861-85C7-7F177E3D6828}.ReleaseTrial451|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Any CPU.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|x86.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug.NoXaml|x86.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|x86.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug|x86.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Any CPU.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|x86.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45.NoXaml|x86.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Any CPU.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Any CPU.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|Mixed Platforms.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|x86.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug45|x86.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Any CPU.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|x86.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451.NoXaml|x86.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Any CPU.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Any CPU.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|Mixed Platforms.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|x86.ActiveCfg = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Debug451|x86.Build.0 = Debug|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release.NoXaml|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45.NoXaml|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release45|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451.NoXaml|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.Release451|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseNoCA|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial.NoXaml|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45.NoXaml|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial45|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451.NoXaml|x86.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Any CPU.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Any CPU.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Mixed Platforms.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4}.ReleaseTrial451|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ChartView/WPF/DataVirtualization/App.xaml b/ChartView/WPF/DataVirtualization/App.xaml new file mode 100644 index 000000000..976fd9f67 --- /dev/null +++ b/ChartView/WPF/DataVirtualization/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/ChartView/WPF/DataVirtualization/App.xaml.cs b/ChartView/WPF/DataVirtualization/App.xaml.cs new file mode 100644 index 000000000..57ee1f86e --- /dev/null +++ b/ChartView/WPF/DataVirtualization/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace DataVirtualization +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/ChartView/WPF/DataVirtualization/ChartDataVirtualizationViewModel.cs b/ChartView/WPF/DataVirtualization/ChartDataVirtualizationViewModel.cs new file mode 100644 index 000000000..4e1d009b6 --- /dev/null +++ b/ChartView/WPF/DataVirtualization/ChartDataVirtualizationViewModel.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.ObjectModel; +using System.Linq; +using Telerik.Windows.Controls; + +namespace DataVirtualization +{ + public class ChartDataVirtualizationViewModel : ViewModelBase + { + private const int FullDataCount = 1000000; + private const double RangeOffset = 0.01; + private static Random randomNumberGenerator = new Random(); + + private ObservableCollection fullData; + private ObservableCollection visibleData; + private double minimumX; + private double maximumX; + + public ChartDataVirtualizationViewModel() + { + this.fullData = this.GenerateFullData(); + this.MinimumX = this.fullData.FirstOrDefault().XValue; + this.MaximumX = this.fullData.LastOrDefault().XValue; + this.visibleData = new ObservableCollection(); + } + + public double MinimumX + { + get { return this.minimumX; } + set + { + if (this.minimumX != value) + { + this.minimumX = value; + this.OnPropertyChanged("MinimumX"); + } + } + } + + public double MaximumX + { + get { return this.maximumX; } + set + { + if (this.maximumX != value) + { + this.maximumX = value; + this.OnPropertyChanged("MaximumX"); + } + } + } + + public ObservableCollection FullData + { + get { return this.fullData; } + } + + public ObservableCollection VisibleData + { + get { return this.visibleData; } + private set + { + if (this.visibleData != value) + { + this.visibleData = value; + this.OnPropertyChanged("VisibleData"); + } + } + } + + public void UpdateVisibleData(double minimum, double maximum) + { + double delta = maximum - minimum; + double offset = delta * RangeOffset; + double offsetMinimum = minimum - offset; + double offsetMaximum = maximum + offset; + + this.VisibleData = this.GetVisibleItems(offsetMinimum, offsetMaximum); + } + + private ObservableCollection GetVisibleItems(double minimum, double maximum) + { + ObservableCollection result = new ObservableCollection(); + for (int i = 0; i < this.fullData.Count; i++) + { + PlotInfo info = this.fullData[i]; + if (minimum <= info.XValue && info.XValue <= maximum) + { + result.Add(info); + } + } + return result; + } + + private ObservableCollection GenerateFullData() + { + ObservableCollection result = new ObservableCollection(); + for (int i = 0; i < FullDataCount; i++) + { + result.Add(new PlotInfo() { XValue = i, YValue = randomNumberGenerator.Next(100, 300) }); + } + return result; + } + } +} diff --git a/ChartView/WPF/DataVirtualization/DataVirtualization.csproj b/ChartView/WPF/DataVirtualization/DataVirtualization.csproj new file mode 100644 index 000000000..962238dbc --- /dev/null +++ b/ChartView/WPF/DataVirtualization/DataVirtualization.csproj @@ -0,0 +1,141 @@ + + + + + Debug + AnyCPU + {3529A289-59B7-49F8-A306-3AA51BBC53B4} + WinExe + DataVirtualization + DataVirtualization + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.D3DCompiler.dll + + + $(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.Direct2D1.dll + + + $(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.Direct3D10.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.Direct3D9.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\SharpDX\SharpDX.DXGI.dll + + + + + + + + + + 4.0 + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Cloud.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Chart.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Chart.Direct2D.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + \ No newline at end of file diff --git a/ChartView/WPF/DataVirtualization/MainWindow.xaml b/ChartView/WPF/DataVirtualization/MainWindow.xaml new file mode 100644 index 000000000..ad3630e6b --- /dev/null +++ b/ChartView/WPF/DataVirtualization/MainWindow.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ChartView/WPF/DataVirtualization/MainWindow.xaml.cs b/ChartView/WPF/DataVirtualization/MainWindow.xaml.cs new file mode 100644 index 000000000..83a4353df --- /dev/null +++ b/ChartView/WPF/DataVirtualization/MainWindow.xaml.cs @@ -0,0 +1,20 @@ +using System.Windows; + +namespace DataVirtualization +{ + public partial class MainWindow : Window + { + ChartDataVirtualizationViewModel model; + + public MainWindow() + { + InitializeComponent(); + this.DataContext = this.model = new ChartDataVirtualizationViewModel(); + } + + private void LinearAxis_ActualVisibleRangeChanged(object sender, Telerik.Charting.NumericalRangeChangedEventArgs e) + { + this.model.UpdateVisibleData(e.NewRange.Minimum, e.NewRange.Maximum); + } + } +} diff --git a/ChartView/WPF/DataVirtualization/PlotInfo.cs b/ChartView/WPF/DataVirtualization/PlotInfo.cs new file mode 100644 index 000000000..fd685ad3e --- /dev/null +++ b/ChartView/WPF/DataVirtualization/PlotInfo.cs @@ -0,0 +1,8 @@ +namespace DataVirtualization +{ + public class PlotInfo + { + public double XValue { get; set; } + public double YValue { get; set; } + } +} diff --git a/ChartView/WPF/DataVirtualization/Properties/AssemblyInfo.cs b/ChartView/WPF/DataVirtualization/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..93a6b5619 --- /dev/null +++ b/ChartView/WPF/DataVirtualization/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("DataVirtualization")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DataVirtualization")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] diff --git a/ChartView/WPF/DataVirtualization/Properties/Resources.Designer.cs b/ChartView/WPF/DataVirtualization/Properties/Resources.Designer.cs new file mode 100644 index 000000000..2ae463bb8 --- /dev/null +++ b/ChartView/WPF/DataVirtualization/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DataVirtualization.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataVirtualization.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/ChartView/WPF/DataVirtualization/Properties/Resources.resx b/ChartView/WPF/DataVirtualization/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/ChartView/WPF/DataVirtualization/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ChartView/WPF/DataVirtualization/Properties/Settings.Designer.cs b/ChartView/WPF/DataVirtualization/Properties/Settings.Designer.cs new file mode 100644 index 000000000..87e12ada5 --- /dev/null +++ b/ChartView/WPF/DataVirtualization/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DataVirtualization.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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; + } + } + } +} diff --git a/ChartView/WPF/DataVirtualization/Properties/Settings.settings b/ChartView/WPF/DataVirtualization/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/ChartView/WPF/DataVirtualization/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ChartView/WPF/DataVirtualization/Readme.md b/ChartView/WPF/DataVirtualization/Readme.md new file mode 100644 index 000000000..eb8a311ca --- /dev/null +++ b/ChartView/WPF/DataVirtualization/Readme.md @@ -0,0 +1,5 @@ +## Data Virtualization ## + +This example shows how to implement a basic data virtualization. This way the chart will create DataPoint objects only for the items in the viewport, thus noticeably improving the memory footprint in large data scenarios. + + \ No newline at end of file diff --git a/ChartView/WPF/ErrorBars/Readme.md b/ChartView/WPF/ErrorBars/Readme.md index da6b8a52c..ac8996301 100644 --- a/ChartView/WPF/ErrorBars/Readme.md +++ b/ChartView/WPF/ErrorBars/Readme.md @@ -1,5 +1,5 @@ ## ErrorBars ## -This article shows how to achieve an error bars visualization using RangeBarSeries and custom PointTemplate. +This example shows how to achieve an error bars visualization using RangeBarSeries and custom PointTemplate. \ No newline at end of file diff --git a/Diagram/Diagrams_WPF.sln b/Diagram/Diagrams_WPF.sln index 56187249c..e40dfcff1 100644 --- a/Diagram/Diagrams_WPF.sln +++ b/Diagram/Diagrams_WPF.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2018 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlShape_WPF", "ControlShape\ControlShape_WPF.csproj", "{0A7B9791-6F96-4DFD-A0CF-2B8A6E5B21E9}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlidingConnector_WPF", "GlidingConnector\GlidingConnector_WPF.csproj", "{DA8BFA8F-B0EC-4B6A-9592-E06710FAA48F}" @@ -51,11 +53,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlyphToolBox", "GlyphToolBo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SortTreeLayoutShapes_WPF", "SortTreeLayoutShapes\SortTreeLayoutShapes_WPF.csproj", "{FF81B116-53D2-4BD5-B13A-9487D28E8FCD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportToHighQualityImage_WPF", "ExportToHighQualityImage\ExportToHighQualityImage_WPF.csproj", "{24937FA6-2071-4F09-9921-BD3022353A55}" +EndProject Global - - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = Diagrams_WPF_Work.vsmdi - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms @@ -315,8 +315,27 @@ Global {FF81B116-53D2-4BD5-B13A-9487D28E8FCD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {FF81B116-53D2-4BD5-B13A-9487D28E8FCD}.Release|Mixed Platforms.Build.0 = Release|Any CPU {FF81B116-53D2-4BD5-B13A-9487D28E8FCD}.Release|x86.ActiveCfg = Release|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Debug|x86.ActiveCfg = Debug|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Debug|x86.Build.0 = Debug|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Release|Any CPU.Build.0 = Release|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Release|x86.ActiveCfg = Release|Any CPU + {24937FA6-2071-4F09-9921-BD3022353A55}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BE28AEBD-B4FB-4BAA-B15C-76807A3CEAB1} + EndGlobalSection + + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = Diagrams_WPF_Work.vsmdi + EndGlobalSection EndGlobal diff --git a/Diagram/ExportToHighQualityImage/App.xaml b/Diagram/ExportToHighQualityImage/App.xaml new file mode 100644 index 000000000..d2a528384 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Diagram/ExportToHighQualityImage/App.xaml.cs b/Diagram/ExportToHighQualityImage/App.xaml.cs new file mode 100644 index 000000000..eccbbc3c9 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace ExportToHighQualityImage +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Diagram/ExportToHighQualityImage/CustomExportExtensions.cs b/Diagram/ExportToHighQualityImage/CustomExportExtensions.cs new file mode 100644 index 000000000..13c768bdd --- /dev/null +++ b/Diagram/ExportToHighQualityImage/CustomExportExtensions.cs @@ -0,0 +1,151 @@ +using System; +using System.IO; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Telerik.Windows.Controls; +using Telerik.Windows.Controls.Diagrams; +using Telerik.Windows.Diagrams.Core; + +namespace ExportToHighQualityImage +{ + public static class CustomExportExtensions + { + private const int ImageTileRows = 6; + private const int ImageTileColumns = 6; + + public static void ExportToImage(RadDiagram diagram, Stream stream, BitmapEncoder encoder = null, Rect? enclosingBounds = null, Size returnImageSize = new Size(), Brush backgroundBrush = null, Thickness margin = new Thickness(), double dpi = 96) + { + if (enclosingBounds == null) + { + enclosingBounds = diagram.CalculateEnclosingBounds(); + } + + if (encoder == null) + { + encoder = new PngBitmapEncoder(); + } + + var image = CreateDiagramImage(diagram, enclosingBounds.Value, returnImageSize, backgroundBrush, margin, dpi); + if (image != null) + { + encoder.Frames.Add(BitmapFrame.Create(image)); + encoder.Save(stream); + } + } + + private static BitmapSource CreateDiagramImage(RadDiagram diagram, Rect enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, double dpi) + { + var virtualizationService = diagram.ServiceLocator.GetService() as VirtualizationService; + virtualizationService.ForceRealization(); + diagram.UpdateLayout(); + + var itemsHost = diagram.FindChildByType(); + BitmapSource image = CreateWriteableBitmap(itemsHost, enclosingBounds, returnImageSize, backgroundBrush, margin, dpi); + + virtualizationService.Virtualize(); + diagram.UpdateLayout(); + + return image; + } + + private static BitmapSource CreateWriteableBitmap(UIElement element, Rect enclosingBounds, Size returnImageSize, Brush backgroundBrush, Thickness margin, double dpi = 96) + { + var expandedBounds = enclosingBounds.InflateRect(margin.Left, margin.Top, margin.Right, margin.Bottom); + + if (element == null || IsSizeValid(returnImageSize) == false || + enclosingBounds.IsValidBounds() == false || expandedBounds.IsValidBounds() == false) + { + return null; + } + + if (returnImageSize.Width <= 0 || returnImageSize.Height <= 0) + { + returnImageSize = expandedBounds.ToSize(); + } + + var scale = new ScaleTransform(); + if (expandedBounds.Width > 0 || expandedBounds.Height > 0) + { + scale.ScaleX = returnImageSize.Width / expandedBounds.Width; + scale.ScaleY = returnImageSize.Height / expandedBounds.Height; + } + + dpi = CoerceDpi(dpi); + double dpiScale = dpi / 96.0; + var scaledwidth = (int)(returnImageSize.Width * dpiScale); + var scaledHeight = (int)(returnImageSize.Height * dpiScale); + + var transformation = new TransformGroup(); + transformation.Children.Add(scale); + + var drawingVisual = new DrawingVisual(); + using (var drawingContext = drawingVisual.RenderOpen()) + { + drawingContext.PushTransform(transformation); + if (backgroundBrush != null) + { + drawingContext.DrawRectangle(backgroundBrush, null, new Rect(new Point(0, 0), expandedBounds.ToSize())); + } + + DrawTiles(element, expandedBounds, drawingContext); + + } + + var renderTarget = new RenderTargetBitmap(scaledwidth, scaledHeight, dpi, dpi, PixelFormats.Pbgra32); + renderTarget.Render(drawingVisual); + var bitmap = new WriteableBitmap(renderTarget); + + return bitmap; + } + + private static Random r = new Random(); + + private static void DrawTiles(UIElement renderSurface, Rect shapesBounds, DrawingContext drawingContext) + { + double tileWidth = Math.Ceiling(shapesBounds.Width / ImageTileColumns) + 1; + double tileHeight = Math.Ceiling(shapesBounds.Height / ImageTileRows) + 1; + + for (int rowIndex = 0; rowIndex < ImageTileRows; rowIndex++) + { + for (int colIndex = 0; colIndex < ImageTileColumns; colIndex++) + { + var x = Math.Floor(colIndex * tileWidth); + var y = Math.Floor(rowIndex * tileHeight); + var sourceX = Math.Floor(shapesBounds.Left) + x; + var sourceY = Math.Floor(shapesBounds.Top) + y; + + var sourceBrush = new VisualBrush(renderSurface) + { + Stretch = Stretch.None, + Viewbox = new Rect(sourceX, sourceY, tileWidth, tileHeight), + ViewboxUnits = BrushMappingMode.Absolute + }; + + Rect drawingContextPortionRect = new Rect(x, y, tileWidth, tileHeight); + + // The GuidelineSet is used in order to align the drawn tile to physical device pixels. + // Otherwise, you can observe blurred lines ot the tiles borders which leads to faded vertical and horizontal lines that goes accross the exported picture. + GuidelineSet guidelines = new GuidelineSet(); + guidelines.GuidelinesX.Add(drawingContextPortionRect.Left); + guidelines.GuidelinesX.Add(drawingContextPortionRect.Right); + guidelines.GuidelinesY.Add(drawingContextPortionRect.Top); + guidelines.GuidelinesY.Add(drawingContextPortionRect.Bottom); + drawingContext.PushGuidelineSet(guidelines); + + drawingContext.DrawRectangle(sourceBrush, null, drawingContextPortionRect); + } + } + } + + private static bool IsSizeValid(Size size) + { + return !(size.Width.IsNanOrInfinity() || size.Height.IsNanOrInfinity()); + } + + private static double CoerceDpi(double dpi) + { + return (dpi > 0 && !dpi.IsNanOrInfinity()) ? dpi : 96d; + } + } +} diff --git a/Diagram/ExportToHighQualityImage/ExportToHighQualityImage_WPF.csproj b/Diagram/ExportToHighQualityImage/ExportToHighQualityImage_WPF.csproj new file mode 100644 index 000000000..1da4751dd --- /dev/null +++ b/Diagram/ExportToHighQualityImage/ExportToHighQualityImage_WPF.csproj @@ -0,0 +1,114 @@ + + + + + Debug + AnyCPU + {24937FA6-2071-4F09-9921-BD3022353A55} + WinExe + ExportToHighQualityImage + ExportToHighQualityImage + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.Diagrams.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Diagrams.Core.dll + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + \ No newline at end of file diff --git a/Diagram/ExportToHighQualityImage/MainWindow.xaml b/Diagram/ExportToHighQualityImage/MainWindow.xaml new file mode 100644 index 000000000..60cabe032 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/MainWindow.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + diff --git a/Diagram/ExportToHighQualityImage/MainWindow.xaml.cs b/Diagram/ExportToHighQualityImage/MainWindow.xaml.cs new file mode 100644 index 000000000..84d62ae0b --- /dev/null +++ b/Diagram/ExportToHighQualityImage/MainWindow.xaml.cs @@ -0,0 +1,33 @@ +using Microsoft.Win32; +using System.IO; +using System.Windows; +using System.Windows.Media; +using Telerik.Windows.Controls; +using Telerik.Windows.Diagrams.Core; + +namespace ExportToHighQualityImage +{ + public partial class MainWindow : Window + { + public MainWindow() + { + StyleManager.ApplicationTheme = new Office2013Theme(); + DiagramConstants.MinimumZoom = 0.25; + + InitializeComponent(); + } + + private void Button_Click(object sender, RoutedEventArgs e) + { + SaveFileDialog dialog = new SaveFileDialog(); + dialog.Filter = "Image Files|*.jpg;*.png"; + if (dialog.ShowDialog() == true) + { + using (var stream = File.Create(dialog.FileName)) + { + CustomExportExtensions.ExportToImage(this.diagram, stream, backgroundBrush: Brushes.White, dpi: 500, margin: new Thickness(20)); + } + } + } + } +} diff --git a/Diagram/ExportToHighQualityImage/Properties/AssemblyInfo.cs b/Diagram/ExportToHighQualityImage/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..c25f7a1c4 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("ExportToHighQualityImage")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ExportToHighQualityImage")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] diff --git a/Diagram/ExportToHighQualityImage/Properties/Resources.Designer.cs b/Diagram/ExportToHighQualityImage/Properties/Resources.Designer.cs new file mode 100644 index 000000000..27152d79a --- /dev/null +++ b/Diagram/ExportToHighQualityImage/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ExportToHighQualityImage.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExportToHighQualityImage.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Diagram/ExportToHighQualityImage/Properties/Resources.resx b/Diagram/ExportToHighQualityImage/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Diagram/ExportToHighQualityImage/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Diagram/ExportToHighQualityImage/Properties/Settings.Designer.cs b/Diagram/ExportToHighQualityImage/Properties/Settings.Designer.cs new file mode 100644 index 000000000..191508798 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ExportToHighQualityImage.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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; + } + } + } +} diff --git a/Diagram/ExportToHighQualityImage/Properties/Settings.settings b/Diagram/ExportToHighQualityImage/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Diagram/ExportToHighQualityImage/readme.md b/Diagram/ExportToHighQualityImage/readme.md new file mode 100644 index 000000000..bcf6e9b64 --- /dev/null +++ b/Diagram/ExportToHighQualityImage/readme.md @@ -0,0 +1,5 @@ +## Export to High Quality Image ## + +This example shows how to implement custom export that allows you to export diagrams that are very large in size. + + \ No newline at end of file diff --git a/DragDrop/CustomArrowCue/App.xaml b/DragDrop/CustomArrowCue/App.xaml new file mode 100644 index 000000000..0ba5aede8 --- /dev/null +++ b/DragDrop/CustomArrowCue/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/DragDrop/CustomArrowCue/App.xaml.cs b/DragDrop/CustomArrowCue/App.xaml.cs new file mode 100644 index 000000000..af559355c --- /dev/null +++ b/DragDrop/CustomArrowCue/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace CustomArrowCue +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/DragDrop/CustomArrowCue/ArrowShape.cs b/DragDrop/CustomArrowCue/ArrowShape.cs new file mode 100644 index 000000000..3f089f096 --- /dev/null +++ b/DragDrop/CustomArrowCue/ArrowShape.cs @@ -0,0 +1,62 @@ +using System; +using System.Windows; +using System.Windows.Media; +using System.Windows.Shapes; + +namespace CustomArrowCue +{ + public sealed class ArrowShape : Shape + { + public double X1 { get; set; } + public double Y1 { get; set; } + public double X2 { get; set; } + public double Y2 { get; set; } + public double HeadWidth { get; set; } + public double HeadHeight { get; set; } + + private static Tuple GetArrowPoints(Point startPoint, Point endPoint, double arrowWidth, double arrowHeight) + { + arrowHeight = arrowHeight / 2; + double theta = Math.Atan2(startPoint.Y - endPoint.Y, startPoint.X - endPoint.X); + double sint = Math.Round(Math.Sin(theta), 2); + double cost = Math.Round(Math.Cos(theta), 2); + + Point leftPoint = new Point(endPoint.X + ((arrowWidth * cost) - (arrowHeight * sint)), endPoint.Y + ((arrowWidth * sint) + (arrowHeight * cost))); + Point rightPoint = new Point(endPoint.X + ((arrowWidth * cost) + (arrowHeight * sint)), endPoint.Y - ((arrowHeight * cost) - (arrowWidth * sint))); + + return new Tuple(leftPoint, rightPoint); + } + + public void UpdateGeometry() + { + this.InvalidateVisual(); + } + + protected override Geometry DefiningGeometry + { + get { return this.CreateArrowGeometry(); } + } + + private StreamGeometry CreateArrowGeometry() + { + StreamGeometry geometry = new StreamGeometry() { FillRule = FillRule.EvenOdd }; + using (StreamGeometryContext context = geometry.Open()) + { + Point startPoint = new Point(X1, this.Y1); + Point endPoint = new Point(X2, this.Y2); + + Tuple arrowPoints = GetArrowPoints(startPoint, endPoint, this.HeadWidth, this.HeadHeight); + Point leftPoint = arrowPoints.Item1; + Point rightPoint = arrowPoints.Item2; + + context.BeginFigure(startPoint, true, false); + context.LineTo(endPoint, true, true); + context.LineTo(leftPoint, true, true); + context.LineTo(endPoint, true, true); + context.LineTo(rightPoint, true, true); + } + geometry.Freeze(); + return geometry; + } + } +} diff --git a/DragDrop/CustomArrowCue/CustomArrowCue_WPF.csproj b/DragDrop/CustomArrowCue/CustomArrowCue_WPF.csproj new file mode 100644 index 000000000..7c012fb52 --- /dev/null +++ b/DragDrop/CustomArrowCue/CustomArrowCue_WPF.csproj @@ -0,0 +1,99 @@ + + + + + Debug + AnyCPU + {296A608D-6662-4A11-A731-0017CDC61892} + WinExe + CustomArrowCue + CustomArrowCue + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + \ No newline at end of file diff --git a/DragDrop/CustomArrowCue/DragDropManagerUtilities.cs b/DragDrop/CustomArrowCue/DragDropManagerUtilities.cs new file mode 100644 index 000000000..0c007110e --- /dev/null +++ b/DragDrop/CustomArrowCue/DragDropManagerUtilities.cs @@ -0,0 +1,123 @@ +using System.Windows; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.Windows.Media; +using Telerik.Windows.DragDrop; + +namespace CustomArrowCue +{ + public static class DragDropManagerUtilities + { + private const double dragStartThreshold = 5; + private static readonly Point EndPointOffset = new Point(3, 3); + private static bool allowDropCache; + private static Popup arrowContainer; + private static ArrowShape arrowVisual; + private static FrameworkElement rootVisual; + + static DragDropManagerUtilities() + { + rootVisual = App.Current.MainWindow; + + arrowVisual = new ArrowShape(); + arrowVisual.HeadHeight = 10; + arrowVisual.HeadWidth = 10; + arrowVisual.Stroke = Brushes.RoyalBlue; + arrowVisual.StrokeThickness = 3; + + arrowContainer = new Popup(); + arrowContainer.AllowsTransparency = true; + arrowContainer.AllowDrop = true; + arrowContainer.IsHitTestVisible = false; + arrowContainer.Placement = PlacementMode.Relative; + arrowContainer.PlacementTarget = rootVisual; + arrowContainer.Child = arrowVisual; + + DragDropManager.AddDragOverHandler(rootVisual, OnWindowDragOver, true); + } + + public static readonly DependencyProperty ShowArrowDragCueProperty = + DependencyProperty.RegisterAttached( + "ShowArrowDragCue", + typeof(bool), + typeof(DragDropManagerUtilities), + new PropertyMetadata(false, OnShowArrowDragCueChanged)); + + public static bool GetShowArrowDragCue(DependencyObject obj) + { + return (bool)obj.GetValue(ShowArrowDragCueProperty); + } + + public static void SetShowArrowDragCue(DependencyObject obj, bool value) + { + obj.SetValue(ShowArrowDragCueProperty, value); + } + + private static void OnShowArrowDragCueChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) + { + var element = (FrameworkElement)target; + if ((bool)args.NewValue) + { + DragDropManager.AddDragInitializeHandler(element, OnElementDragInitialize, true); + DragDropManager.AddDragDropCompletedHandler(element, OnElementDragDropCompleted, true); + element.Unloaded += OnElementUnloaded; + } + else + { + UnsubscribeFromEvents(element); + } + } + + private static void OnElementDragInitialize(object sender, DragInitializeEventArgs e) + { + arrowContainer.Width = rootVisual.ActualWidth; + arrowContainer.Height = rootVisual.ActualHeight; + var position = Mouse.GetPosition(rootVisual); + arrowVisual.X1 = arrowVisual.X2 = position.X; + arrowVisual.Y1 = arrowVisual.Y2 = position.Y; + + allowDropCache = rootVisual.AllowDrop; + rootVisual.AllowDrop = true; + } + + private static void OnElementDragDropCompleted(object sender, DragDropCompletedEventArgs e) + { + arrowContainer.IsOpen = false; + rootVisual.AllowDrop = allowDropCache; + } + + private static void OnWindowDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e) + { + if (e.AllowedEffects != DragDropEffects.None) + { + var position = e.GetPosition(rootVisual) - EndPointOffset; + arrowVisual.X2 = position.X; + arrowVisual.Y2 = position.Y; + arrowVisual.UpdateGeometry(); + + if (!arrowContainer.IsOpen && + GetDistance(arrowVisual.X1, arrowVisual.Y1, arrowVisual.X2, arrowVisual.Y2) >= dragStartThreshold) + { + arrowContainer.IsOpen = true; + } + } + } + + private static void UnsubscribeFromEvents(FrameworkElement element) + { + DragDropManager.RemoveDragInitializeHandler(element, OnElementDragInitialize); + DragDropManager.RemoveDragDropCompletedHandler(element, OnElementDragDropCompleted); + element.Unloaded -= OnElementUnloaded; + } + + private static void OnElementUnloaded(object sender, RoutedEventArgs e) + { + UnsubscribeFromEvents((FrameworkElement)sender); + } + + private static double GetDistance(double x1, double y1, double x2, double y2) + { + return Point.Subtract(new Point(x2, y2), new Point(x1, y1)).Length; + } + } +} diff --git a/DragDrop/CustomArrowCue/MainWindow.xaml b/DragDrop/CustomArrowCue/MainWindow.xaml new file mode 100644 index 000000000..ca1043bd5 --- /dev/null +++ b/DragDrop/CustomArrowCue/MainWindow.xaml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + diff --git a/DragDrop/CustomArrowCue/MainWindow.xaml.cs b/DragDrop/CustomArrowCue/MainWindow.xaml.cs new file mode 100644 index 000000000..6eee5fd90 --- /dev/null +++ b/DragDrop/CustomArrowCue/MainWindow.xaml.cs @@ -0,0 +1,27 @@ +using System.Windows; +using System.Windows.Controls; +using Telerik.Windows.DragDrop; + +namespace CustomArrowCue +{ + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + DragDropManager.AddDragInitializeHandler(this.border1, OnBorderDrop); + DragDropManager.AddDropHandler(this.border2, OnBorderDrop); + } + + private void OnBorderDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e) + { + MessageBox.Show("Dropped."); + } + + private void OnBorderDrop(object sender, DragInitializeEventArgs e) + { + e.AllowedEffects = DragDropEffects.All; + e.DragVisual = new TextBlock() { Text = "Dragging.." }; + } + } +} diff --git a/DragDrop/CustomArrowCue/Properties/AssemblyInfo.cs b/DragDrop/CustomArrowCue/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d613442fd --- /dev/null +++ b/DragDrop/CustomArrowCue/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("CustomArrowCue")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomArrowCue")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] diff --git a/DragDrop/CustomArrowCue/Properties/Resources.Designer.cs b/DragDrop/CustomArrowCue/Properties/Resources.Designer.cs new file mode 100644 index 000000000..7b64a6036 --- /dev/null +++ b/DragDrop/CustomArrowCue/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CustomArrowCue.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomArrowCue.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/DragDrop/CustomArrowCue/Properties/Resources.resx b/DragDrop/CustomArrowCue/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/DragDrop/CustomArrowCue/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DragDrop/CustomArrowCue/Properties/Settings.Designer.cs b/DragDrop/CustomArrowCue/Properties/Settings.Designer.cs new file mode 100644 index 000000000..5cc409715 --- /dev/null +++ b/DragDrop/CustomArrowCue/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CustomArrowCue.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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; + } + } + } +} diff --git a/DragDrop/CustomArrowCue/Properties/Settings.settings b/DragDrop/CustomArrowCue/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/DragDrop/CustomArrowCue/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DragDrop/CustomArrowCue/Readme.md b/DragDrop/CustomArrowCue/Readme.md new file mode 100644 index 000000000..8668484b8 --- /dev/null +++ b/DragDrop/CustomArrowCue/Readme.md @@ -0,0 +1,5 @@ +## Custom Arrow Cue ## + +This example demonstrates how to implement a custom drag (arrow) cue that connects the drag origin point with the current mouse position. + + \ No newline at end of file diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/App.xaml b/Map/WPF/AsyncSqlGeospatialDataReader/App.xaml new file mode 100644 index 000000000..d07d87544 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/App.xaml.cs b/Map/WPF/AsyncSqlGeospatialDataReader/App.xaml.cs new file mode 100644 index 000000000..9744ac9b2 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace AsyncSqlGeospatialDataReader +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/AsyncSqlGeospatialDataReader.csproj b/Map/WPF/AsyncSqlGeospatialDataReader/AsyncSqlGeospatialDataReader.csproj new file mode 100644 index 000000000..21bbfb742 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/AsyncSqlGeospatialDataReader.csproj @@ -0,0 +1,111 @@ + + + + + Debug + AnyCPU + {D3EF7F47-6E0B-4D38-914F-120A7F975715} + WinExe + AsyncSqlGeospatialDataReader + AsyncSqlGeospatialDataReader + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Controls.DataVisualization.dll + + + False + $(TELERIKWPFDIR)\Binaries\WPF40\Telerik.Windows.Data.dll + + + + + + + + MSBuild:Compile + Designer + + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + \ No newline at end of file diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml b/Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml new file mode 100644 index 000000000..23cfff3ee --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml.cs b/Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml.cs new file mode 100644 index 000000000..0670b1908 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/MainWindow.xaml.cs @@ -0,0 +1,13 @@ +using System.Windows; + +namespace AsyncSqlGeospatialDataReader +{ + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + this.asyncSqlGeospatialDataReader.Source = WktDataStorage.GetData(); + } + } +} diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/Properties/AssemblyInfo.cs b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..1fdd6fcf6 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("AsyncSqlGeospatialDataReader")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AsyncSqlGeospatialDataReader")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.Designer.cs b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.Designer.cs new file mode 100644 index 000000000..b257e3349 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AsyncSqlGeospatialDataReader.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AsyncSqlGeospatialDataReader.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.resx b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.Designer.cs b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.Designer.cs new file mode 100644 index 000000000..a7c058f35 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AsyncSqlGeospatialDataReader.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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; + } + } + } +} diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.settings b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/Readme.md b/Map/WPF/AsyncSqlGeospatialDataReader/Readme.md new file mode 100644 index 000000000..739aab8ee --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/Readme.md @@ -0,0 +1,5 @@ +## AsyncSqlGeospatialDataReader ## + +This example shows how to set up a model containing SQL Geospatial data in Wkt format and load it in the RadMap control, using AsyncSqlGeospatialDataReader which enables you to read SQL Geospatial data asynchronously. + + \ No newline at end of file diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/WktDataStorage.cs b/Map/WPF/AsyncSqlGeospatialDataReader/WktDataStorage.cs new file mode 100644 index 000000000..f7d5075d3 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/WktDataStorage.cs @@ -0,0 +1,273 @@ +using System.Collections.ObjectModel; + +namespace AsyncSqlGeospatialDataReader +{ + public static class WktDataStorage + { + public static ObservableCollection GetData() + { + ObservableCollection result = new ObservableCollection(); + + WktItemModel northAreaDataRow = new WktItemModel(); + northAreaDataRow.Name = "North Area"; + northAreaDataRow.Geometry = "Polygon ((" + + "-84.3932461670301, 33.7967217961125" + + ", -84.418995373573 33.808989109452" + + ", -84.4303250244518 33.8377961143588" + + ", -84.4303250244518 33.8480616114576" + + ", -84.4320416382213 33.8563301427474" + + ", -84.4413113525767 33.8668784860621" + + ", -84.4605374267954 33.8908212383562" + + ", -84.447147839393 33.8996555568394" + + ", -84.4169354370492 33.9161818236152" + + ", -84.384663098182 33.9127628588944" + + ", -84.3788266113656 33.9133326958734" + + ", -84.3633770874397 33.9101985453388" + + ", -84.3616604736702 33.9101985453388" + + ", -84.3300747803108 33.9204553366171" + + ", -84.2957425049201 33.9198855472676" + + ", -84.2596936157599 33.8919612018418" + + ", -84.2713665893927 33.8831260863279" + + ", -84.2768597534552 33.8745751033359" + + ", -84.2905926636114 33.8640277109635" + + ", -84.3039822510137 33.8480616114574" + + ", -84.3125653198613 33.8397922798236" + + ", -84.3489575317754 33.8249625088656" + + ", -84.3589138916386 33.8226807773054" + + ", -84.3688702515018 33.8124122318747" + + ", -84.3822598389041 33.8058511269131" + + ", -84.3932461670301 33.7967217961125" + + ", -84.3932461670301 33.7967217961125" + + "))"; + + result.Add(northAreaDataRow); + + WktItemModel store1DataRow = new WktItemModel(); + store1DataRow.Name = "Mr. Dorrell"; + store1DataRow.Geometry = "Point (-84.3827345898996 33.858244576749)"; + result.Add(store1DataRow); + + WktItemModel store2DataRow = new WktItemModel(); + store2DataRow.Name = "Family Store"; + store2DataRow.Geometry = "Point (-84.3842473557835 33.840489590028)"; + result.Add(store2DataRow); + + WktItemModel store3DataRow = new WktItemModel(); + store3DataRow.Name = "Greenings"; + store3DataRow.Geometry = "Point (-84.308161132657 33.8936528837044)"; + result.Add(store3DataRow); + + WktItemModel store4DataRow = new WktItemModel(); + store4DataRow.Name = "Ted's"; + store4DataRow.Geometry = "Point (-84.413727515064 33.906362188132)"; + result.Add(store4DataRow); + + WktItemModel eastAreaDataRow = new WktItemModel(); + eastAreaDataRow.Name = "East Area"; + eastAreaDataRow.Geometry = "Polygon ((" + + "-84.2596936157599 33.8919612018418" + + ", -84.2535138061902 33.8825560474539" + + ", -84.2480206421277 33.8437844708754" + + ", -84.2562603882215 33.8300961822591" + + ", -84.2493939331434 33.7913007952029" + + ", -84.2274212768934 33.7650468834483" + + ", -84.2301678589246 33.7422108552654" + + ", -84.2411541870496 33.7159419049292" + + ", -84.261753552284 33.7182264806728" + + ", -84.2892193725965 33.7102301996174" + + ", -84.3249249390027 33.7239376540615" + + ", -84.3249249390027 33.7399269179405" + + ", -84.3317913940808 33.7467785474731" + + ", -84.3523907593152 33.743352801123" + + ", -84.3743634155652 33.745636647227" + + ", -84.3935894897839 33.7462075992506" + + ", -84.3784832886121 33.7593384466376" + + ", -84.3908429077527 33.7661885251864" + + ", -84.3904995849988 33.7807431241315" + + ", -84.3908429077527 33.7901594881121" + + ", -84.3932461670301 33.7967217961125" + + ", -84.3822598389041 33.8058511269131" + + ", -84.3688702515018 33.8124122318747" + + ", -84.3589138916386 33.8226807773054" + + ", -84.3489575317754 33.8249625088656" + + ", -84.3125653198613 33.8397922798236" + + ", -84.3039822510137 33.8480616114574" + + ", -84.2905926636114 33.8640277109635" + + ", -84.2768597534552 33.8745751033359" + + ", -84.2713665893927 33.8831260863279" + + ", -84.2596936157599 33.8919612018418" + + "))"; + + result.Add(eastAreaDataRow); + + store1DataRow = new WktItemModel(); + store1DataRow.Name = "Fresh & Green"; + store1DataRow.Geometry = "Point (-84.3137723139137 33.815569818206)"; + result.Add(store1DataRow); + + store2DataRow = new WktItemModel(); + store2DataRow.Name = "Dominos"; + store2DataRow.Geometry = "Point (-84.3658608129834 33.7727478963652)"; + result.Add(store2DataRow); + + store3DataRow = new WktItemModel(); + store3DataRow.Name = "Ellinor"; + store3DataRow.Geometry = "Point (-84.2466419866888 33.7779395401149)"; + result.Add(store3DataRow); + + store4DataRow = new WktItemModel(); + store4DataRow.Name = "NearBy"; + store4DataRow.Geometry = "Point (-84.2415028742161 33.7766999578522)"; + result.Add(store4DataRow); + + WktItemModel store5DataRow = new WktItemModel(); + store5DataRow.Name = "Perfecto"; + store5DataRow.Geometry = "Point (-84.2783510616587 33.7223916381193)"; + result.Add(store5DataRow); + + WktItemModel southEastAreaDataRow = new WktItemModel(); + southEastAreaDataRow.Name = "South-East Area"; + southEastAreaDataRow.Geometry = "Polygon ((" + + "-84.2411541870496 33.7159419049292" + + ", -84.2562603882214 33.7028044147553" + + ", -84.2796063354871 33.6970918357038" + + ", -84.3043255737683 33.6868082362484" + + ", -84.3208050659558 33.6765234063122" + + ", -84.367496960487 33.6548069475491" + + ", -84.3839764526745 33.6342284039869" + + ", -84.3990826538464 33.6250808058726" + + ", -84.4869732788464 33.6182194698272" + + ", -84.4622540405652 33.6307981685331" + + ", -84.4526410034558 33.6422317554189" + + ", -84.4389080932996 33.6525206856264" + + ", -84.4196820190808 33.6673803024105" + + ", -84.4059491089245 33.6959492743123" + + ", -84.4059491089245 33.7085166139405" + + ", -84.3922161987683 33.7210821148631" + + ", -84.3935894897839 33.7462075992506" + + ", -84.3743634155652 33.745636647227" + + ", -84.3523907593152 33.743352801123" + + ", -84.3317913940808 33.7467785474731" + + ", -84.3249249390027 33.7399269179405" + + ", -84.3249249390027 33.7239376540615" + + ", -84.2892193725965 33.7102301996174" + + ", -84.261753552284 33.7182264806728" + + ", -84.2411541870496 33.7159419049292" + + "))"; + + result.Add(southEastAreaDataRow); + + store1DataRow = new WktItemModel(); + store1DataRow.Name = "LollyHolly"; + store1DataRow.Geometry = "Point (-84.3795239856981 33.7394093095038)"; + result.Add(store1DataRow); + + store2DataRow = new WktItemModel(); + store2DataRow.Name = "The Favourites"; + store2DataRow.Geometry = "Point (-84.3926614454527 33.7063308812285)"; + result.Add(store2DataRow); + + store3DataRow = new WktItemModel(); + store3DataRow.Name = "Quality Food"; + store3DataRow.Geometry = "Point (-84.2943745783107 33.6978423497645)"; + result.Add(store3DataRow); + + store4DataRow = new WktItemModel(); + store4DataRow.Name = "Marrie and Jack"; + store4DataRow.Geometry = "Point (-84.3917763164772 33.6519384707607)"; + result.Add(store4DataRow); + + WktItemModel southWestAreaDataRow = new WktItemModel(); + southWestAreaDataRow.Name = "South-West Area"; + southWestAreaDataRow.Geometry = "Polygon ((" + + "-84.4869732788464 33.6182194698272" + + ", -84.4979596069714 33.6456615354618" + + ", -84.4993328979871 33.6753805714828" + + ", -84.5034527710339 33.6868082362484" + + ", -84.4965863159558 33.7062317798524" + + ", -84.5034527710339 33.7233665538214" + + ", -84.4952130249402 33.7530587270419" + + ", -84.4938397339246 33.7667593403523" + + ", -84.4608807495496 33.7530587270419" + + ", -84.4292950561902 33.7462075992506" + + ", -84.4169354370495 33.7427818300946" + + ", -84.3935894897839 33.7462075992506" + + ", -84.3922161987683 33.7210821148631" + + ", -84.4059491089245 33.7085166139405" + + ", -84.4059491089245 33.6959492743123" + + ", -84.4196820190808 33.6673803024105" + + ", -84.4389080932996 33.6525206856264" + + ", -84.4526410034558 33.6422317554189" + + ", -84.4622540405652 33.6307981685331" + + ", -84.4869732788464 33.6182194698272" + + ", -84.4869732788464 33.6182194698272" + + "))"; + + result.Add(southWestAreaDataRow); + + store1DataRow = new WktItemModel(); + store1DataRow.Name = "ShopAtOnes"; + store1DataRow.Geometry = "Point (-84.4330930641421 33.7374893033587)"; + result.Add(store1DataRow); + + store2DataRow = new WktItemModel(); + store2DataRow.Name = "GoShopping!"; + store2DataRow.Geometry = "Point (-84.4366067579503 33.6845986928175)"; + result.Add(store2DataRow); + + store3DataRow = new WktItemModel(); + store3DataRow.Name = "Variety"; + store3DataRow.Geometry = "Point (-84.4933301141971 33.6885377258407)"; + result.Add(store3DataRow); + + WktItemModel northWestAreaDataRow = new WktItemModel(); + northWestAreaDataRow.Name = "North-West Area"; + northWestAreaDataRow.Geometry = "Polygon ((" + + "-84.4938397339246 33.7667593403523" + + ", -84.4965863159558 33.7861647934865" + + ", -84.4965863159558 33.805565850067" + + ", -84.4979596069714 33.821539888694" + + ", -84.4897198608777 33.8272441795402" + + ", -84.4897198608777 33.8454953528023" + + ", -84.4828534057996 33.8637426282186" + + ", -84.4759869507214 33.8728648039164" + + ", -84.4732403686902 33.8842661526508" + + ", -84.4622540405652 33.8899662557435" + + ", -84.4413113525767 33.8668784860621" + + ", -84.4320416382213 33.8563301427474" + + ", -84.4303250244518 33.8480616114576" + + ", -84.4303250244518 33.8377961143588" + + ", -84.418995373573 33.808989109452" + + ", -84.3932461670301 33.7967217961125" + + ", -84.3908429077527 33.7901594881121" + + ", -84.3904995849988 33.7807431241315" + + ", -84.3908429077527 33.7661885251864" + + ", -84.3784832886121 33.7593384466376" + + ", -84.3935894897839 33.7462075992506" + + ", -84.4169354370495 33.7427818300946" + + ", -84.4292950561902 33.7462075992506" + + ", -84.4608807495496 33.7530587270419" + + ", -84.4938397339246 33.7667593403523" + + "))"; + + result.Add(northWestAreaDataRow); + + store1DataRow = new WktItemModel(); + store1DataRow.Name = "The Hit"; + store1DataRow.Geometry = "Point (-84.3932595780585 33.7492138045389)"; + result.Add(store1DataRow); + + store2DataRow = new WktItemModel(); + store2DataRow.Name = "Mrs. Smith"; + store2DataRow.Geometry = "Point (-84.4314542344275 33.7952549107929)"; + result.Add(store2DataRow); + + store3DataRow = new WktItemModel(); + store3DataRow.Name = "Your Store"; + store3DataRow.Geometry = "Point (-84.4860425522968 33.8410824657857)"; + result.Add(store3DataRow); + + return result; + } + } +} diff --git a/Map/WPF/AsyncSqlGeospatialDataReader/WktItemModel.cs b/Map/WPF/AsyncSqlGeospatialDataReader/WktItemModel.cs new file mode 100644 index 000000000..1f6f18271 --- /dev/null +++ b/Map/WPF/AsyncSqlGeospatialDataReader/WktItemModel.cs @@ -0,0 +1,8 @@ +namespace AsyncSqlGeospatialDataReader +{ + public class WktItemModel + { + public string Name { get; set; } + public string Geometry { get; set; } + } +} diff --git a/Map/WPF/Map_WPF.sln b/Map/WPF/Map_WPF.sln index a4ff8906c..bb8141fe6 100644 --- a/Map/WPF/Map_WPF.sln +++ b/Map/WPF/Map_WPF.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2018 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProvidersBingMapProvider", "ProvidersBingMapProvider\ProvidersBingMapProvider.csproj", "{69BF076F-CEE0-4A7D-96BA-7D2AA43FD82E}" EndProject @@ -159,6 +159,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualizationLayerShapeSele EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI_Virtualization_And_Wraparound", "WrapAroundAndVirtualization\UI_Virtualization_And_Wraparound.csproj", "{286A10B1-A8F4-468C-944D-871D8E986E93}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncSqlGeospatialDataReader", "AsyncSqlGeospatialDataReader\AsyncSqlGeospatialDataReader.csproj", "{D3EF7F47-6E0B-4D38-914F-120A7F975715}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -477,9 +479,16 @@ Global {286A10B1-A8F4-468C-944D-871D8E986E93}.Debug|Any CPU.Build.0 = Debug|Any CPU {286A10B1-A8F4-468C-944D-871D8E986E93}.Release|Any CPU.ActiveCfg = Release|Any CPU {286A10B1-A8F4-468C-944D-871D8E986E93}.Release|Any CPU.Build.0 = Release|Any CPU + {D3EF7F47-6E0B-4D38-914F-120A7F975715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3EF7F47-6E0B-4D38-914F-120A7F975715}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3EF7F47-6E0B-4D38-914F-120A7F975715}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3EF7F47-6E0B-4D38-914F-120A7F975715}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7B01C217-4303-4A1D-BB13-023EC0A41457} + EndGlobalSection EndGlobal diff --git a/PdfViewer/CustomPrinting/Readme.md b/PdfViewer/CustomPrinting/Readme.md index ba0310263..a868c9438 100644 --- a/PdfViewer/CustomPrinting/Readme.md +++ b/PdfViewer/CustomPrinting/Readme.md @@ -1,2 +1,2 @@ -## Custom Printing ## -The example demonstrates how to print silently with given printer. When you specify a printer name, the printer with the provided name will print the provided document silently. If the printer with the chosen name is not found, the default printer is being used. +##Custom Printing## +The example demonstrates how to print silently with given printer. When you specify a printer name, the printer with the provided name will print the provided document silently. If the printer with the chosen name is not found, the default printer is being used. \ No newline at end of file