├── Keynotes ├── WPF-CUSTOM-CONTROL-DEVELOPMENT-UNCHAINED.pdf ├── WPF-UI-DEVELOPMENT-BEST-PRACTICES.pdf └── WPF-UI-DEVELOPMENT-UNCHAINED-v3-Out.pdf ├── README.md └── Solutions ├── CustomControlShowcase └── 0-1 │ ├── CCDevShowcase.sln │ ├── CCDevShowcase.v11.suo │ ├── CCDevShowcase │ ├── App.xaml │ ├── App.xaml.cs │ ├── CCDevShowcase.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── View │ │ ├── MainView.xaml │ │ └── MainView.xaml.cs │ ├── ViewModel │ │ ├── Samples │ │ │ ├── PointViewModel.cs │ │ │ └── SampleViewModel.cs │ │ └── ViewModelLocator.cs │ └── app.config │ ├── CCDevStyling │ ├── AttachedProperties │ │ └── AttachedProperties.cs │ ├── BitmapGraphics │ │ ├── Assets.xaml │ │ ├── Assets │ │ │ └── andrelanninger.png │ │ ├── Icons.xaml │ │ └── Icons │ │ │ ├── XWhiteIcon.png │ │ │ ├── comboWhite.png │ │ │ └── maestroWhite.png │ ├── CCDevStyling.csproj │ ├── Colors │ │ ├── Brushes.xaml │ │ └── Colors.xaml │ ├── Converters │ │ └── Converter.xaml │ ├── DataTemplates │ │ └── DataTemplates.xaml │ ├── LookAndFeel.xaml │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Settings │ │ ├── Settings.xaml │ │ └── Typography.xaml │ ├── Styles │ │ ├── Button.xaml │ │ ├── ContentControl.xaml │ │ ├── CustomControls │ │ │ ├── PointChart.xaml │ │ │ └── SearchTextBox.xaml │ │ ├── FrameworkElement.xaml │ │ ├── ListBox.xaml │ │ ├── TextBlock.xaml │ │ ├── TextBox.xaml │ │ └── ToggleButton.xaml │ └── VectorGraphics │ │ ├── Icons.xaml │ │ └── Shapes.xaml │ ├── CCLibrary │ ├── CCLibrary.csproj │ ├── Controls │ │ ├── HighlightableTextBlock │ │ │ ├── HighlightableTextBlock.cs │ │ │ └── HighlightableTextBlock.xaml │ │ ├── PointChart │ │ │ ├── Overview.cd │ │ │ ├── PointChart.cs │ │ │ ├── PointChart.xaml │ │ │ └── PointChartItem.cs │ │ └── SearchTextBox │ │ │ ├── SearchTextBox.cs │ │ │ └── SearchTextBox.xaml │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ └── Themes │ │ └── Generic.xaml │ └── CommonLibrary │ ├── CommonLibrary.csproj │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── Util │ ├── DelegateCommand.cs │ ├── MathHelpers.cs │ ├── ViewModelBase.cs │ └── WPFHelpers.cs └── UnchainedShowcase └── 0-1 ├── CCDevShowcase.sln ├── CCDevShowcase ├── App.xaml ├── App.xaml.cs ├── CCDevShowcase.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── View │ ├── MainView.xaml │ ├── MainView.xaml.cs │ ├── SimpleCCSampleView.xaml │ ├── SimpleCCSampleView.xaml.cs │ ├── Test1View.xaml │ ├── Test1View.xaml.cs │ ├── TestView.xaml │ └── TestView.xaml.cs ├── ViewModel │ ├── MainWindow │ │ ├── MainWindowViewModel.cs │ │ └── ViewViewModel.cs │ ├── Samples │ │ ├── PointViewModel.cs │ │ └── SampleViewModel.cs │ └── ViewModelLocator.cs └── app.config ├── CCDevStyling ├── BitmapGraphics │ ├── Assets.xaml │ ├── Assets │ │ └── andrelanninger.png │ ├── Icons.xaml │ └── Icons │ │ ├── XWhiteIcon.png │ │ ├── comboWhite.png │ │ └── maestroWhite.png ├── CCDevStyling.csproj ├── Colors │ ├── Brushes.xaml │ └── Colors.xaml ├── Converters │ └── Converter.xaml ├── DataTemplates │ └── DataTemplates.xaml ├── LookAndFeel.xaml ├── Properties │ └── AssemblyInfo.cs ├── Settings │ ├── Settings.xaml │ └── Typography.xaml ├── Styles │ ├── Border.xaml │ ├── Button.xaml │ ├── ContentControl.xaml │ ├── CustomControls │ │ ├── CircularProgressBar.xaml │ │ ├── PointChart.xaml │ │ └── SearchTextBox.xaml │ ├── FrameworkElement.xaml │ ├── ListBox.xaml │ ├── ProgressBar.xaml │ ├── Slider.xaml │ ├── TextBlock.xaml │ ├── TextBox.xaml │ └── ToggleButton.xaml └── VectorGraphics │ ├── Icons.xaml │ └── Shapes.xaml ├── CCLibrary ├── AttachedProperties │ └── AttachedProperties.cs ├── Behaviors │ └── LoadingBehavior │ │ ├── LoadingBehavior.cs │ │ └── LoadingBehaviorAdorner.cs ├── CCLibrary.csproj ├── Controls │ ├── CircularProgressBar │ │ ├── CircularProgressBar.cs │ │ └── CircularProgressBar.xaml │ ├── HighlightableTextBlock │ │ ├── HighlightableTextBlock.cs │ │ └── HighlightableTextBlock.xaml │ ├── NumericUpDown │ │ └── NumericUpDown.cs │ ├── PointChart │ │ ├── Overview.cd │ │ ├── PointChart.cs │ │ ├── PointChart.xaml │ │ └── PointChartItem.cs │ └── SearchTextBox │ │ ├── SearchTextBox.cs │ │ └── SearchTextBox.xaml ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── Themes │ └── Generic.xaml ├── CommonLibrary ├── CommonLibrary.csproj ├── Converter │ ├── CoerceValueConverter.cs │ └── ValueAsAngleConverter.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── Util │ ├── DelegateCommand.cs │ ├── MathHelpers.cs │ ├── ViewModelBase.cs │ └── WPFHelpers.cs ├── DLLs ├── Microsoft.Windows.Design.Interaction.dll └── System.Windows.Interactivity.dll └── SharedResourceDictionary ├── Properties └── AssemblyInfo.cs ├── SharedResourceDictionary.cs └── SharedResourceDictionary.csproj /Keynotes/WPF-CUSTOM-CONTROL-DEVELOPMENT-UNCHAINED.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Keynotes/WPF-CUSTOM-CONTROL-DEVELOPMENT-UNCHAINED.pdf -------------------------------------------------------------------------------- /Keynotes/WPF-UI-DEVELOPMENT-BEST-PRACTICES.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Keynotes/WPF-UI-DEVELOPMENT-BEST-PRACTICES.pdf -------------------------------------------------------------------------------- /Keynotes/WPF-UI-DEVELOPMENT-UNCHAINED-v3-Out.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Keynotes/WPF-UI-DEVELOPMENT-UNCHAINED-v3-Out.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WPF UI Development Best Practices 2 | 3 | Eine Sammlung WPF Best Practices als Vorträge (Keynotes) und Source-Code (Solutions). 4 | 5 | Copyright Ergosign GmbH
6 | Kommerzielle Nutzung untersagt.
7 | www.ergosign.de 8 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/CustomControlShowcase/0-1/CCDevShowcase.v11.suo -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | using System.Reflection; 8 | using System.IO; 9 | 10 | namespace CCDevShowcase 11 | { 12 | 13 | /// 14 | /// Interaction logic for App.xaml 15 | /// 16 | public partial class App : Application 17 | { 18 | 19 | /// 20 | /// Startup. 21 | /// 22 | /// 23 | protected override void OnStartup(StartupEventArgs e) 24 | { 25 | 26 | //Startup uri hack 27 | blendStartupHack(); 28 | 29 | //Show Main Window 30 | CCDevShowcase.MainWindow.getInstance(true); 31 | 32 | //Base 33 | base.OnStartup(e); 34 | 35 | } 36 | 37 | /// 38 | /// Disable blend startup uri bug. 39 | /// 40 | private void blendStartupHack() 41 | { 42 | 43 | var type = typeof(Application); 44 | 45 | var startupUri = type.GetField("_startupUri", BindingFlags.Public 46 | | BindingFlags.NonPublic 47 | | BindingFlags.Instance); 48 | 49 | startupUri.SetValue(this, null); 50 | 51 | } 52 | 53 | /// 54 | /// Ensure folder. 55 | /// 56 | /// 57 | protected static void ensureFolder(string path) 58 | { 59 | 60 | if (!Directory.Exists(path)) 61 | Directory.CreateDirectory(path); 62 | 63 | } 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using System.Diagnostics; 15 | 16 | namespace CCDevShowcase 17 | { 18 | 19 | /// 20 | /// Interaction logic for MainWindow.xaml 21 | /// 22 | public partial class MainWindow : Window 23 | { 24 | 25 | /// 26 | /// Singleton. 27 | /// 28 | private static MainWindow instance = null; 29 | 30 | /// 31 | /// Ctor. 32 | /// 33 | private MainWindow() 34 | { 35 | InitializeComponent(); 36 | } 37 | 38 | /// 39 | /// Get a reference. 40 | /// 41 | /// 42 | public static MainWindow getInstance(bool show = false) 43 | { 44 | 45 | if (instance == null) 46 | { 47 | 48 | instance = new MainWindow(); 49 | 50 | if (show) 51 | instance.Show(); 52 | 53 | } 54 | 55 | return instance; 56 | 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CCDevShowcase")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CCDevShowcase")] 15 | [assembly: AssemblyCopyright("Copyright © 2011")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCDevShowcase.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CCDevShowcase.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCDevShowcase.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/View/MainView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace CCDevShowcase.View 16 | { 17 | /// 18 | /// Interaction logic for MainView.xaml 19 | /// 20 | public partial class MainView : UserControl 21 | { 22 | public MainView() 23 | { 24 | InitializeComponent(); 25 | 26 | SetPointChartItemStyleButton.Click += SetPointChartItemStyleButton_Click; 27 | } 28 | 29 | void SetPointChartItemStyleButton_Click(object sender, RoutedEventArgs e) 30 | { 31 | MyPointChart.ItemContainerStyle = (SetPointChartItemStyleButton.IsChecked == true ? 32 | this.Resources["MySecondaryPointChartItemStyle"] : 33 | this.Resources["MyPointChartItemStyle"]) as Style; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/ViewModel/Samples/PointViewModel.cs: -------------------------------------------------------------------------------- 1 | using CommonLibrary.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.Diagnostics; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows; 9 | using System.Windows.Threading; 10 | 11 | namespace CCDevShowcase.ViewModel.Samples 12 | { 13 | public class PointViewModel : ViewModelBase 14 | { 15 | #region Memebrs 16 | 17 | /// 18 | /// XProperty source. 19 | /// 20 | private double x; 21 | 22 | /// 23 | /// YProperty source. 24 | /// 25 | private double y; 26 | 27 | /// 28 | /// NameProperty source. 29 | /// 30 | private string name; 31 | 32 | /// 33 | /// IsSelectedProperty source. 34 | /// 35 | private bool isSelected; 36 | 37 | /// 38 | /// IsSearchResultProperty source. 39 | /// 40 | private bool? isSearchResult; 41 | 42 | #endregion 43 | 44 | #region overrideMethods 45 | 46 | /// 47 | /// Override to string 48 | /// 49 | /// 50 | public override string ToString() 51 | { 52 | return string.Format("{0}, {1}", X, Y); 53 | } 54 | 55 | #endregion 56 | 57 | #region Properties 58 | 59 | /// 60 | /// XProperty gets or sets the X. 61 | /// 62 | public double X 63 | { 64 | get 65 | { 66 | return x; 67 | } 68 | 69 | set 70 | { 71 | if (value != this.x) 72 | { 73 | this.x = value; 74 | OnPropertyChanged("X"); 75 | } 76 | } 77 | } 78 | 79 | /// 80 | /// YProperty gets or sets the Y. 81 | /// 82 | public double Y 83 | { 84 | get 85 | { 86 | return y; 87 | } 88 | 89 | set 90 | { 91 | if (value != this.y) 92 | { 93 | this.y = value; 94 | OnPropertyChanged("Y"); 95 | } 96 | } 97 | } 98 | 99 | /// 100 | /// NameProperty gets or sets the Name. 101 | /// 102 | public string Name 103 | { 104 | get 105 | { 106 | return name; 107 | } 108 | 109 | set 110 | { 111 | if (value != this.name) 112 | { 113 | this.name = value; 114 | OnPropertyChanged("Name"); 115 | } 116 | } 117 | } 118 | 119 | /// 120 | /// IsSelectedProperty gets or sets the IsSelected. 121 | /// 122 | public bool IsSelected 123 | { 124 | get 125 | { 126 | return isSelected; 127 | } 128 | 129 | set 130 | { 131 | if (value != this.isSelected) 132 | { 133 | this.isSelected = value; 134 | OnPropertyChanged("IsSelected"); 135 | } 136 | } 137 | } 138 | 139 | /// 140 | /// IsSearchResultProperty gets or sets the IsSearchResult. 141 | /// 142 | public bool? IsSearchResult 143 | { 144 | get 145 | { 146 | return isSearchResult; 147 | } 148 | 149 | set 150 | { 151 | if (value != this.isSearchResult) 152 | { 153 | this.isSearchResult = value; 154 | OnPropertyChanged("IsSearchResult"); 155 | } 156 | } 157 | } 158 | 159 | #endregion 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/ViewModel/ViewModelLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Input; 7 | using System.Reflection; 8 | using System.Collections.ObjectModel; 9 | using CommonLibrary.Util; 10 | using CCDevShowcase.ViewModel.Samples; 11 | 12 | /* 13 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 14 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 15 | * 16 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 17 | * in particular with regard to resale and publication. 18 | */ 19 | namespace CCDevShowcase.ViewModel 20 | { 21 | /// 22 | /// 23 | /// The class ViewModelLocator represents a sample View Model Locator 24 | /// 25 | /// 26 | /// 27 | /// Class history: 28 | /// 29 | /// 30 | /// 0.1: First release, working (André Lanninger). 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// Author: André Lanninger 36 | /// Date: 06.06.2012 37 | /// 38 | public class ViewModelLocator : ViewModelBase 39 | { 40 | #region StaticMembers 41 | 42 | /// 43 | /// SampleViewModelProperty source. 44 | /// 45 | private static SampleViewModel sampleViewModel; 46 | 47 | #endregion 48 | 49 | #region Members 50 | 51 | 52 | #endregion 53 | 54 | #region Ctor 55 | 56 | public ViewModelLocator() 57 | { 58 | } 59 | 60 | #endregion 61 | 62 | #region Methods 63 | 64 | 65 | 66 | #endregion 67 | 68 | #region Properties 69 | 70 | /// 71 | /// SampleViewModel gets or sets the MainWindowViewModel. 72 | /// 73 | public object SampleViewModel 74 | { 75 | get 76 | { 77 | if (sampleViewModel == null) 78 | sampleViewModel = new SampleViewModel(); 79 | 80 | return sampleViewModel; 81 | } 82 | } 83 | 84 | #endregion 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevShowcase/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Assets.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | Assets/andrelanninger.png 14 | 15 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Assets/andrelanninger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Assets/andrelanninger.png -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | Icons/XWhiteIcon.png 14 | Icons/comboWhite.png 15 | Icons/maestroWhite.png 16 | 17 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/XWhiteIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/XWhiteIcon.png -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/comboWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/comboWhite.png -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/maestroWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/CustomControlShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/maestroWhite.png -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Colors/Brushes.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Colors/Colors.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | #FFFFFFFF 14 | #FF000000 15 | 16 | #333333 17 | #383a3c 18 | #575756 19 | #b2b2b2 20 | 21 | #19FFFFFF 22 | #33FFFFFF 23 | 24 | #0C000000 25 | #19000000 26 | 27 | #009de0 28 | 29 | #d6267f 30 | 31 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Converters/Converter.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/DataTemplates/DataTemplates.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/LookAndFeel.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 54 | 55 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Styles/ContentControl.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 37 | 38 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Styles/FrameworkElement.xaml: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 22 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Styles/TextBlock.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 31 | 32 | 35 | 36 | 39 | 40 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Styles/TextBox.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/Styles/ToggleButton.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 62 | 63 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/VectorGraphics/Icons.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCDevStyling/VectorGraphics/Shapes.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | F1 M 6.21875,10.9063L 15.125,20.4063L 28.5,6.71876L 25.2812,4.06252L 15.2812,14.6875L 8.59375,8.40625L 6.21875,10.9063 Z 14 | 15 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Controls/HighlightableTextBlock/HighlightableTextBlock.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Controls/PointChart/Overview.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | AAEYQAAEEABAACAAHDAAAAECAQAMAAAIANAQAAQCACA= 11 | Controls\PointChart\PointChart.cs 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Controls\PointChart\PointChartItem.cs 24 | 25 | 26 | 27 | 28 | AAQQAAAAAAMAAAAAAAAAAAACAAYAAAAACIAAAQAAAAA= 29 | Controls\PointChart\PointChartItem.cs 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Controls/PointChart/PointChart.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 27 | 28 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | using System.Windows.Markup; 7 | 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | [assembly: AssemblyTitle("CCLibrary")] 12 | [assembly: AssemblyDescription("")] 13 | [assembly: AssemblyConfiguration("")] 14 | [assembly: AssemblyCompany("")] 15 | [assembly: AssemblyProduct("CCLibrary")] 16 | [assembly: AssemblyCopyright("Copyright © 2013")] 17 | [assembly: AssemblyTrademark("")] 18 | [assembly: AssemblyCulture("")] 19 | 20 | // Setting ComVisible to false makes the types in this assembly not visible 21 | // to COM components. If you need to access a type in this assembly from 22 | // COM, set the ComVisible attribute to true on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | //In order to begin building localizable applications, set 26 | //CultureYouAreCodingWith in your .csproj file 27 | //inside a . For example, if you are using US english 28 | //in your source files, set the to en-US. Then uncomment 29 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 30 | //the line below to match the UICulture setting in the project file. 31 | 32 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 33 | 34 | 35 | [assembly:ThemeInfo( 36 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 37 | //(used if a resource is not found in the page, 38 | // or application resource dictionaries) 39 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 40 | //(used if a resource is not found in the page, 41 | // app, or any theme specific resource dictionaries) 42 | )] 43 | 44 | 45 | // Version information for an assembly consists of the following four values: 46 | // 47 | // Major Version 48 | // Minor Version 49 | // Build Number 50 | // Revision 51 | // 52 | // You can specify all the values or you can default the Build and Revision Numbers 53 | // by using the '*' as shown below: 54 | // [assembly: AssemblyVersion("1.0.*")] 55 | [assembly: AssemblyVersion("1.0.0.0")] 56 | [assembly: AssemblyFileVersion("1.0.0.0")] 57 | 58 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.PointChart")] 59 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.HighlightableTextBlock")] 60 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.SearchTextBox")] 61 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCLibrary.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CCLibrary.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCLibrary.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CCLibrary/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/CommonLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2D09A2CB-3AB2-4523-AE9B-2327EE591170} 8 | library 9 | Properties 10 | CommonLibrary 11 | CommonLibrary 12 | v4.0 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 4.0 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Code 59 | 60 | 61 | True 62 | True 63 | Resources.resx 64 | 65 | 66 | True 67 | Settings.settings 68 | True 69 | 70 | 71 | ResXFileCodeGenerator 72 | Resources.Designer.cs 73 | 74 | 75 | SettingsSingleFileGenerator 76 | Settings.Designer.cs 77 | 78 | 79 | 80 | 81 | 88 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | using System.Windows.Markup; 7 | 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | [assembly: AssemblyTitle("CommonLibrary")] 12 | [assembly: AssemblyDescription("")] 13 | [assembly: AssemblyConfiguration("")] 14 | [assembly: AssemblyCompany("")] 15 | [assembly: AssemblyProduct("CommonLibrary")] 16 | [assembly: AssemblyCopyright("Copyright © 2013")] 17 | [assembly: AssemblyTrademark("")] 18 | [assembly: AssemblyCulture("")] 19 | 20 | // Setting ComVisible to false makes the types in this assembly not visible 21 | // to COM components. If you need to access a type in this assembly from 22 | // COM, set the ComVisible attribute to true on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | //In order to begin building localizable applications, set 26 | //CultureYouAreCodingWith in your .csproj file 27 | //inside a . For example, if you are using US english 28 | //in your source files, set the to en-US. Then uncomment 29 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 30 | //the line below to match the UICulture setting in the project file. 31 | 32 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 33 | 34 | 35 | [assembly:ThemeInfo( 36 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 37 | //(used if a resource is not found in the page, 38 | // or application resource dictionaries) 39 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 40 | //(used if a resource is not found in the page, 41 | // app, or any theme specific resource dictionaries) 42 | )] 43 | 44 | 45 | // Version information for an assembly consists of the following four values: 46 | // 47 | // Major Version 48 | // Minor Version 49 | // Build Number 50 | // Revision 51 | // 52 | // You can specify all the values or you can default the Build and Revision Numbers 53 | // by using the '*' as shown below: 54 | // [assembly: AssemblyVersion("1.0.*")] 55 | [assembly: AssemblyVersion("1.0.0.0")] 56 | [assembly: AssemblyFileVersion("1.0.0.0")] 57 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CommonLibrary.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommonLibrary.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CommonLibrary.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Util/DelegateCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Input; 6 | 7 | /* 8 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 9 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 10 | * 11 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 12 | * in particular with regard to resale and publication. 13 | */ 14 | namespace CommonLibrary.Util 15 | { 16 | /// 17 | /// 18 | /// The class DelegateCommand represents a implementation of ICommand 19 | /// 20 | /// 21 | /// 22 | /// Class history: 23 | /// 24 | /// 25 | /// 0.1: First release, working (André Lanninger). 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// Author: André Lanninger, from: http://www.wpftutorial.net/delegatecommand.html 31 | /// Date: 06.06.2012 32 | /// 33 | public class DelegateCommand : ICommand 34 | { 35 | /// 36 | /// Predicate _canExecute 37 | /// 38 | private readonly Predicate _canExecute; 39 | 40 | /// 41 | /// Action _execute 42 | /// 43 | private readonly Action _execute; 44 | 45 | /// 46 | /// Eventhandler CanExecuteChanged 47 | /// 48 | public event EventHandler CanExecuteChanged; 49 | 50 | /// 51 | /// Ctor for DelegateCommand 52 | /// 53 | /// Action 54 | public DelegateCommand(Action execute) 55 | : this(execute, null) 56 | { 57 | } 58 | 59 | /// 60 | /// Ctor for DelegateCommand 61 | /// 62 | /// Action 63 | /// Predicate 64 | public DelegateCommand(Action execute, Predicate canExecute) 65 | { 66 | _execute = execute; 67 | _canExecute = canExecute; 68 | } 69 | 70 | /// 71 | /// Returns wheter the Command can be executed or not 72 | /// 73 | /// object 74 | /// bool 75 | public bool CanExecute(object parameter) 76 | { 77 | if (_canExecute == null) 78 | return true; 79 | 80 | return _canExecute(parameter); 81 | } 82 | 83 | /// 84 | /// Executes the command 85 | /// 86 | /// object 87 | public void Execute(object parameter) 88 | { 89 | _execute(parameter); 90 | } 91 | 92 | /// 93 | /// Raises CanExecuteChanged 94 | /// 95 | public void RaiseCanExecuteChanged() 96 | { 97 | if (CanExecuteChanged != null) 98 | CanExecuteChanged(this, EventArgs.Empty); 99 | } 100 | } 101 | } 102 | 103 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Util/MathHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Media; 8 | 9 | /* 10 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 11 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 12 | * 13 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 14 | * in particular with regard to resale and publication. 15 | */ 16 | namespace CommonLibrary.Util 17 | { 18 | /// 19 | /// 20 | /// The class MathHelpers represents a collection of math helper methods 21 | /// 22 | /// 23 | /// 24 | /// Class history: 25 | /// 26 | /// 27 | /// 0.1: First release, working (André Lanninger). 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// Author: André Lanninger 33 | /// Date: 09.11.2013 34 | /// 35 | public static class MathHelpers 36 | { 37 | /// 38 | /// Converts an unit point to a pixel point (given the current drawing context) 39 | /// 40 | /// UnitValuePoint 41 | /// DrawingContext 42 | /// PixelValuePoint 43 | public static Point ConvertUnitToPixelPoint(Point unitPoint, DrawingContext drawingContext) 44 | { 45 | Point pixelPoint = new Point(); 46 | 47 | pixelPoint.X = drawingContext.DrawingSize.Width / (drawingContext.XMaximum - drawingContext.XMinimum) * (unitPoint.X - drawingContext.XMinimum); 48 | pixelPoint.Y = drawingContext.DrawingSize.Height / (drawingContext.YMaximum - drawingContext.YMinimum) * (unitPoint.Y - drawingContext.YMinimum); 49 | 50 | return pixelPoint; 51 | } 52 | 53 | /// 54 | /// Converts an unit point collection to a pixel point collection (given the current drawing context) 55 | /// 56 | /// UnitValuePointCollection 57 | /// DrawingContext 58 | /// PixelValuePointCollection 59 | public static PointCollection ConvertUnitToPixelPointCollection(IEnumerable unitPoints, DrawingContext drawingContext) 60 | { 61 | PointCollection pixelPoints = new PointCollection(); 62 | 63 | foreach (var unitPoint in unitPoints) 64 | { 65 | pixelPoints.Add(ConvertUnitToPixelPoint(unitPoint, drawingContext)); 66 | } 67 | 68 | return pixelPoints; 69 | } 70 | } 71 | 72 | /// 73 | /// DrawingContextStruct 74 | /// 75 | public struct DrawingContext 76 | { 77 | public Size DrawingSize; 78 | public double XMinimum; 79 | public double XMaximum; 80 | public double YMinimum; 81 | public double YMaximum; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Util/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | using System.Diagnostics; 7 | using System.Reflection; 8 | using System.Linq.Expressions; 9 | 10 | /* 11 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 12 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 13 | * 14 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 15 | * in particular with regard to resale and publication. 16 | */ 17 | namespace CommonLibrary.Util 18 | { 19 | /// 20 | /// 21 | /// The class XObject represents a base class for creating derived ViewModel-Classes 22 | /// 23 | /// 24 | /// 25 | /// Class history: 26 | /// 27 | /// 28 | /// 0.1: First release, working (André Lanninger). 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// Author: André Lanninger 34 | /// Date: 06.06.2012 35 | /// 36 | public abstract class ViewModelBase : INotifyPropertyChanged 37 | { 38 | /// 39 | /// Logic for PropertyChanged 40 | /// 41 | /// string 42 | protected virtual void OnPropertyChanged(string propertyName) 43 | { 44 | this.VerifyPropertyName(propertyName); 45 | 46 | PropertyChangedEventHandler handler = this.PropertyChanged; 47 | if (handler != null) 48 | { 49 | var e = new PropertyChangedEventArgs(propertyName); 50 | handler(this, e); 51 | } 52 | } 53 | 54 | /// 55 | /// ThrowOnInvalidPropertyName-Property 56 | /// 57 | protected virtual bool ThrowOnInvalidPropertyName { get; private set; } 58 | 59 | /// 60 | /// VerifyPropertyName 61 | /// 62 | /// string 63 | [Conditional("DEBUG")] 64 | [DebuggerStepThrough] 65 | public void VerifyPropertyName(string propertyName) 66 | { 67 | // Verify that the property name matches a real, 68 | // public, instance property on this object. 69 | if (TypeDescriptor.GetProperties(this)[propertyName] == null) 70 | { 71 | string msg = "Invalid property name: " + propertyName; 72 | 73 | if (this.ThrowOnInvalidPropertyName) 74 | throw new Exception(msg); 75 | else 76 | Debug.Fail(msg); 77 | } 78 | } 79 | 80 | /// 81 | /// PropertyChanged Event 82 | /// 83 | public event PropertyChangedEventHandler PropertyChanged; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Solutions/CustomControlShowcase/0-1/CommonLibrary/Util/WPFHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Media; 8 | 9 | /* 10 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 11 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 12 | * 13 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 14 | * in particular with regard to resale and publication. 15 | */ 16 | namespace CommonLibrary.Util 17 | { 18 | /// 19 | /// 20 | /// The class WPFHelpers represents a collection of WPF helper methods 21 | /// 22 | /// 23 | /// 24 | /// Class history: 25 | /// 26 | /// 27 | /// 0.1: First release, working (André Lanninger). 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// Author: André Lanninger 33 | /// Date: 27.03.2013 34 | /// 35 | public static class WPFHelpers 36 | { 37 | /// 38 | /// Searches the visual tree for an ancestor specified by the type T 39 | /// 40 | /// Searched Type 41 | /// Starting Point 42 | /// Searched Type 43 | public static T FindAncestor(DependencyObject dependencyObject) where T : class 44 | { 45 | DependencyObject target = dependencyObject; 46 | do 47 | { 48 | target = VisualTreeHelper.GetParent(target); 49 | } 50 | while (target != null && !(target is T)); 51 | 52 | return target as T; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | MainView 26 | 27 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | using System.Reflection; 8 | using System.IO; 9 | 10 | namespace CCDevShowcase 11 | { 12 | 13 | /// 14 | /// Interaction logic for App.xaml 15 | /// 16 | public partial class App : Application 17 | { 18 | 19 | /// 20 | /// Startup. 21 | /// 22 | /// 23 | protected override void OnStartup(StartupEventArgs e) 24 | { 25 | 26 | //Startup uri hack 27 | blendStartupHack(); 28 | 29 | //Show Main Window 30 | CCDevShowcase.MainWindow.getInstance(true); 31 | 32 | //Base 33 | base.OnStartup(e); 34 | 35 | } 36 | 37 | /// 38 | /// Disable blend startup uri bug. 39 | /// 40 | private void blendStartupHack() 41 | { 42 | 43 | var type = typeof(Application); 44 | 45 | var startupUri = type.GetField("_startupUri", BindingFlags.Public 46 | | BindingFlags.NonPublic 47 | | BindingFlags.Instance); 48 | 49 | startupUri.SetValue(this, null); 50 | 51 | } 52 | 53 | /// 54 | /// Ensure folder. 55 | /// 56 | /// 57 | protected static void ensureFolder(string path) 58 | { 59 | 60 | if (!Directory.Exists(path)) 61 | Directory.CreateDirectory(path); 62 | 63 | } 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using System.Diagnostics; 15 | 16 | namespace CCDevShowcase 17 | { 18 | 19 | /// 20 | /// Interaction logic for MainWindow.xaml 21 | /// 22 | public partial class MainWindow : Window 23 | { 24 | 25 | /// 26 | /// Singleton. 27 | /// 28 | private static MainWindow instance = null; 29 | 30 | /// 31 | /// Ctor. 32 | /// 33 | private MainWindow() 34 | { 35 | 36 | InitializeComponent(); 37 | 38 | ShowFocusStyleCheckBox.Checked += ShowFocusStyleCheckBoxChecked; 39 | ShowFocusStyleCheckBox.Unchecked += ShowFocusStyleCheckBoxUnChecked; 40 | } 41 | 42 | /// 43 | /// Get a reference. 44 | /// 45 | /// 46 | public static MainWindow getInstance(bool show = false) 47 | { 48 | 49 | if (instance == null) 50 | { 51 | 52 | instance = new MainWindow(); 53 | 54 | if (show) 55 | instance.Show(); 56 | 57 | } 58 | 59 | return instance; 60 | 61 | } 62 | 63 | private string FindNameFromResource(ResourceDictionary dictionary, object resourceItem) 64 | { 65 | string result = null; 66 | 67 | foreach (object key in dictionary.Keys) 68 | { 69 | if (dictionary[key] == resourceItem) 70 | { 71 | return key.ToString(); 72 | } 73 | } 74 | 75 | foreach (var dict in dictionary.MergedDictionaries) 76 | { 77 | result = FindNameFromResource(dict, resourceItem); 78 | 79 | if (result != null) 80 | return result; 81 | } 82 | 83 | return null; 84 | } 85 | 86 | private void ShowFocusStyleCheckBoxChecked(object sender, RoutedEventArgs e) 87 | { 88 | this.PreviewGotKeyboardFocus += MainWindowPreviewGotKeyboardFocus; 89 | } 90 | 91 | private void ShowFocusStyleCheckBoxUnChecked(object sender, RoutedEventArgs e) 92 | { 93 | this.PreviewGotKeyboardFocus -= MainWindowPreviewGotKeyboardFocus; 94 | } 95 | 96 | private void MainWindowPreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) 97 | { 98 | FrameworkElement fe = e.OriginalSource as FrameworkElement; 99 | 100 | string styleName = FindNameFromResource(Application.Current.Resources, fe.Style); 101 | 102 | Debug.WriteLine("Control: {0} ||||| Style: {1}", fe, styleName); 103 | } 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CCDevShowcase")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("CCDevShowcase")] 15 | [assembly: AssemblyCopyright("Copyright © 2011")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCDevShowcase.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CCDevShowcase.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCDevShowcase.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/MainView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace CCDevShowcase.View 16 | { 17 | /// 18 | /// Interaction logic for MainView.xaml 19 | /// 20 | public partial class MainView : UserControl 21 | { 22 | public MainView() 23 | { 24 | InitializeComponent(); 25 | 26 | SetPointChartItemStyleButton.Click += SetPointChartItemStyleButton_Click; 27 | } 28 | 29 | void SetPointChartItemStyleButton_Click(object sender, RoutedEventArgs e) 30 | { 31 | MyPointChart.ItemContainerStyle = (SetPointChartItemStyleButton.IsChecked == true ? 32 | this.Resources["MySecondaryPointChartItemStyle"] : 33 | this.Resources["MyPointChartItemStyle"]) as Style; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/SimpleCCSampleView.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 12 | 13 | 16 | 19 | 20 | 25 | 26 | 27 | 28 | 29 | 30 | 36 | 39 | 40 | 41 | 45 | 46 | 47 | 53 | 54 | 55 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/SimpleCCSampleView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace CCDevShowcase.View 16 | { 17 | /// 18 | /// Interaction logic for SimpleCCSampleView.xaml 19 | /// 20 | public partial class SimpleCCSampleView : UserControl 21 | { 22 | public SimpleCCSampleView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/Test1View.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/Test1View.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace CCDevShowcase.View 16 | { 17 | /// 18 | /// Interaction logic for Test1View.xaml 19 | /// 20 | public partial class Test1View : UserControl 21 | { 22 | public Test1View() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/TestView.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/View/TestView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace CCDevShowcase.View 16 | { 17 | /// 18 | /// Interaction logic for TestView.xaml 19 | /// 20 | public partial class TestView : UserControl 21 | { 22 | public TestView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/ViewModel/MainWindow/ViewViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using CommonLibrary.Util; 7 | 8 | /* 9 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 10 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 11 | * 12 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 13 | * in particular with regard to resale and publication. 14 | */ 15 | namespace CCDevShowcase.ViewModel 16 | { 17 | /// 18 | /// 19 | /// The class ViewViewModel represents a view view model 20 | /// 21 | /// 22 | /// 23 | /// Class history: 24 | /// 25 | /// 26 | /// 0.1: First release, working (André Lanninger). 27 | /// 28 | /// 29 | /// 30 | /// 31 | /// Author: André Lanninger 32 | /// Date: 06.06.2012 33 | /// 34 | public class ViewViewModel : ViewModelBase 35 | { 36 | /// 37 | /// NameProperty source. 38 | /// 39 | private string name; 40 | 41 | /// 42 | /// ViewProperty source. 43 | /// 44 | private object view; 45 | 46 | /// 47 | /// NameProperty gets or sets the Name. 48 | /// 49 | public string Name 50 | { 51 | get 52 | { 53 | return name; 54 | } 55 | 56 | set 57 | { 58 | if (value != this.name) 59 | { 60 | this.name = value; 61 | OnPropertyChanged("Name"); 62 | } 63 | } 64 | } 65 | 66 | /// 67 | /// ViewProperty gets or sets the View. 68 | /// 69 | public object View 70 | { 71 | get 72 | { 73 | return view; 74 | } 75 | 76 | set 77 | { 78 | if (value != this.view) 79 | { 80 | this.view = value; 81 | 82 | if (this.view == null) 83 | Debug.WriteLine("Del_" + this.name); 84 | else 85 | Debug.WriteLine("Add_" + this.name); 86 | 87 | Debug.WriteLine("------"); 88 | 89 | OnPropertyChanged("View"); 90 | } 91 | } 92 | } 93 | 94 | /// 95 | /// Override to string for listbox ;) 96 | /// 97 | /// 98 | public override string ToString() 99 | { 100 | return Name; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/ViewModel/Samples/PointViewModel.cs: -------------------------------------------------------------------------------- 1 | using CommonLibrary.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.Diagnostics; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows; 9 | using System.Windows.Threading; 10 | 11 | namespace CCDevShowcase.ViewModel.Samples 12 | { 13 | public class PointViewModel : ViewModelBase 14 | { 15 | #region Memebrs 16 | 17 | /// 18 | /// XProperty source. 19 | /// 20 | private double x; 21 | 22 | /// 23 | /// YProperty source. 24 | /// 25 | private double y; 26 | 27 | /// 28 | /// NameProperty source. 29 | /// 30 | private string name; 31 | 32 | /// 33 | /// IsSelectedProperty source. 34 | /// 35 | private bool isSelected; 36 | 37 | /// 38 | /// IsSearchResultProperty source. 39 | /// 40 | private bool? isSearchResult; 41 | 42 | #endregion 43 | 44 | #region overrideMethods 45 | 46 | /// 47 | /// Override to string 48 | /// 49 | /// 50 | public override string ToString() 51 | { 52 | return string.Format("{0}, {1}", X, Y); 53 | } 54 | 55 | #endregion 56 | 57 | #region Properties 58 | 59 | /// 60 | /// XProperty gets or sets the X. 61 | /// 62 | public double X 63 | { 64 | get 65 | { 66 | return x; 67 | } 68 | 69 | set 70 | { 71 | if (value != this.x) 72 | { 73 | this.x = value; 74 | OnPropertyChanged("X"); 75 | } 76 | } 77 | } 78 | 79 | /// 80 | /// YProperty gets or sets the Y. 81 | /// 82 | public double Y 83 | { 84 | get 85 | { 86 | return y; 87 | } 88 | 89 | set 90 | { 91 | if (value != this.y) 92 | { 93 | this.y = value; 94 | OnPropertyChanged("Y"); 95 | } 96 | } 97 | } 98 | 99 | /// 100 | /// NameProperty gets or sets the Name. 101 | /// 102 | public string Name 103 | { 104 | get 105 | { 106 | return name; 107 | } 108 | 109 | set 110 | { 111 | if (value != this.name) 112 | { 113 | this.name = value; 114 | OnPropertyChanged("Name"); 115 | } 116 | } 117 | } 118 | 119 | /// 120 | /// IsSelectedProperty gets or sets the IsSelected. 121 | /// 122 | public bool IsSelected 123 | { 124 | get 125 | { 126 | return isSelected; 127 | } 128 | 129 | set 130 | { 131 | if (value != this.isSelected) 132 | { 133 | this.isSelected = value; 134 | OnPropertyChanged("IsSelected"); 135 | } 136 | } 137 | } 138 | 139 | /// 140 | /// IsSearchResultProperty gets or sets the IsSearchResult. 141 | /// 142 | public bool? IsSearchResult 143 | { 144 | get 145 | { 146 | return isSearchResult; 147 | } 148 | 149 | set 150 | { 151 | if (value != this.isSearchResult) 152 | { 153 | this.isSearchResult = value; 154 | OnPropertyChanged("IsSearchResult"); 155 | } 156 | } 157 | } 158 | 159 | #endregion 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/ViewModel/ViewModelLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Input; 7 | using System.Reflection; 8 | using System.Collections.ObjectModel; 9 | using CommonLibrary.Util; 10 | using CCDevShowcase.ViewModel.Samples; 11 | 12 | /* 13 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 14 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 15 | * 16 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 17 | * in particular with regard to resale and publication. 18 | */ 19 | namespace CCDevShowcase.ViewModel 20 | { 21 | /// 22 | /// 23 | /// The class ViewModelLocator represents a sample View Model Locator 24 | /// 25 | /// 26 | /// 27 | /// Class history: 28 | /// 29 | /// 30 | /// 0.1: First release, working (André Lanninger). 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// Author: André Lanninger 36 | /// Date: 06.06.2012 37 | /// 38 | public class ViewModelLocator : ViewModelBase 39 | { 40 | #region StaticMembers 41 | 42 | /// 43 | /// MainWindowViewModelProperty source. 44 | /// 45 | private static MainWindowViewModel mainWindowViewModel; 46 | 47 | /// 48 | /// SampleViewModelProperty source. 49 | /// 50 | private static SampleViewModel sampleViewModel; 51 | 52 | #endregion 53 | 54 | #region Members 55 | 56 | 57 | #endregion 58 | 59 | #region Ctor 60 | 61 | public ViewModelLocator() 62 | { 63 | } 64 | 65 | #endregion 66 | 67 | #region Methods 68 | 69 | 70 | 71 | #endregion 72 | 73 | #region Properties 74 | 75 | /// 76 | /// MainWindowViewModel gets or sets the MainWindowViewModel. 77 | /// 78 | public object MainWindowViewModel 79 | { 80 | get 81 | { 82 | if (mainWindowViewModel == null) 83 | mainWindowViewModel = new MainWindowViewModel(); 84 | 85 | return mainWindowViewModel; 86 | } 87 | } 88 | 89 | /// 90 | /// SampleViewModel gets or sets the MainWindowViewModel. 91 | /// 92 | public object SampleViewModel 93 | { 94 | get 95 | { 96 | if (sampleViewModel == null) 97 | sampleViewModel = new SampleViewModel(); 98 | 99 | return sampleViewModel; 100 | } 101 | } 102 | 103 | #endregion 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevShowcase/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Assets.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | Assets/andrelanninger.png 14 | 15 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Assets/andrelanninger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Assets/andrelanninger.png -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | Icons/XWhiteIcon.png 14 | Icons/comboWhite.png 15 | Icons/maestroWhite.png 16 | 17 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/XWhiteIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/XWhiteIcon.png -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/comboWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/comboWhite.png -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/maestroWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/UnchainedShowcase/0-1/CCDevStyling/BitmapGraphics/Icons/maestroWhite.png -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Colors/Brushes.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Colors/Colors.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | #FFFFFFFF 14 | #FF000000 15 | 16 | #333333 17 | #383a3c 18 | #575756 19 | #b2b2b2 20 | 21 | #19FFFFFF 22 | #33FFFFFF 23 | 24 | #0C000000 25 | #19000000 26 | 27 | #009de0 28 | 29 | #d6267f 30 | 31 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Converters/Converter.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/LookAndFeel.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 46 | 47 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Styles/Button.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 54 | 55 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Styles/ContentControl.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 37 | 38 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Styles/FrameworkElement.xaml: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 22 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Styles/TextBlock.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 30 | 31 | 34 | 35 | 38 | 39 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/Styles/ToggleButton.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 62 | 63 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/VectorGraphics/Icons.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCDevStyling/VectorGraphics/Shapes.xaml: -------------------------------------------------------------------------------- 1 |  2 | 11 | 12 | 13 | F1 M 6.21875,10.9063L 15.125,20.4063L 28.5,6.71876L 25.2812,4.06252L 15.2812,14.6875L 8.59375,8.40625L 6.21875,10.9063 Z 14 | 15 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Controls/CircularProgressBar/CircularProgressBar.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Controls/HighlightableTextBlock/HighlightableTextBlock.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Controls/NumericUpDown/NumericUpDown.cs: -------------------------------------------------------------------------------- 1 | using CommonLibrary.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Threading; 9 | 10 | namespace CCLibrary.Controls.NumericUpDown 11 | { 12 | [TemplatePart(Name="PART_TextBox", Type=typeof(TextBox))] 13 | public class NumericUpDown : Slider 14 | { 15 | private bool internalIsLoaded; 16 | 17 | private static object CoerceValueProperty(DependencyObject d, object baseValue) 18 | { 19 | NumericUpDown self = d as NumericUpDown; 20 | 21 | return self.InternalCoerceValueProperty((double)baseValue); 22 | } 23 | 24 | public NumericUpDown() 25 | { 26 | //this.Loaded += NumericUpDown_Loaded; 27 | 28 | this.Dispatcher.BeginInvoke(new Action(() => 29 | { 30 | if (internalIsLoaded) 31 | return; 32 | 33 | internalIsLoaded = true; 34 | InternalCoerceValueProperty(); 35 | }), DispatcherPriority.Loaded); 36 | } 37 | 38 | static NumericUpDown() 39 | { 40 | ValueProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(0.0, null, CoerceValueProperty)); 41 | } 42 | 43 | public override void OnApplyTemplate() 44 | { 45 | base.OnApplyTemplate(); 46 | 47 | PartTextBox = GetTemplateChild("PART_TextBox") as TextBox; 48 | PartTextBox.TextChanged += PartTextBox_TextChanged; 49 | } 50 | 51 | /* 52 | void NumericUpDown_Loaded(object sender, RoutedEventArgs e) 53 | { 54 | if (internalIsLoaded) 55 | return; 56 | 57 | internalIsLoaded = true; 58 | InternalCoerceValueProperty(); 59 | }*/ 60 | 61 | void PartTextBox_TextChanged(object sender, TextChangedEventArgs e) 62 | { 63 | double doubleValue; 64 | 65 | if (string.IsNullOrEmpty(PartTextBox.Text)) 66 | { 67 | //PartTextBox.Text = Minimum.ToString(); 68 | //PartTextBox.CaretIndex = PartTextBox.Text.Length; 69 | return; 70 | } 71 | 72 | if (!double.TryParse(PartTextBox.Text, out doubleValue)) 73 | { 74 | PartTextBox.Text = Value.ToString(); 75 | PartTextBox.CaretIndex = PartTextBox.Text.Length; 76 | } 77 | else 78 | { 79 | Value = InternalCoerceValueProperty(doubleValue); 80 | } 81 | } 82 | 83 | private double InternalCoerceValueProperty(double value = double.NaN) 84 | { 85 | if (double.IsNaN(value)) 86 | value = Value; 87 | 88 | double newValue = MathHelpers.ValueInTickFrequencyAndRange(Minimum, Maximum, TickFrequency, value); 89 | 90 | if (PartTextBox != null) 91 | { 92 | double textBoxValue; 93 | 94 | if (!double.TryParse(PartTextBox.Text, out textBoxValue) || !double.Equals(textBoxValue, newValue)) 95 | { 96 | PartTextBox.Text = newValue.ToString(); 97 | PartTextBox.CaretIndex = PartTextBox.Text.Length; 98 | } 99 | } 100 | 101 | return newValue; 102 | } 103 | 104 | public TextBox PartTextBox { get; set; } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Controls/PointChart/Overview.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | AAEYQAAEEABAACAAHDAAAAECAQAMAAAIANAQAAQCACA= 11 | Controls\PointChart\PointChart.cs 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Controls\PointChart\PointChartItem.cs 24 | 25 | 26 | 27 | 28 | AAQQAAAAAAMAAAAAAAAAAAACAAYAAAAACIAAAQAAAAA= 29 | Controls\PointChart\PointChartItem.cs 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Controls/PointChart/PointChart.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 27 | 28 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | using System.Windows.Markup; 7 | 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | [assembly: AssemblyTitle("CCLibrary")] 12 | [assembly: AssemblyDescription("")] 13 | [assembly: AssemblyConfiguration("")] 14 | [assembly: AssemblyCompany("")] 15 | [assembly: AssemblyProduct("CCLibrary")] 16 | [assembly: AssemblyCopyright("Copyright © 2013")] 17 | [assembly: AssemblyTrademark("")] 18 | [assembly: AssemblyCulture("")] 19 | 20 | // Setting ComVisible to false makes the types in this assembly not visible 21 | // to COM components. If you need to access a type in this assembly from 22 | // COM, set the ComVisible attribute to true on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | //In order to begin building localizable applications, set 26 | //CultureYouAreCodingWith in your .csproj file 27 | //inside a . For example, if you are using US english 28 | //in your source files, set the to en-US. Then uncomment 29 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 30 | //the line below to match the UICulture setting in the project file. 31 | 32 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 33 | 34 | 35 | [assembly:ThemeInfo( 36 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 37 | //(used if a resource is not found in the page, 38 | // or application resource dictionaries) 39 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 40 | //(used if a resource is not found in the page, 41 | // app, or any theme specific resource dictionaries) 42 | )] 43 | 44 | 45 | // Version information for an assembly consists of the following four values: 46 | // 47 | // Major Version 48 | // Minor Version 49 | // Build Number 50 | // Revision 51 | // 52 | // You can specify all the values or you can default the Build and Revision Numbers 53 | // by using the '*' as shown below: 54 | // [assembly: AssemblyVersion("1.0.*")] 55 | [assembly: AssemblyVersion("1.0.0.0")] 56 | [assembly: AssemblyFileVersion("1.0.0.0")] 57 | 58 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.PointChart")] 59 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.HighlightableTextBlock")] 60 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.SearchTextBox")] 61 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.CircularProgressBar")] 62 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Controls.NumericUpDown")] 63 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.Behaviors")] 64 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CCLibrary.AttachedProperties")] -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCLibrary.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CCLibrary.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCLibrary.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CCLibrary/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/CommonLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2D09A2CB-3AB2-4523-AE9B-2327EE591170} 8 | library 9 | Properties 10 | CommonLibrary 11 | CommonLibrary 12 | v4.0 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 4.0 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Code 61 | 62 | 63 | True 64 | True 65 | Resources.resx 66 | 67 | 68 | True 69 | Settings.settings 70 | True 71 | 72 | 73 | ResXFileCodeGenerator 74 | Resources.Designer.cs 75 | 76 | 77 | SettingsSingleFileGenerator 78 | Settings.Designer.cs 79 | 80 | 81 | 82 | 83 | 90 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Converter/ValueAsAngleConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonLibrary.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Windows.Data; 7 | 8 | /* 9 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 10 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 11 | * 12 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 13 | * in particular with regard to resale and publication. 14 | */ 15 | namespace CommonLibrary.Converter 16 | { 17 | /// 18 | /// 19 | /// The class ValueAsAngle represents the value as a angle 20 | /// 21 | /// 22 | /// 23 | /// Class history: 24 | /// 25 | /// 26 | /// 0.1: First release, working (André Lanninger). 27 | /// 28 | /// 29 | /// 30 | /// 31 | /// Author: André Lanninger 32 | /// Date: 17.10.2013 33 | /// 34 | public class ValueAsAngleConverter : IMultiValueConverter 35 | { 36 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 37 | { 38 | if (values.Count() != 3) 39 | return 0.0; 40 | 41 | double min, max, value = 0.0; 42 | 43 | if (values[0] == null || values[1] == null || values[2] == null) 44 | return 0.0; 45 | 46 | if (!double.TryParse(values[0].ToString(), out min) || 47 | !double.TryParse(values[1].ToString(), out max) || 48 | !double.TryParse(values[2].ToString(), out value)) 49 | return 0.0; 50 | 51 | return MathHelpers.ValueAsAngle(min, max, value); 52 | } 53 | 54 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) 55 | { 56 | throw new NotImplementedException(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | using System.Windows.Markup; 7 | 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | [assembly: AssemblyTitle("CommonLibrary")] 12 | [assembly: AssemblyDescription("")] 13 | [assembly: AssemblyConfiguration("")] 14 | [assembly: AssemblyCompany("")] 15 | [assembly: AssemblyProduct("CommonLibrary")] 16 | [assembly: AssemblyCopyright("Copyright © 2013")] 17 | [assembly: AssemblyTrademark("")] 18 | [assembly: AssemblyCulture("")] 19 | 20 | // Setting ComVisible to false makes the types in this assembly not visible 21 | // to COM components. If you need to access a type in this assembly from 22 | // COM, set the ComVisible attribute to true on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | //In order to begin building localizable applications, set 26 | //CultureYouAreCodingWith in your .csproj file 27 | //inside a . For example, if you are using US english 28 | //in your source files, set the to en-US. Then uncomment 29 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 30 | //the line below to match the UICulture setting in the project file. 31 | 32 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 33 | 34 | 35 | [assembly:ThemeInfo( 36 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 37 | //(used if a resource is not found in the page, 38 | // or application resource dictionaries) 39 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 40 | //(used if a resource is not found in the page, 41 | // app, or any theme specific resource dictionaries) 42 | )] 43 | 44 | 45 | // Version information for an assembly consists of the following four values: 46 | // 47 | // Major Version 48 | // Minor Version 49 | // Build Number 50 | // Revision 51 | // 52 | // You can specify all the values or you can default the Build and Revision Numbers 53 | // by using the '*' as shown below: 54 | // [assembly: AssemblyVersion("1.0.*")] 55 | [assembly: AssemblyVersion("1.0.0.0")] 56 | [assembly: AssemblyFileVersion("1.0.0.0")] 57 | 58 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "CommonLibrary.Converter")] 59 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CommonLibrary.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommonLibrary.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18051 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CommonLibrary.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Util/DelegateCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Input; 6 | 7 | /* 8 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 9 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 10 | * 11 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 12 | * in particular with regard to resale and publication. 13 | */ 14 | namespace CommonLibrary.Util 15 | { 16 | /// 17 | /// 18 | /// The class DelegateCommand represents a implementation of ICommand 19 | /// 20 | /// 21 | /// 22 | /// Class history: 23 | /// 24 | /// 25 | /// 0.1: First release, working (André Lanninger). 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// Author: André Lanninger, from: http://www.wpftutorial.net/delegatecommand.html 31 | /// Date: 06.06.2012 32 | /// 33 | public class DelegateCommand : ICommand 34 | { 35 | /// 36 | /// Predicate _canExecute 37 | /// 38 | private readonly Predicate _canExecute; 39 | 40 | /// 41 | /// Action _execute 42 | /// 43 | private readonly Action _execute; 44 | 45 | /// 46 | /// Eventhandler CanExecuteChanged 47 | /// 48 | public event EventHandler CanExecuteChanged; 49 | 50 | /// 51 | /// Ctor for DelegateCommand 52 | /// 53 | /// Action 54 | public DelegateCommand(Action execute) 55 | : this(execute, null) 56 | { 57 | } 58 | 59 | /// 60 | /// Ctor for DelegateCommand 61 | /// 62 | /// Action 63 | /// Predicate 64 | public DelegateCommand(Action execute, Predicate canExecute) 65 | { 66 | _execute = execute; 67 | _canExecute = canExecute; 68 | } 69 | 70 | /// 71 | /// Returns wheter the Command can be executed or not 72 | /// 73 | /// object 74 | /// bool 75 | public bool CanExecute(object parameter) 76 | { 77 | if (_canExecute == null) 78 | return true; 79 | 80 | return _canExecute(parameter); 81 | } 82 | 83 | /// 84 | /// Executes the command 85 | /// 86 | /// object 87 | public void Execute(object parameter) 88 | { 89 | _execute(parameter); 90 | } 91 | 92 | /// 93 | /// Raises CanExecuteChanged 94 | /// 95 | public void RaiseCanExecuteChanged() 96 | { 97 | if (CanExecuteChanged != null) 98 | CanExecuteChanged(this, EventArgs.Empty); 99 | } 100 | } 101 | } 102 | 103 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Util/MathHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Media; 8 | 9 | /* 10 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 11 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 12 | * 13 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 14 | * in particular with regard to resale and publication. 15 | */ 16 | namespace CommonLibrary.Util 17 | { 18 | public static class MathHelpers 19 | { 20 | public static Point ConvertUnitToPixelPoint(Point unitPoint, DrawingContext drawingContext) 21 | { 22 | Point pixelPoint = new Point(); 23 | 24 | pixelPoint.X = drawingContext.DrawingSize.Width / (drawingContext.XMaximum - drawingContext.XMinimum) * (unitPoint.X - drawingContext.XMinimum); 25 | pixelPoint.Y = drawingContext.DrawingSize.Height / (drawingContext.YMaximum - drawingContext.YMinimum) * (unitPoint.Y - drawingContext.YMinimum); 26 | 27 | return pixelPoint; 28 | } 29 | 30 | public static PointCollection ConvertUnitToPixelPointCollection(IEnumerable unitPoints, DrawingContext drawingContext) 31 | { 32 | PointCollection pixelPoints = new PointCollection(); 33 | 34 | foreach (var unitPoint in unitPoints) 35 | { 36 | pixelPoints.Add(ConvertUnitToPixelPoint(unitPoint, drawingContext)); 37 | } 38 | 39 | return pixelPoints; 40 | } 41 | 42 | public static double ValueAsAngle(double minimum, double maximum, double value) 43 | { 44 | return Math.Max(0, Math.Min(((value - minimum) / (maximum - minimum)) * 360.0, 360.0)); 45 | } 46 | 47 | public static double ValueInTickFrequencyAndRange(double minimum, double maximum, double tickFrequency, double value) 48 | { 49 | return Math.Max(minimum, Math.Min(NearestMultiple(value, tickFrequency), maximum)); 50 | } 51 | 52 | public static double NearestMultiple(double value, double div) 53 | { 54 | return (int)Math.Round((value / div)) * div; 55 | } 56 | } 57 | 58 | public struct DrawingContext 59 | { 60 | public Size DrawingSize; 61 | public double XMinimum; 62 | public double XMaximum; 63 | public double YMinimum; 64 | public double YMaximum; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Util/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | using System.Diagnostics; 7 | using System.Reflection; 8 | using System.Linq.Expressions; 9 | 10 | /* 11 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 12 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 13 | * 14 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 15 | * in particular with regard to resale and publication. 16 | */ 17 | namespace CommonLibrary.Util 18 | { 19 | /// 20 | /// 21 | /// The class XObject represents a base class for creating derived ViewModel-Classes 22 | /// 23 | /// 24 | /// 25 | /// Class history: 26 | /// 27 | /// 28 | /// 0.1: First release, working (André Lanninger). 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// Author: André Lanninger 34 | /// Date: 06.06.2012 35 | /// 36 | public abstract class ViewModelBase : INotifyPropertyChanged 37 | { 38 | /// 39 | /// Logic for PropertyChanged 40 | /// 41 | /// string 42 | protected virtual void OnPropertyChanged(string propertyName) 43 | { 44 | this.VerifyPropertyName(propertyName); 45 | 46 | PropertyChangedEventHandler handler = this.PropertyChanged; 47 | if (handler != null) 48 | { 49 | var e = new PropertyChangedEventArgs(propertyName); 50 | handler(this, e); 51 | } 52 | } 53 | 54 | /// 55 | /// ThrowOnInvalidPropertyName-Property 56 | /// 57 | protected virtual bool ThrowOnInvalidPropertyName { get; private set; } 58 | 59 | /// 60 | /// VerifyPropertyName 61 | /// 62 | /// string 63 | [Conditional("DEBUG")] 64 | [DebuggerStepThrough] 65 | public void VerifyPropertyName(string propertyName) 66 | { 67 | // Verify that the property name matches a real, 68 | // public, instance property on this object. 69 | if (TypeDescriptor.GetProperties(this)[propertyName] == null) 70 | { 71 | string msg = "Invalid property name: " + propertyName; 72 | 73 | if (this.ThrowOnInvalidPropertyName) 74 | throw new Exception(msg); 75 | else 76 | Debug.Fail(msg); 77 | } 78 | } 79 | 80 | /// 81 | /// PropertyChanged Event 82 | /// 83 | public event PropertyChangedEventHandler PropertyChanged; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/CommonLibrary/Util/WPFHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Windows; 7 | using System.Windows.Media; 8 | 9 | /* 10 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 11 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 12 | * 13 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 14 | * in particular with regard to resale and publication. 15 | */ 16 | namespace CommonLibrary.Util 17 | { 18 | /// 19 | /// 20 | /// The class WPFHelpers represents a collection of WPF helper methods 21 | /// 22 | /// 23 | /// 24 | /// Class history: 25 | /// 26 | /// 27 | /// 0.1: First release, working (André Lanninger). 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// Author: André Lanninger 33 | /// Date: 27.03.2013 34 | /// 35 | public static class WPFHelpers 36 | { 37 | /// 38 | /// Returns all types in the given assembly and namespace 39 | /// 40 | /// Assembly 41 | /// string 42 | /// Type[] 43 | public static Type[] GetTypesInNamespace(Assembly assembly, string nameSpace) 44 | { 45 | return assembly.GetTypes().Where(t => String.Equals(t.Namespace, nameSpace, StringComparison.Ordinal)).ToArray(); 46 | } 47 | 48 | /// 49 | /// Searches the visual tree for an ancestor specified by the type T 50 | /// 51 | /// Searched Type 52 | /// Starting Point 53 | /// Searched Type 54 | public static T FindAncestor(DependencyObject dependencyObject) where T : class 55 | { 56 | DependencyObject target = dependencyObject; 57 | do 58 | { 59 | target = VisualTreeHelper.GetParent(target); 60 | } 61 | while (target != null && !(target is T)); 62 | 63 | return target as T; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/DLLs/Microsoft.Windows.Design.Interaction.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/UnchainedShowcase/0-1/DLLs/Microsoft.Windows.Design.Interaction.dll -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/DLLs/System.Windows.Interactivity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dctdct/WPF-UI-Development-Best-Practices/8d99d40f495edecf3c82d2e5b9f22e2d7e485c23/Solutions/UnchainedShowcase/0-1/DLLs/System.Windows.Interactivity.dll -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/SharedResourceDictionary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Windows.Markup; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("SharedResourceDictionary")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("SharedResourceDictionary")] 14 | [assembly: AssemblyCopyright("Copyright © 2012")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("fc42572d-49e3-415a-b530-b527bd89f23e")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Build and Revision Numbers 34 | // by using the '*' as shown below: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.0.0.0")] 37 | [assembly: AssemblyFileVersion("1.0.0.0")] 38 | 39 | [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "SharedResourceDictionary.Shared")] -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/SharedResourceDictionary/SharedResourceDictionary.cs: -------------------------------------------------------------------------------- 1 | // /define:GLOBAL_USE_SHAREDRESOURCEDICTIONARY 2 | #define GLOBAL_USE_SHAREDRESOURCEDICTIONARY 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows; 9 | using System.ComponentModel; 10 | using System.Windows.Controls; 11 | using System.Windows.Media; 12 | using System.Windows.Markup; 13 | 14 | /* 15 | * This file has been created by ERGOSIGN GmbH - All rights reserved - http://www.ergosign.de 16 | * DO NOT ALTER OR REMOVE THIS COPYRIGHT NOTICE OR THIS FILE HEADER. 17 | * 18 | * This file and the code contained in it are subject to the agreed contractual terms and conditions, 19 | * in particular with regard to resale and publication. 20 | */ 21 | namespace SharedResourceDictionary.Shared 22 | { 23 | /// 24 | /// 25 | /// Shared dictionary, load resources only once :-). 26 | /// 27 | /// 28 | /// 29 | /// Class history: 30 | /// 31 | /// 32 | /// 0.1: First release, working (David C. Thoemmes, André Lanninger). 33 | /// 34 | /// 35 | /// 36 | /// 37 | /// Author: David C. Thoemmes 38 | /// Date: 11.05.2011 39 | /// 40 | public class SharedResourceDictionary : ResourceDictionary 41 | { 42 | #if GLOBAL_USE_SHAREDRESOURCEDICTIONARY 43 | /// 44 | /// Dictionary for caching. 45 | /// 46 | private static Dictionary SharedDictionaries = new Dictionary(); 47 | 48 | /// 49 | /// Our shared uri. 50 | /// 51 | private Uri sharedSourceURI; 52 | 53 | /// 54 | /// Define new implementation of source property. 55 | /// 56 | public new Uri Source 57 | { 58 | get { return sharedSourceURI; } 59 | 60 | set 61 | { 62 | // Maybe implement lock 63 | if (sharedSourceURI == value) 64 | return; 65 | 66 | sharedSourceURI = value; 67 | 68 | if (!SharedDictionaries.ContainsKey(value)) 69 | { 70 | // Set as source of this rd 71 | base.Source = value; 72 | SharedDictionaries.Add(value, this); 73 | } 74 | else 75 | { 76 | MergedDictionaries.Add(SharedDictionaries[value]); 77 | } 78 | } 79 | } 80 | #endif 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Solutions/UnchainedShowcase/0-1/SharedResourceDictionary/SharedResourceDictionary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {00CB9908-5995-431F-82D7-50F7ADFBE2D4} 9 | Library 10 | Properties 11 | SharedResourceDictionary 12 | SharedResourceDictionary 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | TRACE;DEBUG 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 62 | --------------------------------------------------------------------------------