diff --git a/ChartView/SL/ChartView_SL.sln b/ChartView/SL/ChartView_SL.sln index 8e37635e..7b11d49a 100644 --- a/ChartView/SL/ChartView_SL.sln +++ b/ChartView/SL/ChartView_SL.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnnotationsAdding", "AnnotationsAdding\AnnotationsAdding.csproj", "{180BF7E5-F209-468F-8BAE-990B02E33D0A}" EndProject @@ -95,8 +95,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OriginValue", "OriginValue\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnnotationsProvider", "AnnotationsProvider\AnnotationsProvider.csproj", "{F8B8DC3C-293B-4F4C-922D-A0E39D0C78D9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DragChartAnnotation", "DragChartAnnotation\DragChartAnnotation.csproj", "{BA2EF516-2018-4873-9959-0F99CFFCB3C0}" +EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -286,8 +287,13 @@ Global {F8B8DC3C-293B-4F4C-922D-A0E39D0C78D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {F8B8DC3C-293B-4F4C-922D-A0E39D0C78D9}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8B8DC3C-293B-4F4C-922D-A0E39D0C78D9}.Release|Any CPU.Build.0 = Release|Any CPU + {BA2EF516-2018-4873-9959-0F99CFFCB3C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA2EF516-2018-4873-9959-0F99CFFCB3C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA2EF516-2018-4873-9959-0F99CFFCB3C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA2EF516-2018-4873-9959-0F99CFFCB3C0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + EndGlobal diff --git a/ChartView/SL/DragChartAnnotation/AnnotationUtilities.cs b/ChartView/SL/DragChartAnnotation/AnnotationUtilities.cs new file mode 100644 index 00000000..00ace640 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/AnnotationUtilities.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Input; +using Telerik.Charting; +using Telerik.Windows.Controls; +using Telerik.Windows.Controls.ChartView; + +namespace DragChartAnnotation +{ + public static class AnnotationUtilities + { + private static Dictionary annotationToIsDragging = new Dictionary(); + + public static readonly DependencyProperty IsDraggingEnabledProperty = + DependencyProperty.RegisterAttached( + "IsDraggingEnabled", + typeof(bool), + typeof(AnnotationUtilities), + new PropertyMetadata(false, OnIsDraggingEnabledChanged)); + + public static bool GetIsDraggingEnabled(DependencyObject obj) + { + return (bool)obj.GetValue(IsDraggingEnabledProperty); + } + + public static void SetIsDraggingEnabled(DependencyObject obj, bool value) + { + obj.SetValue(IsDraggingEnabledProperty, value); + } + + private static void OnIsDraggingEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ManageEventsRegistering((bool)e.NewValue, (CartesianChartAnnotation)d); + } + + private static void Annotation_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.Cursor = null; + } + + private static void Annotation_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.Cursor = Cursors.Hand; + } + + private static void Annotation_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.CaptureMouse(); + annotationToIsDragging.Add(annotation, true); + } + + private static void Annotation_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.ReleaseMouseCapture(); + annotationToIsDragging.Remove(annotation); + } + + private static void Annotation_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + if (annotationToIsDragging.ContainsKey(annotation)) + { + bool isDragging = annotationToIsDragging[annotation]; + if (isDragging) + { + var chart = (RadCartesianChart)annotation.Chart; + Point mousePosition = e.GetPosition(chart); + Point coercedPosition = GetCoercedPosition(mousePosition, chart.PlotAreaClip); + DataTuple dataTuple = chart.ConvertPointToData(coercedPosition); + + UpdateAnnotationPosition(annotation, dataTuple); + } + } + } + + private static void UpdateAnnotationPosition(CartesianChartAnnotation annotation, DataTuple dataTuple) + { + if (annotation is CartesianGridLineAnnotation) + { + UpdateGridLineAnnotation((CartesianGridLineAnnotation)annotation, dataTuple); + } + } + + private static void UpdateGridLineAnnotation(CartesianGridLineAnnotation annotation, DataTuple dataTuple) + { + if (annotation.Chart != null) + { + var chart = (RadCartesianChart)annotation.Chart; + if (annotation.Axis == chart.VerticalAxis) + { + annotation.Value = dataTuple.SecondValue; + } + else + { + annotation.Value = dataTuple.FirstValue; + } + } + } + + private static Point GetCoercedPosition(Point mousePosition, RadRect plotAreaClip) + { + var x = Math.Max(mousePosition.X, plotAreaClip.X); + x = Math.Min(x, plotAreaClip.Right); + var y = Math.Max(mousePosition.Y, plotAreaClip.Y); + y = Math.Min(y, plotAreaClip.Bottom); + + return new Point(x, y); + } + + private static void ManageEventsRegistering(bool isDraggingEnabled, CartesianChartAnnotation annotation) + { + UnregisterFromEvents(annotation); + if (isDraggingEnabled) + { + annotation.MouseEnter += Annotation_MouseEnter; + annotation.MouseLeftButtonDown += Annotation_MouseLeftButtonDown; + annotation.MouseMove += Annotation_MouseMove; + annotation.MouseLeftButtonUp += Annotation_MouseLeftButtonUp; + annotation.MouseLeave += Annotation_MouseLeave; + annotation.Unloaded += Annotation_Unloaded; + } + } + + private static void Annotation_Unloaded(object sender, RoutedEventArgs e) + { + UnregisterFromEvents((CartesianChartAnnotation)sender); + } + + private static void UnregisterFromEvents(CartesianChartAnnotation annotation) + { + annotation.MouseEnter -= Annotation_MouseEnter; + annotation.MouseLeftButtonDown -= Annotation_MouseLeftButtonDown; + annotation.MouseMove -= Annotation_MouseMove; + annotation.MouseLeftButtonUp -= Annotation_MouseLeftButtonUp; + annotation.MouseLeave -= Annotation_MouseLeave; + annotation.Unloaded -= Annotation_Unloaded; + } + } +} diff --git a/ChartView/SL/DragChartAnnotation/App.xaml b/ChartView/SL/DragChartAnnotation/App.xaml new file mode 100644 index 00000000..ed39b752 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/ChartView/SL/DragChartAnnotation/App.xaml.cs b/ChartView/SL/DragChartAnnotation/App.xaml.cs new file mode 100644 index 00000000..b38368a5 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/App.xaml.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace DragChartAnnotation +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff --git a/ChartView/SL/DragChartAnnotation/DragChartAnnotation.csproj b/ChartView/SL/DragChartAnnotation/DragChartAnnotation.csproj new file mode 100644 index 00000000..f50b2a01 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/DragChartAnnotation.csproj @@ -0,0 +1,127 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {BA2EF516-2018-4873-9959-0F99CFFCB3C0} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + DragChartAnnotation + DragChartAnnotation + Silverlight + v5.0 + $(TargetFrameworkVersion) + true + + + true + true + DragChartAnnotation.xap + Properties\AppManifest.xml + DragChartAnnotation.App + DragChartAnnotationTestPage.html + true + true + false + Properties\OutOfBrowserSettings.xml + false + true + + + + + + + + + + v3.5 + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + $(TargetFrameworkDirectory)System.Core.dll + + + + + + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.dll + + + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Controls.Chart.dll + + + $(TELERIKSLDIR)\Binaries\Silverlight\Telerik.Windows.Data.dll + + + + + + App.xaml + + + MainPage.xaml + + + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ChartView/SL/DragChartAnnotation/MainPage.xaml b/ChartView/SL/DragChartAnnotation/MainPage.xaml new file mode 100644 index 00000000..276f326d --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/MainPage.xaml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ChartView/SL/DragChartAnnotation/MainPage.xaml.cs b/ChartView/SL/DragChartAnnotation/MainPage.xaml.cs new file mode 100644 index 00000000..d87d30d7 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/MainPage.xaml.cs @@ -0,0 +1,13 @@ +using System.Windows.Controls; + +namespace DragChartAnnotation +{ + public partial class MainPage : UserControl + { + public MainPage() + { + InitializeComponent(); + this.DataContext = new MainViewModel(); + } + } +} diff --git a/ChartView/SL/DragChartAnnotation/MainViewModel.cs b/ChartView/SL/DragChartAnnotation/MainViewModel.cs new file mode 100644 index 00000000..7713318a --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/MainViewModel.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.ObjectModel; +using Telerik.Windows.Controls; + +namespace DragChartAnnotation +{ + public class MainViewModel : ViewModelBase + { + private static Random RandomNumberGenerator = new Random(); + private double lineAnnotationPosition; + + public ObservableCollection Items { get; set; } + + public double LineAnnotationPosition + { + get + { + return this.lineAnnotationPosition; + } + set + { + if (this.lineAnnotationPosition != value) + { + this.lineAnnotationPosition = value; + OnPropertyChanged("LineAnnotationPosition"); + } + } + } + + public MainViewModel() + { + this.Items = new ObservableCollection(); + for (int i = 0; i < 30; i++) + { + this.Items.Add(new PlotInfo() { Category = "C" + i, Value = RandomNumberGenerator.Next(100, 300) }); + } + + this.LineAnnotationPosition = this.Items[10].Value; + } + } +} diff --git a/ChartView/SL/DragChartAnnotation/PlotInfo.cs b/ChartView/SL/DragChartAnnotation/PlotInfo.cs new file mode 100644 index 00000000..18c54799 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/PlotInfo.cs @@ -0,0 +1,8 @@ +namespace DragChartAnnotation +{ + public class PlotInfo + { + public double Value { get; set; } + public string Category { get; set; } + } +} diff --git a/ChartView/SL/DragChartAnnotation/Properties/AppManifest.xml b/ChartView/SL/DragChartAnnotation/Properties/AppManifest.xml new file mode 100644 index 00000000..6712a117 --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/Properties/AppManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/ChartView/SL/DragChartAnnotation/Properties/AssemblyInfo.cs b/ChartView/SL/DragChartAnnotation/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..efd3842f --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DragChartAnnotation")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DragChartAnnotation")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ba2ef516-2018-4873-9959-0f99cffcb3c0")] + +// 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 Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ChartView/SL/DragChartAnnotation/Readme.md b/ChartView/SL/DragChartAnnotation/Readme.md new file mode 100644 index 00000000..72c0962c --- /dev/null +++ b/ChartView/SL/DragChartAnnotation/Readme.md @@ -0,0 +1,5 @@ +## Drag Chart Annotation ## + +This example shows how to implement interaction behavior for chart annotation which allows you to drag it. The implementation uses attached behavior and mouse events to enable dragging. You can use the AnnotationUtilities class to add or modify the dragging logic. + + \ No newline at end of file diff --git a/ChartView/WPF/ChartView_WPF.sln b/ChartView/WPF/ChartView_WPF.sln index 5c3bd5ec..b045410a 100644 --- a/ChartView/WPF/ChartView_WPF.sln +++ b/ChartView/WPF/ChartView_WPF.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Introduction", "Introduction\Introduction.csproj", "{EEFB5CE9-E938-45F2-807C-608CB55CE55A}" EndProject @@ -99,8 +99,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnnotationsProvider", "Anno EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2.5D_Chart", "2.5D_Chart\2.5D_Chart.csproj", "{7C2B967B-01EA-4E8E-9D7E-58A3240B5CDA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DragChartAnnotation", "DragChartAnnotation\DragChartAnnotation.csproj", "{85A52E85-EF57-4643-A398-ECF320479DA7}" +EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug.NoXaml|Any CPU = Debug.NoXaml|Any CPU Debug.NoXaml|Mixed Platforms = Debug.NoXaml|Mixed Platforms @@ -3319,8 +3320,123 @@ Global {7C2B967B-01EA-4E8E-9D7E-58A3240B5CDA}.ReleaseTrial451|Any CPU.ActiveCfg = Release|Any CPU {7C2B967B-01EA-4E8E-9D7E-58A3240B5CDA}.ReleaseTrial451|Mixed Platforms.ActiveCfg = Release|Any CPU {7C2B967B-01EA-4E8E-9D7E-58A3240B5CDA}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug.NoXaml|Any CPU.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug.NoXaml|x86.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug.NoXaml|x86.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug|x86.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug|x86.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45.NoXaml|Any CPU.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45.NoXaml|x86.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45.NoXaml|x86.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45|Any CPU.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45|Any CPU.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45|Mixed Platforms.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45|x86.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug45|x86.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451.NoXaml|Any CPU.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451.NoXaml|Any CPU.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451.NoXaml|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451.NoXaml|Mixed Platforms.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451.NoXaml|x86.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451.NoXaml|x86.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451|Any CPU.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451|Any CPU.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451|Mixed Platforms.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451|x86.ActiveCfg = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Debug451|x86.Build.0 = Debug|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release.NoXaml|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release.NoXaml|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release.NoXaml|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45.NoXaml|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45.NoXaml|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45.NoXaml|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release45|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451.NoXaml|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451.NoXaml|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451.NoXaml|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.Release451|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseNoCA|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseNoCA|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseNoCA|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseNoCA|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseNoCA|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseNoCA|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial.NoXaml|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial.NoXaml|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial.NoXaml|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45.NoXaml|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45.NoXaml|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45.NoXaml|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial45|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451.NoXaml|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451.NoXaml|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451.NoXaml|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451.NoXaml|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451.NoXaml|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451.NoXaml|x86.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451|Any CPU.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451|Any CPU.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451|Mixed Platforms.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451|Mixed Platforms.Build.0 = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451|x86.ActiveCfg = Release|Any CPU + {85A52E85-EF57-4643-A398-ECF320479DA7}.ReleaseTrial451|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + EndGlobal diff --git a/ChartView/WPF/DragChartAnnotation/AnnotationUtilities.cs b/ChartView/WPF/DragChartAnnotation/AnnotationUtilities.cs new file mode 100644 index 00000000..296ed42d --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/AnnotationUtilities.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Input; +using Telerik.Charting; +using Telerik.Windows.Controls; +using Telerik.Windows.Controls.ChartView; + +namespace DragChartAnnotation +{ + public static class AnnotationUtilities + { + private static Dictionary annotationToIsDragging = new Dictionary(); + + public static readonly DependencyProperty IsDraggingEnabledProperty = + DependencyProperty.RegisterAttached( + "IsDraggingEnabled", + typeof(bool), + typeof(AnnotationUtilities), + new PropertyMetadata(false, OnIsDraggingEnabledChanged)); + + public static bool GetIsDraggingEnabled(DependencyObject obj) + { + return (bool)obj.GetValue(IsDraggingEnabledProperty); + } + + public static void SetIsDraggingEnabled(DependencyObject obj, bool value) + { + obj.SetValue(IsDraggingEnabledProperty, value); + } + + private static void OnIsDraggingEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ManageEventsRegistering((bool)e.NewValue, (CartesianChartAnnotation)d); + } + + private static void Annotation_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.Cursor = null; + } + + private static void Annotation_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.Cursor = Cursors.Hand; + } + + private static void Annotation_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.CaptureMouse(); + annotationToIsDragging.Add(annotation, true); + } + + private static void Annotation_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + annotation.ReleaseMouseCapture(); + annotationToIsDragging.Remove(annotation); + } + + private static void Annotation_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) + { + var annotation = (CartesianChartAnnotation)sender; + if (annotationToIsDragging.ContainsKey(annotation)) + { + bool isDragging = annotationToIsDragging[annotation]; + if (isDragging) + { + var chart = (RadCartesianChart)annotation.Chart; + Point mousePosition = e.GetPosition(chart); + Point coercedPosition = GetCoercedPosition(mousePosition, chart.PlotAreaClip); + DataTuple dataTuple = chart.ConvertPointToData(coercedPosition); + + UpdateAnnotationPosition(annotation, dataTuple); + } + } + } + + private static void UpdateAnnotationPosition(CartesianChartAnnotation annotation, DataTuple dataTuple) + { + if (annotation is CartesianGridLineAnnotation) + { + UpdateGridLineAnnotation((CartesianGridLineAnnotation)annotation, dataTuple); + } + } + + private static void UpdateGridLineAnnotation(CartesianGridLineAnnotation annotation, DataTuple dataTuple) + { + if (annotation.Chart != null) + { + var chart = (RadCartesianChart)annotation.Chart; + if (annotation.Axis == chart.VerticalAxis) + { + annotation.Value = dataTuple.SecondValue; + } + else + { + annotation.Value = dataTuple.FirstValue; + } + } + } + + private static Point GetCoercedPosition(Point mousePosition, RadRect plotAreaClip) + { + var x = Math.Max(mousePosition.X, plotAreaClip.X); + x = Math.Min(x, plotAreaClip.Right); + var y = Math.Max(mousePosition.Y, plotAreaClip.Y); + y = Math.Min(y, plotAreaClip.Bottom); + + return new Point(x, y); + } + + private static void ManageEventsRegistering(bool isDraggingEnabled, CartesianChartAnnotation annotation) + { + UnregisterFromEvents(annotation); + if (isDraggingEnabled) + { + annotation.MouseEnter += Annotation_MouseEnter; + annotation.MouseLeftButtonDown += Annotation_MouseLeftButtonDown; + annotation.MouseMove += Annotation_MouseMove; + annotation.MouseLeftButtonUp += Annotation_MouseLeftButtonUp; + annotation.MouseLeave += Annotation_MouseLeave; + annotation.Unloaded += Annotation_Unloaded; + } + } + + private static void Annotation_Unloaded(object sender, RoutedEventArgs e) + { + UnregisterFromEvents((CartesianChartAnnotation)sender); + } + + private static void UnregisterFromEvents(CartesianChartAnnotation annotation) + { + annotation.MouseEnter -= Annotation_MouseEnter; + annotation.MouseLeftButtonDown -= Annotation_MouseLeftButtonDown; + annotation.MouseMove -= Annotation_MouseMove; + annotation.MouseLeftButtonUp -= Annotation_MouseLeftButtonUp; + annotation.MouseLeave -= Annotation_MouseLeave; + annotation.Unloaded -= Annotation_Unloaded; + } + } +} diff --git a/ChartView/WPF/DragChartAnnotation/App.config b/ChartView/WPF/DragChartAnnotation/App.config new file mode 100644 index 00000000..74ade9db --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/ChartView/WPF/DragChartAnnotation/App.xaml b/ChartView/WPF/DragChartAnnotation/App.xaml new file mode 100644 index 00000000..9b844af7 --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/ChartView/WPF/DragChartAnnotation/App.xaml.cs b/ChartView/WPF/DragChartAnnotation/App.xaml.cs new file mode 100644 index 00000000..3a607e53 --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace DragChartAnnotation +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/ChartView/WPF/DragChartAnnotation/DragChartAnnotation.csproj b/ChartView/WPF/DragChartAnnotation/DragChartAnnotation.csproj new file mode 100644 index 00000000..baf1995a --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/DragChartAnnotation.csproj @@ -0,0 +1,127 @@ + + + + + Debug + AnyCPU + {85A52E85-EF57-4643-A398-ECF320479DA7} + WinExe + Properties + DragChartAnnotation + DragChartAnnotation + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + + + + + 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.Chart.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/DragChartAnnotation/MainViewModel.cs b/ChartView/WPF/DragChartAnnotation/MainViewModel.cs new file mode 100644 index 00000000..145af73d --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/MainViewModel.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.ObjectModel; +using Telerik.Windows.Controls; + +namespace DragChartAnnotation +{ + public class MainViewModel : ViewModelBase + { + private static Random RandomNumberGenerator = new Random(); + private double lineAnnotationPosition; + + public ObservableCollection Items { get; set; } + + public double LineAnnotationPosition + { + get + { + return this.lineAnnotationPosition; + } + set + { + if (this.lineAnnotationPosition != value) + { + this.lineAnnotationPosition = value; + OnPropertyChanged("LineAnnotationPosition"); + } + } + } + + public MainViewModel() + { + this.Items = new ObservableCollection(); + for (int i = 0; i < 30; i++) + { + this.Items.Add(new PlotInfo() { Category = "C" + i, Value = RandomNumberGenerator.Next(100, 300) }); + } + + this.LineAnnotationPosition = this.Items[10].Value; + } + } +} diff --git a/ChartView/WPF/DragChartAnnotation/MainWindow.xaml b/ChartView/WPF/DragChartAnnotation/MainWindow.xaml new file mode 100644 index 00000000..4a5141f5 --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/MainWindow.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/ChartView/WPF/DragChartAnnotation/MainWindow.xaml.cs b/ChartView/WPF/DragChartAnnotation/MainWindow.xaml.cs new file mode 100644 index 00000000..29efc6db --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/MainWindow.xaml.cs @@ -0,0 +1,13 @@ +using System.Windows; + +namespace DragChartAnnotation +{ + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + this.DataContext = new MainViewModel(); + } + } +} diff --git a/ChartView/WPF/DragChartAnnotation/PlotInfo.cs b/ChartView/WPF/DragChartAnnotation/PlotInfo.cs new file mode 100644 index 00000000..969d6599 --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/PlotInfo.cs @@ -0,0 +1,8 @@ +namespace DragChartAnnotation +{ + public class PlotInfo + { + public double Value { get; set; } + public string Category { get; set; } + } +} diff --git a/ChartView/WPF/DragChartAnnotation/Properties/AssemblyInfo.cs b/ChartView/WPF/DragChartAnnotation/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..fa90ec67 --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/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("DragChartAnnotation")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DragChartAnnotation")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[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/DragChartAnnotation/Properties/Resources.Designer.cs b/ChartView/WPF/DragChartAnnotation/Properties/Resources.Designer.cs new file mode 100644 index 00000000..6f79da1a --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 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 DragChartAnnotation.Properties { + using System; + + + /// + /// 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 (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DragChartAnnotation.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/DragChartAnnotation/Properties/Resources.resx b/ChartView/WPF/DragChartAnnotation/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/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/DragChartAnnotation/Properties/Settings.Designer.cs b/ChartView/WPF/DragChartAnnotation/Properties/Settings.Designer.cs new file mode 100644 index 00000000..e7512605 --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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 DragChartAnnotation.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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/DragChartAnnotation/Properties/Settings.settings b/ChartView/WPF/DragChartAnnotation/Properties/Settings.settings new file mode 100644 index 00000000..033d7a5e --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ChartView/WPF/DragChartAnnotation/Readme.md b/ChartView/WPF/DragChartAnnotation/Readme.md new file mode 100644 index 00000000..72c0962c --- /dev/null +++ b/ChartView/WPF/DragChartAnnotation/Readme.md @@ -0,0 +1,5 @@ +## Drag Chart Annotation ## + +This example shows how to implement interaction behavior for chart annotation which allows you to drag it. The implementation uses attached behavior and mouse events to enable dragging. You can use the AnnotationUtilities class to add or modify the dragging logic. + + \ No newline at end of file diff --git a/ChartView3D/WPF/ChartView3D_WPF.sln b/ChartView3D/WPF/ChartView3D_WPF.sln index 270ce4b5..3e8d4bc1 100644 --- a/ChartView3D/WPF/ChartView3D_WPF.sln +++ b/ChartView3D/WPF/ChartView3D_WPF.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultVisualMaterialSelector", "DefaultVisualMaterialSelector\DefaultVisualMaterialSelector.csproj", "{EF6ECB56-6E40-47A1-A3BB-C61D03679F46}" EndProject @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ValueGradientColorizer", "V EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataPointColorizer", "DataPointColorizer\DataPointColorizer.csproj", "{7B1CC216-4821-417A-87D7-B08EB577F2EA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SurfaceProjection", "SurfaceProjection\SurfaceProjection.csproj", "{C3ED42D2-AB90-41F4-8876-1FFA7039A51A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,6 +53,10 @@ Global {7B1CC216-4821-417A-87D7-B08EB577F2EA}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B1CC216-4821-417A-87D7-B08EB577F2EA}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B1CC216-4821-417A-87D7-B08EB577F2EA}.Release|Any CPU.Build.0 = Release|Any CPU + {C3ED42D2-AB90-41F4-8876-1FFA7039A51A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3ED42D2-AB90-41F4-8876-1FFA7039A51A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3ED42D2-AB90-41F4-8876-1FFA7039A51A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3ED42D2-AB90-41F4-8876-1FFA7039A51A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ChartView3D/WPF/SurfaceProjection/App.config b/ChartView3D/WPF/SurfaceProjection/App.config new file mode 100644 index 00000000..74ade9db --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/ChartView3D/WPF/SurfaceProjection/App.xaml b/ChartView3D/WPF/SurfaceProjection/App.xaml new file mode 100644 index 00000000..3775c91b --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/ChartView3D/WPF/SurfaceProjection/App.xaml.cs b/ChartView3D/WPF/SurfaceProjection/App.xaml.cs new file mode 100644 index 00000000..fc609949 --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/App.xaml.cs @@ -0,0 +1,8 @@ +using System.Windows; + +namespace SurfaceProjection +{ + public partial class App : Application + { + } +} diff --git a/ChartView3D/WPF/SurfaceProjection/FeedingColorizer.cs b/ChartView3D/WPF/SurfaceProjection/FeedingColorizer.cs new file mode 100644 index 00000000..ea3b783d --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/FeedingColorizer.cs @@ -0,0 +1,43 @@ +using System; +using System.Windows.Media; +using System.Windows.Media.Media3D; +using Telerik.Windows.Controls.ChartView; + +namespace SurfaceProjection +{ + public class FeedingColorizer : SurfaceSeries3DValueGradientColorizer + { + public PointCollection TextureCoordinates { get; set; } + public Material Material { get; set; } + + public event EventHandler OnColorizingCompleted; + + public void RaiseColorizingCompleted() + { + if (OnColorizingCompleted != null) + { + OnColorizingCompleted(this, null); + } + } + + protected override void OnColorizationFinished() + { + RaiseColorizingCompleted(); + + base.OnColorizationFinished(); + } + + public override Material GetMaterial(SurfaceSeries3DColorizerContext context) + { + var material = base.GetMaterial(context); + this.Material = material; + AssignTextureCoordinates(context); + return material; + } + + private void AssignTextureCoordinates(SurfaceSeries3DColorizerContext context) + { + this.TextureCoordinates = context.TextureCoordinates; + } + } +} diff --git a/ChartView3D/WPF/SurfaceProjection/MainWindow.xaml b/ChartView3D/WPF/SurfaceProjection/MainWindow.xaml new file mode 100644 index 00000000..b5feab02 --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/MainWindow.xaml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ChartView3D/WPF/SurfaceProjection/MainWindow.xaml.cs b/ChartView3D/WPF/SurfaceProjection/MainWindow.xaml.cs new file mode 100644 index 00000000..166e9b1d --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/MainWindow.xaml.cs @@ -0,0 +1,25 @@ +using System; +using System.Windows; + +namespace SurfaceProjection +{ + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + + this.DataContext = new ViewModel(); + + this.colorizer.OnColorizingCompleted += ColorizerOnColorizingCompleted; + } + + private void ColorizerOnColorizingCompleted(object sender, EventArgs e) + { + ProjectionColorizer customColorizer = new ProjectionColorizer(); + customColorizer.CustomMaterial = this.colorizer.Material; + customColorizer.TextureCoordinates = this.colorizer.TextureCoordinates; + this.constlevelseries.Colorizer = customColorizer; + } + } +} diff --git a/ChartView3D/WPF/SurfaceProjection/PlotInfo.cs b/ChartView3D/WPF/SurfaceProjection/PlotInfo.cs new file mode 100644 index 00000000..d51f0d3e --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/PlotInfo.cs @@ -0,0 +1,10 @@ +namespace SurfaceProjection +{ + public class PlotInfo + { + public string XValue { get; set; } + public string YValue { get; set; } + public double ZValue { get; set; } + public double ConstValue { get; set; } + } +} diff --git a/ChartView3D/WPF/SurfaceProjection/ProjectionColorizer.cs b/ChartView3D/WPF/SurfaceProjection/ProjectionColorizer.cs new file mode 100644 index 00000000..3972cc15 --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/ProjectionColorizer.cs @@ -0,0 +1,22 @@ +using System.Windows.Media; +using System.Windows.Media.Media3D; +using Telerik.Windows.Controls.ChartView; + +namespace SurfaceProjection +{ + public class ProjectionColorizer : SurfaceSeries3DDataPointColorizer + { + public Material CustomMaterial { get; set; } + public PointCollection TextureCoordinates { get; set; } + + public override Material GetMaterial(SurfaceSeries3DColorizerContext context) + { + return this.CustomMaterial; + } + + public override PointCollection GetTextureCoordinates(SurfaceSeries3DColorizerContext context) + { + return this.TextureCoordinates; + } + } +} diff --git a/ChartView3D/WPF/SurfaceProjection/Properties/AssemblyInfo.cs b/ChartView3D/WPF/SurfaceProjection/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..83499a5f --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/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("SurfaceProjection")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SurfaceProjection")] +[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/ChartView3D/WPF/SurfaceProjection/Properties/Resources.Designer.cs b/ChartView3D/WPF/SurfaceProjection/Properties/Resources.Designer.cs new file mode 100644 index 00000000..0f9d957d --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 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 SurfaceProjection.Properties { + using System; + + + /// + /// 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 (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SurfaceProjection.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/ChartView3D/WPF/SurfaceProjection/Properties/Resources.resx b/ChartView3D/WPF/SurfaceProjection/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/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/ChartView3D/WPF/SurfaceProjection/Properties/Settings.Designer.cs b/ChartView3D/WPF/SurfaceProjection/Properties/Settings.Designer.cs new file mode 100644 index 00000000..73fb73c4 --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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 SurfaceProjection.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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/ChartView3D/WPF/SurfaceProjection/Properties/Settings.settings b/ChartView3D/WPF/SurfaceProjection/Properties/Settings.settings new file mode 100644 index 00000000..033d7a5e --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ChartView3D/WPF/SurfaceProjection/SurfaceProjection.csproj b/ChartView3D/WPF/SurfaceProjection/SurfaceProjection.csproj new file mode 100644 index 00000000..480bf80d --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/SurfaceProjection.csproj @@ -0,0 +1,128 @@ + + + + + Debug + AnyCPU + {C3ED42D2-AB90-41F4-8876-1FFA7039A51A} + WinExe + Properties + SurfaceProjection + SurfaceProjection + v4.0 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + + + + + 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.Chart.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/ChartView3D/WPF/SurfaceProjection/ViewModel.cs b/ChartView3D/WPF/SurfaceProjection/ViewModel.cs new file mode 100644 index 00000000..05364471 --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/ViewModel.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.ObjectModel; +using Telerik.Windows.Controls; + +namespace SurfaceProjection +{ + public class ViewModel : ViewModelBase + { + private ObservableCollection points; + + public ObservableCollection Points + { + get + { + if(this.points == null) + { + this.points = this.GenerateDataViaFunction(); + } + + return points; + } + } + + private ObservableCollection GenerateDataViaFunction() + { + // This function is used to generate the data for the surface + // f(x,y) = z = sin(x * 2 * pi / maxX) * cos(y * 2 * pi / maxY) * 200 + // where x e [0; maxX] + // and y e [0; maxY] + + ObservableCollection data = new ObservableCollection(); + double maxX = 30; + double maxY = 30; + + for (int x = 0; x < maxX; x++) + { + for (int y = 0; y < maxY; y++) + { + double xValue = Math.Sin(x * Math.PI / (0.50 * maxX)); + double yValue = Math.Cos(y * Math.PI / (0.50 * maxY)); + double z = 200 * xValue * yValue; + PlotInfo pi = new PlotInfo + { + XValue = x.ToString(), + YValue = y.ToString(), + ZValue = z, + ConstValue = 500 + }; + data.Add(pi); + } + } + + return data; + } + } +} diff --git a/ChartView3D/WPF/SurfaceProjection/readme.md b/ChartView3D/WPF/SurfaceProjection/readme.md new file mode 100644 index 00000000..c0d8c0dc --- /dev/null +++ b/ChartView3D/WPF/SurfaceProjection/readme.md @@ -0,0 +1,5 @@ +## SurfaceProjection ## + +This example demonstrates how to project one surface onto another. + + \ No newline at end of file diff --git a/MSControls/ThemingExample/Images/bgFluent.png b/MSControls/ThemingExample/Images/bgFluent.png new file mode 100644 index 00000000..f079cfe2 Binary files /dev/null and b/MSControls/ThemingExample/Images/bgFluent.png differ diff --git a/MSControls/ThemingExample/Images/bgFluentDark.png b/MSControls/ThemingExample/Images/bgFluentDark.png new file mode 100644 index 00000000..46177f01 Binary files /dev/null and b/MSControls/ThemingExample/Images/bgFluentDark.png differ diff --git a/MSControls/ThemingExample/MainWindow.xaml b/MSControls/ThemingExample/MainWindow.xaml index 37424e11..c3954ad3 100644 --- a/MSControls/ThemingExample/MainWindow.xaml +++ b/MSControls/ThemingExample/MainWindow.xaml @@ -25,11 +25,13 @@ - + + + - - + + @@ -119,9 +121,9 @@ - +