Browse Source

Merge 839c523eea into cb3f9e1972

pull/1263/merge
Alexej Liebenthal 9 years ago
committed by GitHub
parent
commit
fb3ca024bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 63
      .gitattributes
  2. 261
      .gitignore
  3. 91
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.cs.txt
  4. 213
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.txt
  5. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.cs.txt
  6. 131
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.txt
  7. 122
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.cs.txt
  8. 137
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.txt
  9. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt
  10. 40
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt
  11. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt
  12. 182
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt
  13. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt
  14. 171
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt
  15. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt
  16. 137
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt
  17. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt
  18. 171
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt
  19. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt
  20. 159
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt
  21. 159
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt
  22. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.cs.txt
  23. 200
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.txt
  24. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt
  25. 1099
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt
  26. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.cs.txt
  27. 171
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.txt
  28. 76
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialCheckBoxView.xaml.txt
  29. 142
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialComboBoxView.xaml.txt
  30. 121
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.cs.txt
  31. 923
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.txt
  32. 41
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDemoView.cs.txt
  33. 151
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDropDownView.xaml.txt
  34. 159
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialFrameView.xaml.txt
  35. 64
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.cs.txt
  36. 604
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.txt
  37. 124
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialListBoxView.xaml.txt
  38. 27
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.cs.txt
  39. 191
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.txt
  40. 27
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarView.xaml.cs.txt
  41. 157
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarView.xaml.txt
  42. 64
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialRadioButtonView.xaml.txt
  43. 280
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialSliderView.xaml.txt
  44. 101
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialSwitchView.xaml.txt
  45. 229
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialTabsView.xaml.txt
  46. 216
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialTextFieldView.xaml.txt
  47. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToastView.xaml.cs.txt
  48. 271
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToastView.xaml.txt
  49. 62
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToolTipView.xaml.txt
  50. 88
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiCalendarView.xaml.cs.txt
  51. 775
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiCalendarView.xaml.txt
  52. 23
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.cs.txt
  53. 134
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.txt
  54. 116
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.cs.txt
  55. 320
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.txt
  56. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt
  57. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.cs.txt
  58. 55
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.txt
  59. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefaultEditorsView.xaml.cs.txt
  60. 20
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.cs.txt
  61. 18
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.txt
  62. 91
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.cs.txt
  63. 29
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.txt
  64. 48
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.cs.txt
  65. 107
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.txt
  66. 161
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridExpandingNonPrimitivesView.xaml.cs.txt
  67. 47
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridExpandingNonPrimitivesView.xaml.txt
  68. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.cs.txt
  69. 33
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.txt
  70. 49
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.cs.txt
  71. 49
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.txt
  72. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.cs.txt
  73. 69
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.txt
  74. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.cs.txt
  75. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.txt
  76. 23
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.cs.txt
  77. 1019
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.txt
  78. 33
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.cs.txt
  79. 432
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.txt
  80. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RichTextboxView.xaml.cs.txt
  81. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RichTextboxView.xaml.txt
  82. 22
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SlideShowView.xaml.cs.txt
  83. 204
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SlideShowView.xaml.txt
  84. 60
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StyleableWindowView.xaml.cs.txt
  85. 39
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StyleableWindowView.xaml.txt
  86. 466
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.cs.txt
  87. 828
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.txt
  88. 139
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.cs.txt
  89. 359
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt
  90. 150
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.cs.txt
  91. 1016
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt
  92. 87
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.cs.txt
  93. 553
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt
  94. 97
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt
  95. 519
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt
  96. 144
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.cs.txt
  97. 366
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt
  98. 523
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ToggleSwitchView.xaml.txt
  99. 89
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TokenizedTextBoxView.xaml.cs.txt
  100. 321
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TokenizedTextBoxView.xaml.txt

63
.gitattributes

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

261
.gitignore

@ -0,0 +1,261 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

91
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.cs.txt

@ -14,9 +14,6 @@
************************************************************************************/ ************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System; using System;
@ -29,119 +26,33 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
/// </summary> /// </summary>
public partial class ChartAxisView : DemoView public partial class ChartAxisView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private static DataPointsList<DataPoint> _numericDataPoints = new DataPointsList<DataPoint>()
{ new DataPoint(1, 1)
, new DataPoint(2, 2)
, new DataPoint(1.5, 3)
, new DataPoint(5, 3.5)
};
private static DataPointsList<DataPoint> _dateTimeDataPoints = new DataPointsList<DataPoint>()
{
new DataPoint( new System.DateTime( 2000, 1, 1 ).ToOADate(), 1 )
, new DataPoint( new System.DateTime( 2001, 1, 1 ).ToOADate(), 2 )
, new DataPoint( new System.DateTime( 2002, 5, 5 ).ToOADate(), 4 )
, new DataPoint( new System.DateTime( 2003, 1, 1 ).ToOADate(), 3 )
};
private static DataPointsList<DataPoint> _labelsDataPoints = new DataPointsList<DataPoint>()
{
new DataPoint( 0, 5, "Zeus" )
, new DataPoint( 0, 2, "Poseidon" )
, new DataPoint( 0, 3, "Hades" )
, new DataPoint( 0, 4, "Hestia" )
, new DataPoint( 0, 1, "Hera" )
};
#endregion
#region Dependency Properties
public static readonly DependencyProperty SelectedAxisProperty = DependencyProperty.Register(
"SelectedAxis",
typeof( Axis ),
typeof( ChartAxisView ),
new UIPropertyMetadata( null ) );
#endregion
#region Properties
public Axis SelectedAxis
{
get
{
return ( Axis )GetValue( SelectedAxisProperty );
}
set
{
SetValue( SelectedAxisProperty, value );
}
}
#endregion
#endif
#region Initialization #region Initialization
public ChartAxisView() public ChartAxisView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_axisComboBox.SelectedIndex = 0;
_xAxis.DateTimeFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region Event Handlers
private void OnAxisComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = ( ComboBox )sender;
this.SelectedAxis = ( comboBox.SelectedIndex == 0 ) ? _xAxis : _yAxis;
}
private void OnAxisLabelsTypeChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = ( ComboBox )sender;
switch( (LabelsType)comboBox.SelectedItem )
{
case LabelsType.Numeric:
this.SetSeriesDataPoints( _numericDataPoints );
break;
case LabelsType.DateTime:
this.SetSeriesDataPoints( _dateTimeDataPoints );
break;
case LabelsType.Labels :
this.SetSeriesDataPoints( _labelsDataPoints );
this.SelectedAxis.GraduationMode = AxisGraduationMode.Manual;
break;
}
}
#endregion
#endif
#region Implementation #region Implementation
#if !OPEN_SOURCE
private void SetSeriesDataPoints( DataPointsList<DataPoint> list )
{
if( _series != null )
{
_series.DataPoints.Clear();
foreach( DataPoint dataPoint in list )
_series.DataPoints.Add( dataPoint );
}
}
#endif
#endregion #endregion
} }
} }

213
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartAxisView.xaml.txt

@ -25,212 +25,29 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The chart's Axis class represents the x- and y-axis of an area (Area class) in a chart. They can be individually configured with many properties.</Run> <Run>The chart's Axis class represents the x- and y-axis of an area (Area class) in a chart. They can be individually configured with many properties.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ObjectDataProvider x:Key="AxisLabelsType" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:LabelsType" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AxisGraduationMode" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:AxisGraduationMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AxisScaleMode" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:AxisScaleMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AxisLabelLayout" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:AxisLabelLayout" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<x:Array x:Key="AxisArray" Type="sys:String">
<sys:String>X Axis</sys:String>
<sys:String>Y Axis</sys:String>
</x:Array>
<conv:GraduationModeToComboBoxConverter x:Key="GraduationModeToComboBoxConverter" />
<conv:LabelsTypeToPropertyEnabledConverter x:Key="LabelsTypeToPropertyEnabledConverter" />
<conv:ScaleModeToPropertyEnabledConverter x:Key="ScaleModeToPropertyEnabledConverter" />
<conv:AxesLabelsTypePropertyEnabledConverter x:Key="AxesLabelsTypePropertyEnabledConverter" />
<sys:String x:Key="AxisLabelsLayoutTooltip">
Resize the window along the orientation of the selected axis to see all labels (staggered) or only the ones that fit (every second, third label, etc., is omitted).
</sys:String>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="3">
<Grid Margin="3" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column -->
<TextBlock Text="Axis: " VerticalAlignment="Center" FontWeight="Bold" FontSize="13"/>
<ComboBox x:Name="_axisComboBox" FontWeight="Bold" FontSize="13" Grid.Column="1" ItemsSource="{StaticResource AxisArray}" SelectionChanged="OnAxisComboBoxSelectionChanged" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3"/>
<TextBlock Text="Labels Type: " Grid.Row="1" VerticalAlignment="Center" />
<ComboBox x:Name="_labelsType" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AxisLabelsType}}" SelectedItem="{Binding SelectedAxis.LabelsType, ElementName=_demo}" SelectionChanged="OnAxisLabelsTypeChanged" IsEnabled="{Binding SelectedIndex, ElementName=_axisComboBox, Converter={StaticResource AxesLabelsTypePropertyEnabledConverter}}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Graduation Mode: " Grid.Row="2" VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_graduationMode}" />
<ComboBox x:Name="_graduationMode" Grid.Row="2" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AxisGraduationMode}}" Width="100" IsEnabled="{Binding SelectedItem, ElementName=_labelsType, Converter={StaticResource LabelsTypeToPropertyEnabledConverter}, ConverterParameter=0}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3">
<ComboBox.SelectedItem>
<MultiBinding Converter="{StaticResource GraduationModeToComboBoxConverter}" >
<Binding Path="SelectedAxis.GraduationMode" ElementName="_demo" />
<Binding Path="SelectedAxis.LabelsType" ElementName="_demo" />
</MultiBinding>
</ComboBox.SelectedItem>
</ComboBox>
<TextBlock Text="Scale Mode: " Grid.Row="3" VerticalAlignment="Center" />
<ComboBox x:Name="_scaleMode" Grid.Row="3" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AxisScaleMode}}" SelectedItem="{Binding SelectedAxis.ScaleMode, ElementName=_demo}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Custom Range Start: " Grid.Row="4" VerticalAlignment="Center" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown x:Name="_customRangeStart" Grid.Row="4" Grid.Column="1" Minimum="0" Maximum="{Binding Value, ElementName=_customRangeEnd}" Value="{Binding SelectedAxis.CustomRangeStart, ElementName=_demo}" Width="100" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Custom Range End: " Grid.Row="5" VerticalAlignment="Center" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown x:Name="_customRangeEnd" Grid.Row="5" Grid.Column="1" Minimum="{Binding Value, ElementName=_customRangeStart}" Maximum="100" Value="{Binding SelectedAxis.CustomRangeEnd, ElementName=_demo}" Width="100" IsEnabled="{Binding SelectedItem, ElementName=_scaleMode, Converter={StaticResource ScaleModeToPropertyEnabledConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Label Decimal Count: " Grid.Row="6" VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_labelDecimalCount}" Style="{StaticResource DisableGrayText}"/>
<ComboBox x:Name="_labelDecimalCount" Grid.Row="6" Grid.Column="1" SelectedValue="{Binding SelectedAxis.LabelDecimalCount, ElementName=_demo}" SelectedValuePath="Tag" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" IsEnabled="{Binding SelectedItem, ElementName=_labelsType, Converter={StaticResource LabelsTypeToPropertyEnabledConverter}, ConverterParameter=1}" Margin="3" ToolTip="Gets/sets the decimal count on labels when GraduationMode is Numeric.">
<ComboBoxItem Content="Null" Tag="{x:Null}"/>
<ComboBoxItem Content="0" Tag="0"/>
<ComboBoxItem Content="1" Tag="1"/>
<ComboBoxItem Content="2" Tag="2"/>
<ComboBoxItem Content="3" Tag="3"/>
<ComboBoxItem Content="4" Tag="4"/>
</ComboBox>
<!-- 2nd column -->
<TextBlock Text="Title: " Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<TextBox Grid.Column="3" Text="{Binding SelectedAxis.Title, ElementName=_demo, UpdateSourceTrigger=PropertyChanged}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Title Margin: " Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="1" Grid.Column="3" Minimum="0" Maximum="100" Value="{Binding SelectedAxis.TitleMargin, ElementName=_demo}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Axis Labels Layout: " Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<ComboBox Grid.Row="2" Grid.Column="3" ItemsSource="{Binding Source={StaticResource AxisLabelLayout}}" SelectedItem="{Binding SelectedAxis.AxisLabelsLayout, ElementName=_demo}" ToolTip="{StaticResource AxisLabelsLayoutTooltip}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Ticks Count: " Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="3" Grid.Column="3" Minimum="0" Maximum="100" Value="{Binding SelectedAxis.TicksCount, ElementName=_demo}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Reversed: " Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="4" Grid.Column="3" IsChecked="{Binding SelectedAxis.Reversed, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="IntersectMinValue: " Grid.Row="5" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="5" Grid.Column="3" IsChecked="{Binding SelectedAxis.IntersectMinValue, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" ToolTip="Gets/Sets if the axis intersects the other axis at other axis minimim value."/>
<!-- 3rd column -->
<TextBlock Text="Show Arrow: " Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowArrow, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Show Axis: " Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="1" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowAxis, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Show Grid Lines: " Grid.Row="2" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="2" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowGridLines, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Show Ticks: " Grid.Row="3" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="3" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowTicks, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Show Tick Labels: " Grid.Row="4" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="4" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowTickLabels, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
<TextBlock Text="Show Axis Label: " Grid.Row="5" Grid.Column="4" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Row="5" Grid.Column="5" IsChecked="{Binding SelectedAxis.ShowAxisLabel, ElementName=_demo}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="3" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10"/>
<xctk:Chart Grid.Row="2" MinHeight="200" ShowLegend="False">
<xctk:Chart.Areas>
<xctk:Area Title="Area #1">
<xctk:Area.XAxis>
<xctk:Axis x:Name="_xAxis"
LabelsType="Numeric"
GraduationMode="Automatic"
TicksCount="10"
ScaleMode="Automatic"
CustomRangeStart="0"
CustomRangeEnd="10"
Title="X Axis"
TitleMargin="10"
AxisLabelsLayout="ShowAll"
ShowArrow="False"
ShowAxis="True"
ShowGridLines="True"
ShowTicks="True"
ShowTickLabels="True"
ShowAxisLabel="True"
Reversed="False"
IntersectMinValue="True"
LabelDecimalCount="{x:Null}"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis x:Name="_yAxis"
LabelsType="Numeric"
GraduationMode="Automatic"
TicksCount="10"
ScaleMode="Automatic"
CustomRangeStart="0"
CustomRangeEnd="10"
Title="Y Axis"
TitleMargin="10"
AxisLabelsLayout="ShowAll"
ShowArrow="False"
ShowAxis="True"
ShowGridLines="True"
ShowTicks="True"
ShowTickLabels="True"
ShowAxisLabel="True"
Reversed="False"
IntersectMinValue="True"
LabelDecimalCount="{x:Null}" />
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series x:Name="_series"
DefaultInterior="Red">
<xctk:Series.Layout>
<xctk:ColumnLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartAxis.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartAxis.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.cs.txt

@ -14,9 +14,6 @@
**************************************************************************************/ **************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Diagnostics; using System.Diagnostics;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views

131
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartLegendView.xaml.txt

@ -28,135 +28,24 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>A legend can be moved around, resized, and docked. Please note that a legend can be resized only when its Dock property is set to Float and if the AllowResize property is set to true.</Run> <Run>A legend can be moved around, resized, and docked. Please note that a legend can be resized only when its Dock property is set to Float and if the AllowResize property is set to true.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ObjectDataProvider x:Key="LegendDock" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:LegendDock" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Dock: " VerticalAlignment="Center" />
<ComboBox Grid.Column="1" ItemsSource="{Binding Source={StaticResource LegendDock}}" SelectedItem="{Binding Dock, ElementName=_legend}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Title: " Grid.Row="1" VerticalAlignment="Center" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Title, ElementName=_legend, UpdateSourceTrigger=PropertyChanged}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column-->
<TextBlock Text="Allow Resize: " Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox Grid.Column="3" IsChecked="{Binding AllowResize, ElementName=_legend}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Allow Move: " Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"/>
<CheckBox x:Name="_allowMove" Grid.Row="1" Grid.Column="3" IsChecked="{Binding AllowMove, ElementName=_legend}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!--3rd column-->
<TextBlock Text="Allow Dock: " Grid.Column="4" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=_allowMove}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<CheckBox Grid.Column="5" IsChecked="{Binding AllowDock, ElementName=_legend}" IsEnabled="{Binding IsChecked, ElementName=_allowMove}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10"/>
<xctk:Chart Grid.Row="2" MinHeight="350">
<xctk:Chart.Legend>
<xctk:Legend x:Name="_legend"
Dock="Left"
AllowResize="True"
AllowDock="True"
AllowMove="True"
Title="Legend"/>
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area Title="Wins/month">
<xctk:Area.XAxis>
<xctk:Axis ShowAxisLabel="False" ShowTickLabels="False" ShowTicks="False"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis ShowAxisLabel="False" ShowTickLabels="False" ShowTicks="False"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series Title="Months"
DefaultInterior="Green"
ShowPointsInLegend="True"
ShowHintLabels="True">
<xctk:Series.Layout>
<xctk:PieLayout />
</xctk:Series.Layout>
<xctk:Series.DataPoints>
<xctk:DataPoint X="6" Y="6" Label="Jan" />
<xctk:DataPoint X="7" Y="7" Label="Feb"/>
<xctk:DataPoint X="4" Y="4" Label="Mar" />
<xctk:DataPoint X="2" Y="2" Label="Apr"/>
</xctk:Series.DataPoints>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
<xctk:Area Title="Goals/player">
<xctk:Area.XAxis>
<xctk:Axis Title="Player's Name" LabelsType="Labels" GraduationMode="Manual"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Title="Goals" AxisLabelsLayout="ShowToFit"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series Title="Players"
DefaultInterior="Orange">
<xctk:Series.Layout>
<xctk:ColumnLayout />
</xctk:Series.Layout>
<xctk:Series.DataPoints>
<xctk:DataPoint Y="36" Label="Tom" />
<xctk:DataPoint Y="7" Label="Steven"/>
<xctk:DataPoint Y="24" Label="Kirk" />
<xctk:DataPoint Y="12" Label="Erik"/>
<xctk:DataPoint Y="10" Label="Scott"/>
</xctk:Series.DataPoints>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartLegend.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartLegend.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

122
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.cs.txt

@ -14,9 +14,6 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows; using System.Windows;
using Xceed.Wpf.Toolkit.Panels; using Xceed.Wpf.Toolkit.Panels;
@ -29,16 +26,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
/// </summary> /// </summary>
public partial class ChartSeriesBasicTypesView : DemoView public partial class ChartSeriesBasicTypesView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Series _columnSeries;
private Series _lineSeries;
private Series _pieSeries;
private Series _areaSeries;
#endregion
#endif
#region Initialization #region Initialization
@ -49,126 +38,15 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
#endregion #endregion
#if !OPEN_SOURCE
#region Envent Handlers
private void OnSeriesCollectionChecked( object sender, RoutedEventArgs e )
{
this.AddDefaultSeries();
}
private void OnSeriesCollectionUnchecked( object sender, RoutedEventArgs e )
{
this.CleanDefaultSeries();
}
private void OnLayoutSelectionChanged( object sender, RoutedEventArgs e )
{
if( _seriesCollectionCheckBox.IsChecked.HasValue && _seriesCollectionCheckBox.IsChecked.Value )
{
this.CleanDefaultSeries();
this.AddDefaultSeries();
}
}
#endregion
#endif
#region Implementation #region Implementation
#if !OPEN_SOURCE
private void CleanDefaultSeries()
{
if( _area1.Series.Contains( _pieSeries ) )
{
_area1.Series.Remove( _pieSeries );
}
if( _area1.Series.Contains( _areaSeries ) )
{
_area1.Series.Remove( _areaSeries );
}
if( _area1.Series.Contains( _columnSeries ) )
{
_area1.Series.Remove( _columnSeries );
}
if( _area1.Series.Contains( _lineSeries ) )
{
_area1.Series.Remove( _lineSeries );
}
}
private void AddDefaultSeries()
{
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Pie )
{
if( _pieSeries == null )
{
//init pieSeries
_pieSeries = new Series();
_pieSeries.DataPoints.Add( new DataPoint( 0, 1, "Cars" ) );
_pieSeries.DataPoints.Add( new DataPoint( 1, 2, "Toys" ) );
_pieSeries.DataPoints.Add( new DataPoint( 2, 2.5, "Trees" ) );
_pieSeries.DataPoints.Add( new DataPoint( 3, 4, "Pens" ) );
_pieSeries.Layout = new PieLayout();
_pieSeries.Title = "Pie Series";
_pieSeries.ShowPointsInLegend = true;
_pieSeries.DefaultInterior = Brushes.YellowGreen;
}
_area1.Series.Add( _pieSeries );
}
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Area )
{
if( _areaSeries == null )
{
//init areaSeries
_areaSeries = new Series();
_areaSeries.DataPoints.Add( new DataPoint( -2, 0 ) );
_areaSeries.DataPoints.Add( new DataPoint( 0, 3.5 ) );
_areaSeries.DataPoints.Add( new DataPoint( 3, 1 ) );
_areaSeries.DataPoints.Add( new DataPoint( 5, 2.8 ) );
_areaSeries.DataPoints.Add( new DataPoint( 4, 1.5 ) );
_areaSeries.Layout = new AreaLayout();
_areaSeries.Title = "Area Series";
_areaSeries.DefaultInterior = Brushes.Orange;
}
_area1.Series.Add( _areaSeries );
}
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Column )
{
if( _columnSeries == null )
{
//init columnSeries
_columnSeries = new Series();
_columnSeries.DataPoints.Add( new DataPoint( 1, 1 ) );
_columnSeries.DataPoints.Add( new DataPoint( 2, 2 ) );
_columnSeries.DataPoints.Add( new DataPoint( 2.5, 4 ) );
_columnSeries.DataPoints.Add( new DataPoint( 4, 3 ) );
_columnSeries.Title = "Column Series";
_columnSeries.DefaultInterior = Brushes.Red;
}
_area1.Series.Add( _columnSeries );
}
if( _series.Layout.LayoutType != PredefinedLayoutTypes.Line )
{
if( _lineSeries == null )
{
//init lineSeries
_lineSeries = new Series();
_lineSeries.DataPoints.Add( new DataPoint( 1, 1 ) );
_lineSeries.DataPoints.Add( new DataPoint( 2, 1 ) );
_lineSeries.DataPoints.Add( new DataPoint( 0.5, 1.5 ) );
_lineSeries.DataPoints.Add( new DataPoint( 3, 3 ) );
_lineSeries.DataPoints.Add( new DataPoint( 6, 2 ) );
_lineSeries.DataPoints.Add( new DataPoint( 5, 0.5 ) );
_lineSeries.Layout = new LineLayout();
_lineSeries.Title = "Line Series";
_lineSeries.DefaultInterior = Brushes.Black;
}
_area1.Series.Add( _lineSeries );
}
}
#endif
#endregion #endregion
} }

137
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesBasicTypesView.xaml.txt

@ -25,139 +25,26 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>A series contains DataPoint objects and are layed out in an area (Area class) of a chart. They can be displayed with predefined layouts, such as column (bar), line, area, or pie, or they can be displayed using a custom layout (not implemented in this sample).</Run> <Run>A series contains DataPoint objects and are layed out in an area (Area class) of a chart. They can be displayed with predefined layouts, such as column (bar), line, area, or pie, or they can be displayed using a custom layout (not implemented in this sample).</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ObjectDataProvider x:Key="SeriesLayout" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:PredefinedLayoutTypes" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<conv:LayoutEngineToPredefinedLayoutConverter x:Key="LayoutEngineToPredefinedLayoutConverter" />
<conv:PredefinedLayoutToPropertyEnabledConverter x:Key="PredefinedLayoutToPropertyEnabledConverter" />
<conv:LineLengthToPropertyEnabledConverter x:Key="LineLengthToPropertyEnabledConverter" />
<xctkconv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<Style x:Key="ComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding}" Value="Custom">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Layout: " VerticalAlignment="Center" />
<ComboBox x:Name="_layoutComboBox" Grid.Column="1" SelectedValue="{Binding Layout, ElementName=_series, Converter={StaticResource LayoutEngineToPredefinedLayoutConverter}}" SelectedValuePath="Content" ItemContainerStyle="{StaticResource ComboBoxItemStyle}" SelectionChanged="OnLayoutSelectionChanged" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5">
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Area}" />
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Column}" />
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Line}" />
<ComboBoxItem Content="{x:Static xctk:PredefinedLayoutTypes.Pie}" />
</ComboBox>
<TextBlock Grid.Row="1" Text="Title: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_title}"/>
<TextBox x:Name="_title" Grid.Row="1" Grid.Column="1" Text="{Binding Title, ElementName=_series, UpdateSourceTrigger=PropertyChanged}" Width="75" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=title}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Grid.Row="2" Text="Default Interior: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_defaultInterior}"/>
<xctk:ColorPicker x:Name="_defaultInterior" Grid.Row="2" Grid.Column="1" SelectedColor="{Binding DefaultInterior, ElementName=_series, Converter={StaticResource SolidColorBrushToColorConverter}}" Width="75" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=defaultInterior}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column-->
<TextBlock Grid.Column="2" Text="Show Hint Labels: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_showHintLabels}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<CheckBox x:Name="_showHintLabels" Grid.Column="3" IsChecked="{Binding ShowHintLabels, ElementName=_series}" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=showHintLabels}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="Show Points in Legend: " IsEnabled="{Binding IsEnabled, ElementName=_showPointsInLegend}" VerticalAlignment="Center" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<CheckBox x:Name="_showPointsInLegend" Grid.Row="1" Grid.Column="3" IsChecked="{Binding ShowPointsInLegend, ElementName=_series}" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=showPointsInLegend}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 3rd column-->
<TextBlock Grid.Column="4" Text="Hint Line Length: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_hintLineLength}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<xctk:IntegerUpDown x:Name="_hintLineLength" Grid.Column="5" Minimum="0" Maximum="200" Value="{Binding HintLineLength, ElementName=_series}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5">
<xctk:IntegerUpDown.IsEnabled>
<MultiBinding Converter="{StaticResource LineLengthToPropertyEnabledConverter}">
<Binding Path="SelectedItem" ElementName="_layoutComboBox" Converter="{StaticResource PredefinedLayoutToPropertyEnabledConverter}" ConverterParameter="hintLineLength" />
<Binding Path="IsChecked" ElementName="_showHintLabels" />
</MultiBinding>
</xctk:IntegerUpDown.IsEnabled>
</xctk:IntegerUpDown>
<TextBlock Grid.Row="1" Grid.Column="4" Text="Spacing: " VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=_spacing}" Margin="10,0,0,0" Style="{StaticResource DisableGrayText}"/>
<xctk:IntegerUpDown x:Name="_spacing" Grid.Row="1" Grid.Column="5" Minimum="0" Maximum="100" Value="{Binding Spacing, ElementName=_series}" Width="75" IsEnabled="{Binding SelectedItem, ElementName=_layoutComboBox, Converter={StaticResource PredefinedLayoutToPropertyEnabledConverter}, ConverterParameter=spacing}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10"/>
<xctk:Chart Grid.Row="2" MinHeight="200">
<xctk:Chart.Areas>
<xctk:Area x:Name="_area1" Title="Area #1">
<xctk:Area.Series>
<xctk:Series x:Name="_series"
DefaultInterior="BlueViolet"
Spacing="20"
Title="Average"
ShowPointsInLegend="false"
ShowHintLabels="false"
HintLineLength="20">
<xctk:Series.Layout>
<xctk:LineLayout />
</xctk:Series.Layout>
<xctk:Series.DataPoints>
<xctk:DataPoint X="1" Y="1" Label="Oct" />
<xctk:DataPoint X="2" Y="2" Label="Jan"/>
<xctk:DataPoint X="2.5" Y="1.5" Label="Feb" />
<xctk:DataPoint X="4" Y="1" Label="Jun"/>
<xctk:DataPoint X="1.5" Y="3" Label="Dec"/>
<xctk:DataPoint X="5" Y="5" Label="Apr"/>
<xctk:DataPoint X="3" Y="1" Label="Nov"/>
<xctk:DataPoint X="4.5" Y="7" Label="Jul"/>
<xctk:DataPoint X="3.5" Y="4.5" Label="Aug"/>
</xctk:Series.DataPoints>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
<TextBlock Grid.Row="3" Text="A collection of Series instances can be added to an Area. Use the following Checkbox to display 3 new Series along with the current one." TextWrapping="Wrap" Margin="0,15,0,5" />
<CheckBox Grid.Row="4" x:Name="_seriesCollectionCheckBox" IsChecked="False" Checked="OnSeriesCollectionChecked" Unchecked="OnSeriesCollectionUnchecked" Content="Display 4 Series in one Area" Margin="0,0,0,10" />
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartBasicTypes.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartBasicTypes.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.cs.txt

@ -14,9 +14,6 @@
************************************************************************************/ ************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;

40
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartSeriesDataPointsBindingView.xaml.txt

@ -26,57 +26,17 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The DataPoint objects of a chart's series can be set by binding with the Series.DataPointsSource property. From there, a DataPointBinding can be set on the X, Y, or Label property of a DataPoint.</Run> <Run>The DataPoint objects of a chart's series can be set by binding with the Series.DataPointsSource property. From there, a DataPointBinding can be set on the X, Y, or Label property of a DataPoint.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xced Toolkit Plus for WPF. Click here for more details about Xced Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<sample:Persons x:Key="Persons"/>
<CollectionViewSource x:Key="PersonCollection" Source="{Binding Source={StaticResource Persons}, Path=PersonList}" />
</local:DemoView.Resources>
<Grid Margin="10">
<xctk:Chart MinHeight="300" ShowLegend="False">
<xctk:Chart.Areas>
<xctk:Area>
<xctk:Area.XAxis>
<xctk:Axis Title="Persons" GraduationMode="Manual" LabelsType="Labels"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Title="Skill Level" />
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series DataPointsSource="{Binding Source={StaticResource PersonCollection}}">
<xctk:Series.DataPointBindings>
<xctk:BindingInfo PropertyName="Y">
<xctk:BindingInfo.Binding>
<Binding Path="Skill"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
<xctk:BindingInfo PropertyName="Label">
<xctk:BindingInfo.Binding>
<Binding Path="Name"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
</xctk:Series.DataPointBindings>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartSeriesDataPointsBinding.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartSeriesDataPointsBinding.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.cs.txt

@ -14,9 +14,6 @@
************************************************************************************/ ************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System; using System;

182
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingAxesGridView.xaml.txt

@ -24,178 +24,32 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample shows how AxesGrid elements can be styled using a DataTemplate.</Run> <Run>This sample shows how AxesGrid elements can be styled using a DataTemplate.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<DataTemplate x:Key="BackgroundTemplate">
<Rectangle Margin="-5,-5,-5,-5" RadiusX="25" RadiusY="25" StrokeThickness="3" Stroke="Blue" Fill="#FFFFE1">
<Rectangle.BitmapEffect>
<DropShadowBitmapEffect/>
</Rectangle.BitmapEffect>
</Rectangle>
</DataTemplate>
<DataTemplate x:Key="AxisTitleTemplate">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius="4">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="SkyBlue" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<TextBlock FontFamily="Comic Sans MS" FontSize="18" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Black"/>
</TextBlock.Foreground>
</TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="GridTemplateX">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="1" Stroke="Red" StrokeDashArray="1 5 1 1" />
</Canvas>
</DataTemplate>
<DataTemplate x:Key="GridTemplateY">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="1" Stroke="Green" StrokeDashArray="8 3 1 3"/>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="TickTemplateX">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Line X1="{Binding Path=XStart}" Y1="{Binding Path=YStart}" X2="{Binding Path=XEnd}" Y2="{Binding Path=YEnd}" StrokeThickness="5" Stroke="Red"/>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="TickTemplateY">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Line X1="{Binding Path=XStart}" Y1="{Binding Path=YStart}" X2="{Binding Path=XEnd}" Y2="{Binding Path=YEnd}" StrokeThickness="5" Stroke="Green"/>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="ArrowTemplate">
<Polyline Points="{Binding Path=Points}"
StrokeThickness="2" Stroke="Blue"/>
</DataTemplate>
<DataTemplate x:Key="LabelTemplateX">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius="4">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="Red" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<TextBlock FontFamily="Comic Sans MS" FontSize="18" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Black"/>
</TextBlock.Foreground>
</TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="LabelTemplateY">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius ="4">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="LimeGreen" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<TextBlock FontFamily="Comic Sans MS" FontSize="18" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Black"/>
</TextBlock.Foreground>
</TextBlock>
</Border>
</DataTemplate>
<DataTemplate x:Key="AxisTemplate">
<Polyline Points="{Binding Path=Points}"
StrokeThickness="2" Stroke="Blue"/>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="300" ShowLegend="False">
<xctk:Chart.Areas>
<xctk:Area BackgroundTemplate="{StaticResource BackgroundTemplate}" Margin="25,25,25,25">
<xctk:Area.XAxis>
<xctk:Axis AxisTitleTemplate="{StaticResource AxisTitleTemplate}"
GridTemplate="{StaticResource GridTemplateX}"
TickTemplate="{StaticResource TickTemplateX}"
ArrowTemplate="{StaticResource ArrowTemplate}"
LabelTemplate="{StaticResource LabelTemplateX}">
<xctk:Axis.Template>
<ControlTemplate TargetType="{x:Type xctk:Axis}">
<ContentPresenter ContentTemplate="{StaticResource AxisTemplate}"/>
</ControlTemplate>
</xctk:Axis.Template>
<xctk:Axis.Arrow>
<xctk:Arrow Length="20" Thickness="10"/>
</xctk:Axis.Arrow>
</xctk:Axis>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Reversed="true"
AxisTitleTemplate="{StaticResource AxisTitleTemplate}"
GridTemplate="{StaticResource GridTemplateY}"
TickTemplate="{StaticResource TickTemplateY}"
ArrowTemplate="{StaticResource ArrowTemplate}"
LabelTemplate="{StaticResource LabelTemplateY}">
<xctk:Axis.Template>
<ControlTemplate TargetType="{x:Type xctk:Axis}">
<ContentPresenter ContentTemplate="{StaticResource AxisTemplate}"/>
</ControlTemplate>
</xctk:Axis.Template>
<xctk:Axis.Arrow>
<xctk:Arrow Length="20" Thickness="10"/>
</xctk:Axis.Arrow>
</xctk:Axis>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series>
<xctk:Series.DataPoints>
<xctk:DataPoint X="1" Y="1" />
<xctk:DataPoint X="2" Y="3"/>
<xctk:DataPoint X="3" Y="2"/>
<xctk:DataPoint X="4" Y="5"/>
<xctk:DataPoint X="5" Y="4"/>
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:LineLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingAxesGrid.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingAxesGrid.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.cs.txt

@ -14,9 +14,6 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System.Diagnostics; using System.Diagnostics;

171
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingColumnSeriesView.xaml.txt

@ -25,175 +25,26 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample shows how a series with a column layout type and a legend can be styled using DataTemplates.</Run> <Run>This sample shows how a series with a column layout type and a legend can be styled using DataTemplates.</Run>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move mouse on line and markers to see simple effects.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<sample:Persons x:Key="persons"/>
<CollectionViewSource x:Key="PersonCollection" Source="{Binding Source={StaticResource persons}, Path=PersonList}"/>
<DataTemplate x:Key="legendTemplate">
<DockPanel VerticalAlignment="Center">
<Image Source="{Binding Path=Photo}" Width="32" Height="32" Margin="5,1,1,1"/>
<TextBlock Text="{Binding Path=Name}" FontSize="11" VerticalAlignment="Center" Margin="5,1,2,1"/>
</DockPanel>
</DataTemplate>
<Style x:Key="TextBoxTextStyle" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="12"/>
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="FontSize" To="19" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="FontSize" To="12" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Height="{Binding Path=ActualHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}">
<Rectangle RadiusX="5" RadiusY="5" >
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Rectangle.Triggers>
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="Orange" Offset="0.25" />
<GradientStop Color="CornflowerBlue" Offset="0.75" />
<GradientStop Color="LimeGreen" Offset="1.0" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<ContentPresenter VerticalAlignment="Center" Content="{Binding Path=Content, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"/>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="seriesTemplate">
<Button x:Name="Bar">
<StackPanel>
<DockPanel>
<TextBlock Text="Name: " Style="{StaticResource TextBoxTextStyle}" />
<TextBlock Text="{Binding Path=Content.Name}" Style="{StaticResource TextBoxTextStyle}" />
</DockPanel>
<DockPanel>
<TextBlock Text="Skill: " Style="{StaticResource TextBoxTextStyle}" />
<TextBlock Text="{Binding Path=Content.Skill}" Style="{StaticResource TextBoxTextStyle}" />
</DockPanel>
<TextBlock Text="Photo:" Style="{StaticResource TextBoxTextStyle}"/>
<Image Source="{Binding Path=Content.Photo}"/>
</StackPanel>
</Button>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="400">
<xctk:Chart.Legend>
<xctk:Legend ItemTemplate="{StaticResource legendTemplate}" ItemsSource="{Binding Source={StaticResource PersonCollection}}" Title="Persons"/>
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area >
<xctk:Area.XAxis>
<xctk:Axis GraduationMode="Manual" LabelsType="Labels"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis Title="Skill"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series DataPointsSource="{Binding Source={StaticResource PersonCollection}}"
Template="{StaticResource seriesTemplate}"
ShowPointsInLegend="true">
<xctk:Series.DataPointBindings>
<xctk:BindingInfo PropertyName="X">
<xctk:BindingInfo.Binding>
<Binding Path="Age"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
<xctk:BindingInfo PropertyName="Y">
<xctk:BindingInfo.Binding>
<Binding Path="Skill"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
<xctk:BindingInfo PropertyName="Label">
<xctk:BindingInfo.Binding>
<Binding Path="Name"/>
</xctk:BindingInfo.Binding>
</xctk:BindingInfo>
</xctk:Series.DataPointBindings>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingColumnSeries.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingColumnSeries.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.cs.txt

@ -14,9 +14,6 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows; using System.Windows;
@ -34,16 +31,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Chart.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
#region Event Handler
private void LegendButtonClick( object sender, RoutedEventArgs e )
{
Random r = new Random();
_series.DataPoints.Add( new DataPoint( _series.DataPoints.Count, r.NextDouble() ) );
}
#endregion
#endif
} }
} }

137
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingLineSeriesView.xaml.txt

@ -24,144 +24,23 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample demonstrates how a series with a line layout type and a legend can be styled via DataTemplates. The legend contains a button to add new DataPoints.</Run> <Run>This sample demonstrates how a series with a line layout type and a legend can be styled via DataTemplates. The legend contains a button to add new DataPoints.</Run>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move mouse along the line and over the markers to see simple effects.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<DataTemplate x:Key="legendTemplate">
<DockPanel VerticalAlignment="Center">
<Path Width="32" Height="32" StrokeThickness="3" Data="M 0,24 Q 8,0 16,16 Q 24,32 32,8" >
<Path.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Green" Offset="1" />
<GradientStop Color="Yellow" Offset="0.5" />
<GradientStop Color="Red" Offset="0" />
</LinearGradientBrush>
</Path.Stroke>
</Path>
<TextBlock Text="{Binding Path=Text}" FontSize="11" VerticalAlignment="Center" Margin="5,1,2,1"/>
<Button Click="LegendButtonClick">Add DataPoint</Button>
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="seriesTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="10" >
<Polyline.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="StrokeThickness" To="20" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="StrokeThickness" To="10" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Polyline.Triggers>
<Polyline.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Green" Offset="1" />
<GradientStop Color="Yellow" Offset="0.75" />
<GradientStop Color="Red" Offset="0" />
</LinearGradientBrush>
</Polyline.Stroke>
</Polyline>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="markerTemplate">
<Ellipse Width="20" Height="20" >
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width" To="30" Duration="0:0:0.4"/>
<DoubleAnimation Storyboard.TargetProperty="Height" To="30" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width" To="20" Duration="0:0:0.4" />
<DoubleAnimation Storyboard.TargetProperty="Height" To="20" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Ellipse.Triggers>
<Ellipse.Fill>
<RadialGradientBrush Center="0.3, 0.3" RadiusX="0.6" RadiusY="0.6">
<GradientStop Color="LightBlue" Offset="0" />
<GradientStop Color="Blue" Offset="1" />
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="300">
<xctk:Chart.Legend>
<xctk:Legend ItemTemplate="{StaticResource legendTemplate}"/>
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area Title="Area1">
<xctk:Area.Series>
<xctk:Series x:Name="_series"
Title="Average/Month"
Template="{StaticResource seriesTemplate}"
MarkerTemplate="{StaticResource markerTemplate}">
<xctk:Series.DataPoints>
<xctk:DataPoint X="0" Y="0" />
<xctk:DataPoint X="1" Y="0.1" />
<xctk:DataPoint X="2" Y="0.3" />
<xctk:DataPoint X="3" Y="0.5" />
<xctk:DataPoint X="4" Y="0.88" />
<xctk:DataPoint X="5" Y="0.9" />
<xctk:DataPoint X="6" Y="0.95" />
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:LineLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingLineSeries.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingLineSeries.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.cs.txt

@ -14,9 +14,6 @@
*************************************************************************************/ *************************************************************************************/
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Chart;
#endif
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Controls; using System.Windows.Controls;
using System; using System;

171
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChartStylingPieSeriesView.xaml.txt

@ -24,175 +24,26 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>This sample demonstrates how a series with a pie layout type can be styled via DataTemplates. The series, hint line, and hint label are all styled.</Run> <Run>This sample demonstrates how a series with a pie layout type can be styled via DataTemplates. The series, hint line, and hint label are all styled.</Run>
<!--##EXCLUDE_OPEN_SOURCE-->
<Run>Please move the mouse over the pie slices to view the tooltips of the pie layout DataTemplate.</Run>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<sys:String x:Key="Name1">Mary</sys:String>
<sys:String x:Key="Name2">Brad</sys:String>
<sys:String x:Key="Name3">Anne</sys:String>
<sys:String x:Key="Name4">Eric</sys:String>
<sys:String x:Key="Name5">Lisa</sys:String>
<sys:String x:Key="Name6">Carl</sys:String>
<sys:String x:Key="Name7">Whole Team</sys:String>
<DataTemplate x:Key="GridBackgroundTemplate">
<Rectangle Width="{Binding Path=W}" Height="{Binding Path=H}" Margin="-5,-5,-5,-5"
RadiusX="25" RadiusY="25" StrokeThickness="1" Stroke="Gray" Fill="#FFFFE1">
<Rectangle.BitmapEffect>
<DropShadowBitmapEffect/>
</Rectangle.BitmapEffect>
</Rectangle>
</DataTemplate>
<DataTemplate x:Key="PieTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Path x:Name="PieSlice" Stroke="Gray" StrokeThickness="2" Data="{Binding Path=Geometry}" Fill="{Binding Path=Interior}">
<Path.ToolTip>
<ToolTip>
<StackPanel Orientation="Vertical">
<TextBlock Text="Name:"/>
<TextBlock Text="{Binding Path=DataPoint.Label}"/>
<TextBlock Text="Skills:"/>
<TextBlock Text="{Binding Path=DataPoint.Y}"/>
</StackPanel>
</ToolTip>
</Path.ToolTip>
<Path.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.3" Duration="0:0:0.4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Path.Triggers>
</Path>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="HintLineTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Polyline Points="{Binding Path=Points}" StrokeThickness="3" StrokeDashArray="2 1">
<Polyline.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Orange" Offset="1" />
<GradientStop Color="Blue" Offset="0.50" />
<GradientStop Color="Green" Offset="0" />
</LinearGradientBrush>
</Polyline.Stroke>
</Polyline>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="HintLabelTemplate">
<Border DockPanel.Dock="Top" BorderThickness="1" CornerRadius ="4">
<Border.BorderBrush>
<SolidColorBrush Color="Gray"/>
</Border.BorderBrush>
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="SkyBlue" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
<StackPanel>
<TextBlock FontFamily="Sans Serif" FontSize="18" FontStyle="Oblique" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=DataPoint.Label}"/>
<Image x:Name="_image" Width="20" Height="20"/>
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name1}">
<Setter Property="Source" Value="../Photo/1.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name2}">
<Setter Property="Source" Value="../Photo/2.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name3}">
<Setter Property="Source" Value="../Photo/3.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name4}">
<Setter Property="Source" Value="../Photo/4.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name5}">
<Setter Property="Source" Value="../Photo/5.bmp" TargetName="_image" />
</DataTrigger>
<DataTrigger Binding="{Binding DataPoint.Label}" Value="{StaticResource Name6}">
<Setter Property="Source" Value="../Photo/6.bmp" TargetName="_image" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<xctk:Chart MinHeight="400">
<xctk:Chart.Areas >
<xctk:Area Title="Area1" BackgroundTemplate="{StaticResource GridBackgroundTemplate}" Margin="10,25,20,25">
<xctk:Area.XAxis>
<xctk:Axis ShowAxisLabel="false" ShowGridLines="false" ShowAxis="false" ShowArrow="false" ShowTickLabels="false" ShowTicks="false" />
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis ShowAxisLabel="false" ShowGridLines="false" ShowAxis="false" ShowArrow="false" ShowTickLabels="false" ShowTicks="false" />
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series Title="Family Members"
ShowPointsInLegend="true"
Template="{StaticResource PieTemplate}"
ShowHintLabels="true"
HintLineTemplate="{StaticResource HintLineTemplate}"
HintLabelTemplate="{StaticResource HintLabelTemplate}"
HintLineLength="30">
<xctk:Series.DataPoints>
<xctk:DataPoint Y="-3" Label="{StaticResource Name1}" />
<xctk:DataPoint Y="-2" Label="{StaticResource Name2}" />
<xctk:DataPoint Y="-1" Label="{StaticResource Name3}" />
<xctk:DataPoint Y="1" Label="{StaticResource Name4}"/>
<xctk:DataPoint Y="1" Label="{StaticResource Name5}"/>
<xctk:DataPoint Y="2" Label="{StaticResource Name6}"/>
<xctk:DataPoint Y="5" Label="{StaticResource Name7}"/>
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:PieLayout/>
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ChartStylingPieSeries.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\ChartStylingPieSeries.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ChildWindowView.xaml.txt

@ -25,7 +25,6 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The ChildWindow control can be used to create a window that is displayed within the bounds of a specific parent container.</Run> <Run>The ChildWindow control can be used to create a window that is displayed within the bounds of a specific parent container.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>In addition to the following features, the "Plus" version allows ChildWindow to be resizable and to use a Maximize/Restore button.</Run> <Run>In addition to the following features, the "Plus" version allows ChildWindow to be resizable and to use a Maximize/Restore button.</Run>
@ -33,7 +32,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>

159
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.fr.resx.txt

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DetailsCategory" xml:space="preserve">
<value>Détails</value>
</data>
<data name="FavoriteActor1" xml:space="preserve">
<value>Acteur favori 1 (aucun DisplayName)</value>
</data>
<data name="FavoriteActor1Desc" xml:space="preserve">
<value>Le type de cette propriété est un enum où les valeurs n'ont aucun attribut "DisplayName". Les valeurs affichées sont retournées par la méthode ToString().</value>
</data>
<data name="FavoriteActor2" xml:space="preserve">
<value>Acteur favori 2 (avec DisplayName)</value>
</data>
<data name="FavoriteActor2Desc" xml:space="preserve">
<value>Le type de cette propriété est un enum où les valeurs sont décorés avec l'attribut "DisplayName". Les valeurs affichées sont celles spécifiées par l'attribut ExtendedDisplayName.</value>
</data>
<data name="FavoriteActor3" xml:space="preserve">
<value>Acteur favori 3</value>
</data>
<data name="FavoriteActor3Desc" xml:space="preserve">
<value>La valeur "(Non proposé)" démontre que les valeurs des enums peuvent aussi être localisées.</value>
</data>
<data name="FirstName" xml:space="preserve">
<value>Prénom</value>
</data>
<data name="FirstNameDesc" xml:space="preserve">
<value>Prénom de la personne</value>
</data>
<data name="InfoCategory" xml:space="preserve">
<value>Information</value>
</data>
<data name="LastName" xml:space="preserve">
<value>Nom de famille</value>
</data>
<data name="LastNameDesc" xml:space="preserve">
<value>Le nom de famille de la personne</value>
</data>
<data name="NotListed" xml:space="preserve">
<value>(Non proposé)</value>
</data>
</root>

159
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/DisplayLocalizationRes.resx.txt

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DetailsCategory" xml:space="preserve">
<value>Details</value>
</data>
<data name="FavoriteActor1" xml:space="preserve">
<value>Favorite actor 1 (no DisplayName)</value>
</data>
<data name="FavoriteActor1Desc" xml:space="preserve">
<value>This property's type is an enum whose values have no DisplayName attributes. These values displayed are provided by the ToString() method.</value>
</data>
<data name="FavoriteActor2" xml:space="preserve">
<value>Favorite actor 2 (with DisplayName)</value>
</data>
<data name="FavoriteActor2Desc" xml:space="preserve">
<value>This property's type is an enum whose values are decorated with the ExtendedDisplayName attribute. Combined with the EnumDisplayNameConverter, this allows display values to be customized.</value>
</data>
<data name="FavoriteActor3" xml:space="preserve">
<value>Favorite actor 3</value>
</data>
<data name="FavoriteActor3Desc" xml:space="preserve">
<value>"(Not listed)" enum value shows that enum values can also be localized.</value>
</data>
<data name="FirstName" xml:space="preserve">
<value>First name</value>
</data>
<data name="FirstNameDesc" xml:space="preserve">
<value>First name of that person</value>
</data>
<data name="InfoCategory" xml:space="preserve">
<value>Information</value>
</data>
<data name="LastName" xml:space="preserve">
<value>Last name</value>
</data>
<data name="LastNameDesc" xml:space="preserve">
<value>Usually the familly name of the person</value>
</data>
<data name="NotListed" xml:space="preserve">
<value>(Not listed)</value>
</data>
</root>

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.cs.txt

@ -28,18 +28,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.FilePicker.Views
public FilePickerView() public FilePickerView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_filePicker.SelectedFiles.CollectionChanged += this.SelectedFiles_CollectionChanged;
#endif
} }
#if !OPEN_SOURCE
private void SelectedFiles_CollectionChanged( object sender, NotifyCollectionChangedEventArgs e )
{
//Refresh PrimitiveTypeCollectionControl.ItemsSource to be up to date with FilePicker.SelectedFiles.
_primitiveTypeCollectionControl.ItemsSource = null;
_primitiveTypeCollectionControl.ItemsSource = _filePicker.SelectedFiles;
}
#endif
} }
} }

200
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/FilePickerView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>The FilePicker is a control that can be used to select one or more files in a browsing window.</Run> <Run>The FilePicker is a control that can be used to select one or more files in a browsing window.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,189 +33,26 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<x:Array x:Key="FilterStrings"
Type="sys:String">
<sys:String>All files |*.*</sys:String>
<sys:String>Text Files |*.txt</sys:String>
<sys:String>Office Files |*.docx;*.xlsx;*.pptx</sys:String>
<sys:String>Image files |*.jpg;*.jpeg</sys:String>
</x:Array>
<conv:InverseBoolConverter x:Key="InverseBoolConverter" />
<Style TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Foreground"
Value="Gray" />
</Trigger>
</Style.Triggers>
</Style>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- 1st Column -->
<TextBlock Text="Filter: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5"
Width="187"
ToolTip="Gets/Sets the type of files to show when Dialog is opened."
ItemsSource="{StaticResource FilterStrings}"
SelectedItem="{Binding Filter, ElementName=_filePicker}" />
<TextBlock Text="Use Full Path: "
Grid.Row="1"
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets if the full path should be used for SelectedFile and SelectedFiles."
IsChecked="{Binding UseFullPath, ElementName=_filePicker}" />
<TextBlock Text="Multi Select: "
Grid.Row="2"
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
Grid.Row="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets if the browsing window permits to do multi-selection of files."
IsChecked="{Binding MultiSelect, ElementName=_filePicker}" />
<TextBlock Text="Selected File: "
Grid.Row="3"
VerticalAlignment="Center"
IsEnabled="{Binding MultiSelect, ElementName=_filePicker, Converter={StaticResource InverseBoolConverter}}"/>
<TextBox Grid.Column="1"
Grid.Row="3"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the file that is selected when MultiSelect is false."
Text="{Binding SelectedFile, ElementName=_filePicker}"
IsEnabled="{Binding MultiSelect, ElementName=_filePicker, Converter={StaticResource InverseBoolConverter}}"/>
<TextBlock Text="Selected Files: "
Grid.Row="4"
VerticalAlignment="Center"
IsEnabled="{Binding MultiSelect, ElementName=_filePicker}"/>
<xctk:PrimitiveTypeCollectionControl x:Name="_primitiveTypeCollectionControl"
Grid.Column="1"
Grid.Row="4"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the files that are selected when MultiSelect is true."
Content="Selected Files"
ItemsSource="{Binding SelectedFiles, ElementName=_filePicker}"
ItemType="{x:Type sys:String}"
IsEnabled="{Binding MultiSelect, ElementName=_filePicker}"/>
<!-- 2nd Column -->
<TextBlock Text="Watermark: "
Grid.Column="2"
VerticalAlignment="Center" />
<TextBox Grid.Column="3"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the watermark when there are no file selected."
Text="{Binding Watermark, ElementName=_filePicker}" />
<TextBlock Text="Title: "
Grid.Row="1"
Grid.Column="2"
VerticalAlignment="Center" />
<TextBox Grid.Row="1"
Grid.Column="3"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the tile of the window browser."
Text="{Binding Title, ElementName=_filePicker}" />
<TextBlock Text="Initial Directory: "
Grid.Row="2"
Grid.Column="2"
VerticalAlignment="Center" />
<TextBox Grid.Row="2"
Grid.Column="3"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the current directory of the window browser."
Text="{Binding InitialDirectory, ElementName=_filePicker}" />
<TextBlock Text="Browse Content: "
Grid.Row="3"
Grid.Column="2"
VerticalAlignment="Center" />
<TextBox Grid.Row="3"
Grid.Column="3"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the content of the Browse Button."
Text="{Binding BrowseContent, ElementName=_filePicker, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</GroupBox>
<StackPanel Grid.Row="1"
Margin="10">
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:FilePicker x:Name="_filePicker"
Filter="All files |*.*"
Title="The FilePicker"
UseFullPath="True"
MultiSelect="False"
InitialDirectory="C:\"
BrowseContent=". . ."
Watermark="Choose your file(s)..."/>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\FilePicker.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\FilePicker.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

8
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.cs.txt

@ -32,17 +32,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.ListBox.Views
public ListBoxView() public ListBoxView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
//Add the default GroupDescriptions to the ListBox's GroupDescriptions collection.
_listBox.GroupDescriptions.Add( this.Resources[ "shipCountryGroupDescription" ] as GroupDescription );
_listBox.GroupDescriptions.Add( this.Resources[ "shipCityGroupDescription" ] as GroupDescription );
#endif
} }
#endregion #endregion

1099
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ListBoxView.xaml.txt

File diff suppressed because it is too large

8
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.cs.txt

@ -31,13 +31,5 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void ModeComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
materialButton.Content = e.AddedItems[ 0 ].Equals( MaterialButtonModeEnum.Circle )
? ((ComboBoxItem)contentComboBox.Items.GetItemAt( 1 )).Tag
: ((ComboBoxItem)contentComboBox.Items.GetItemAt( 0 )).Tag;
}
#endif
} }
} }

171
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialButtonView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A Button with a raised animation on mouse over and a customizable ink animation on MousePress. It uses the Material Brushes.</Run> <Run>A Button with a raised animation on mouse over and a customizable ink animation on MousePress. It uses the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,168 +32,18 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<ObjectDataProvider x:Key="ButtonEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:MaterialButtonModeEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Text="Is Raised Active: "
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
IsChecked="{Binding IsRaisedActive, ElementName=materialButton}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Mode: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource ButtonEnumData}}"
SelectedItem="{Binding Mode, ElementName=materialButton}"
SelectionChanged="ModeComboBox_SelectionChanged"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Content: "
VerticalAlignment="Center" />
<ComboBox x:Name="contentComboBox"
Grid.Column="1"
Grid.Row="2"
SelectedValue="{Binding Content, ElementName=materialButton}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
Margin="5">
<ComboBoxItem Content="A string"
Tag="PRIMARY" />
<ComboBoxItem Content="An image">
<ComboBoxItem.Tag>
<Image Source="../Resources/WhitePen.png"
Width="30"
Height="30" />
</ComboBoxItem.Tag>
</ComboBoxItem>
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="3"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="3"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialButton}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column -->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Is Ink Effect Active: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<CheckBox x:Name="inkEffectActiveCheckBox"
Grid.Column="3"
Grid.Row="0"
IsChecked="{Binding IsInkEffectActive, ElementName=materialButton}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Ink Effect Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:ColorPicker Grid.Column="3"
Grid.Row="1"
SelectedColor="{Binding InkEffectBrush, ElementName=materialButton, Converter={StaticResource SolidColorBrushToColorConverter}}"
DisplayColorAndName="True"
VerticalAlignment="Center"
Width="125"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}" />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Ink Effect Opacity: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="2"
Value="{Binding InkEffectOpacity, ElementName=materialButton}"
Minimum="0"
Maximum="1"
Increment="0.05"
FormatString="N2"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialButton x:Name="materialButton"
Content="PRIMARY"
Margin="20"
Padding="20"
IsRaisedActive="True"
IsInkEffectActive="True"
InkEffectBrush="White"
InkEffectOpacity="0.25"
Mode="Rectangle"
HorizontalAlignment="Center" />
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialButton.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialButton.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

76
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialCheckBoxView.xaml.txt

@ -24,7 +24,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A CheckBox with transition animations when the checked state is changed. It uses the Material Brushes.</Run> <Run>A CheckBox with transition animations when the checked state is changed. It uses the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -32,91 +31,16 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<xctk:CornerRadiusToDoubleConverter x:Key="CornerRadiusToDoubleConverter" />
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Text="Corner Radius: "
VerticalAlignment="Center" />
<xctk:DoubleUpDown Grid.Column="1"
Value="{Binding CornerRadius, ElementName=materialCheckBox, Converter={StaticResource CornerRadiusToDoubleConverter}}"
Minimum="0"
Maximum="10"
Increment="1"
Margin="5"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialCheckBox}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2"
Text="Check Mark Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<xctk:ColorPicker Grid.Column="3"
SelectedColor="{Binding CheckMarkBrush, ElementName=materialCheckBox, Converter={StaticResource SolidColorBrushToColorConverter}}"
DisplayColorAndName="True"
Margin="5"
Width="150"
VerticalContentAlignment="Center" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialCheckBox x:Name="materialCheckBox"
HorizontalAlignment="Center"
IsChecked="True"
Content="Accept conditions"
IsThreeState="True"/>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialCheckBox.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialCheckBox.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

142
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialComboBoxView.xaml.txt

@ -26,7 +26,6 @@
<Run>MaterialComboBox is a ComboBox that is using the Material Brushes and contains MaterialComboBoxItems.</Run> <Run>MaterialComboBox is a ComboBox that is using the Material Brushes and contains MaterialComboBoxItems.</Run>
<LineBreak /> <LineBreak />
<Run>MaterialComboBoxItems are ComboBoxItems that are using the Material Brushes. They use an ink animation when they are selected.</Run> <Run>MaterialComboBoxItems are ComboBoxItems that are using the Material Brushes. They use an ink animation when they are selected.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,157 +33,16 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="135" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialComboBox}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Line Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding LineBrush, ElementName=materialComboBox}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Line Focus Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="2"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding LineFocusBrush, ElementName=materialComboBox}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Is Using fade Animation: "
Grid.Row="3"
Grid.Column="0"
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
Grid.Row="3"
IsChecked="{Binding IsUsingFadeAnimation, ElementName=materialComboBox}"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column -->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Is Ink Effect Active: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<CheckBox x:Name="inkEffectActiveCheckBox"
Grid.Column="3"
Grid.Row="0"
IsChecked="{Binding IsInkEffectActive, ElementName=materialComboBox}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Can be set a MaterialComboBox control or individually on each MaterialComboBoxItem." />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Ink Effect Brush: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}"
Margin="10,0,0,0"/>
<xctk:ColorPicker Grid.Column="3"
Grid.Row="1"
SelectedColor="{Binding InkEffectBrush, ElementName=materialComboBox, Converter={StaticResource SolidColorBrushToColorConverter}}"
DisplayColorAndName="True"
VerticalAlignment="Center"
Width="125"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
ToolTip="Can be set a MaterialComboBox control or individually on each MaterialComboBoxItem." />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Ink Effect Opacity: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}"
Margin="10,0,0,0"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="2"
Value="{Binding InkEffectOpacity, ElementName=materialComboBox}"
Minimum="0"
Maximum="1"
Increment="0.05"
FormatString="N2"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
ToolTip="Can be set a MaterialComboBox control or individually on each MaterialComboBoxItem." />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialComboBox x:Name="materialComboBox"
HorizontalAlignment="Center"
IsInkEffectActive="True"
IsUsingFadeAnimation="True"
LineBrush="{Binding MaterialBrushes[17], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Width="150">
<xctk:MaterialComboBoxItem Content="First Item" />
<xctk:MaterialComboBoxItem Content="Second Item"
IsSelected="True" />
<xctk:MaterialComboBoxItem Content="Third Item" />
<xctk:MaterialComboBoxItem Content="Fourth Item" />
<xctk:MaterialComboBoxItem Content="Fifth Item" />
</xctk:MaterialComboBox>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialComboBox.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialComboBox.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

121
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.cs.txt

@ -19,12 +19,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
#if !OPEN_SOURCE
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using Xceed.Wpf.Toolkit.MaterialControls;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
{ {
/// <summary> /// <summary>
@ -32,15 +26,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
/// </summary> /// </summary>
public partial class MaterialControlsView : MaterialDemoView public partial class MaterialControlsView : MaterialDemoView
{ {
#if !OPEN_SOURCE
#region Members
private Storyboard _toastStoryboard = new Storyboard();
private Random _rand = new Random();
private List<MaterialToast> _toastList = new List<MaterialToast>();
#endregion
#endif
#region Constructors #region Constructors
@ -51,130 +38,22 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
#endregion #endregion
#if !OPEN_SOURCE
#region Private Methods
private int GetRandomInteger( int max )
{
return _rand.Next( max );
}
private void PopToast()
{
MaterialAccentEnum accent;
MaterialToastLocationEnum location;
string text;
switch( this.GetRandomInteger( 8 ) )
{
case 0: accent = MaterialAccentEnum.Blue; break;
case 1: accent = MaterialAccentEnum.LightBlue; break;
case 2: accent = MaterialAccentEnum.Cyan; break;
case 3: accent = MaterialAccentEnum.Teal; break;
case 4: accent = MaterialAccentEnum.Green; break;
case 5: accent = MaterialAccentEnum.LightGreen; break;
case 6: accent = MaterialAccentEnum.Lime; break;
default: accent = MaterialAccentEnum.Yellow; break;
}
switch( this.GetRandomInteger( 6 ) )
{
case 0: location = MaterialToastLocationEnum.Bottom; break;
case 1: location = MaterialToastLocationEnum.BottomLeft; break;
case 2: location = MaterialToastLocationEnum.BottomRight; break;
case 3: location = MaterialToastLocationEnum.Top; break;
case 4: location = MaterialToastLocationEnum.TopLeft; break;
default: location = MaterialToastLocationEnum.TopRight; break;
}
switch( this.GetRandomInteger( 6 ) )
{
case 0: text = "Warning"; break;
case 1: text = "New Appointments"; break;
case 2: text = "New Mail"; break;
case 3: text = "New Message"; break;
case 4: text = "Times Up!"; break;
default: text = "Task Completed!";break;
}
var materialToast = new MaterialToast( _toastGrid );
materialToast.MaterialAccent = accent;
materialToast.Location = location;
materialToast.Content = text;
materialToast.DisplayTime = System.TimeSpan.FromMilliseconds( 3000 );
materialToast.HideCompleted += this.MaterialToast_HideCompleted;
_toastList.Add( materialToast );
materialToast.ShowToast();
}
private void StartToastCircularProgressBar()
{
Storyboard storyboard = new Storyboard();
var valueAnim = new DoubleAnimation( 0d, 100d, System.TimeSpan.FromMilliseconds( 3000 ) );
Storyboard.SetTarget( valueAnim, _toastProgressBarCircular );
Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarCircular.ValueProperty ) );
storyboard.Children.Add( valueAnim );
storyboard.Completed += this.ToastCircularPropgressBarAnimation_Completed;
storyboard.Begin( _toastProgressBarCircular );
}
#endregion
#region Event Handlers
private void MaterialProgressBar_MouseLeftButtonDown( object sender, MouseButtonEventArgs e )
{
var progressBar = sender as MaterialProgressBarBase;
if( progressBar != null )
{
var storyboard = new Storyboard();
// Animate ProgressBar
var valueAnim = new DoubleAnimation( progressBar.Minimum, progressBar.Maximum, System.TimeSpan.FromMilliseconds( 4000 ) );
Storyboard.SetTarget( valueAnim, progressBar );
Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarBase.ValueProperty ) );
storyboard.Children.Add( valueAnim );
storyboard.Begin( this );
}
}
private void MaterialTabControl_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
var materialTabItem = e.AddedItems[ 0 ] as MaterialTabItem;
if( (materialTabItem != null) && materialTabItem.Equals( _materialTabItem5 ) )
{
this.StartToastCircularProgressBar();
}
else
{
foreach( var toast in _toastList )
{
toast.HideToast();
}
}
}
private void MaterialToast_HideCompleted( object sender, RoutedEventArgs e )
{
_toastList.Remove( sender as MaterialToast );
}
private void MaterialToastButton_Click( object sender, RoutedEventArgs e )
{
this.PopToast();
}
private void ToastCircularPropgressBarAnimation_Completed( object sender, EventArgs e )
{
if( _materialTabControl.SelectedItem.Equals( _materialTabItem5 ) )
{
this.PopToast();
this.StartToastCircularProgressBar();
}
}
#endregion
#endif
} }
} }

923
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialControlsView.xaml.txt

@ -27,7 +27,6 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>The Material controls include a set of complimentary accent brush and foreground.</Run> <Run>The Material controls include a set of complimentary accent brush and foreground.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -35,945 +34,23 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<Path x:Key="IconVolumeUp"
Data="M17.071346,6.6599999C17.78875,8.1508932 18.122005,9.9854851 17.917633,11.917816 17.780151,13.210711 17.415701,14.404805 16.885771,15.449L15.177,14.644304C15.617841,13.787608 15.9243,12.790113 16.036884,11.719817 16.208162,10.105325 15.913901,8.568861 15.306683,7.365747z M20.566984,5.2669997C21.512329,7.3320866 21.947803,9.7617378 21.678318,12.318976 21.49543,14.033849 21.006458,15.634024 20.297501,17.052L18.59,16.251213C19.210964,15.018133 19.637339,13.622355 19.796829,12.11588 20.034515,9.8762961 19.647739,7.7448602 18.813787,5.9662089z M13.335,0L13.335,21.334999 5.6516771,14.88951 0,14.88951 0,6.4454007 5.6543674,6.4454007z"
Stretch="Uniform"
Fill="#FFFFFFFF"
Width="36"
Height="36"
Margin="0,0,0,0"
RenderTransformOrigin="0.5,0.5" />
<Path x:Key="IconVolumeDown"
Data="M17.069859,6.6599998C17.78598,8.1508932 18.11929,9.9855452 17.916285,11.917816 17.779579,13.210711 17.413668,14.404805 16.884953,15.449L15.174,14.644304C15.615413,13.787608 15.922723,12.790213 16.034725,11.719917 16.207932,10.105325 15.910922,8.568861 15.305504,7.365747z M13.333,0L13.333,21.333 5.6509034,14.889021 0,14.889021 0,6.445189 5.6522733,6.445189z"
Stretch="Uniform"
Fill="#FFFFFFFF"
Width="36"
Height="36"
Margin="0,0,0,0"
RenderTransformOrigin="0.5,0.5" />
<Path x:Key="IconVolumeMinus"
Data="M16.92,9.7449998L25.690001,9.7449998 25.690001,11.589 16.92,11.589z M11.066152,4.8618717L6.4789848,8.7133774 2.2655792,8.7133774 2.2655792,12.622222 6.4737949,12.622222 11.066152,16.473669z M13.333,0L13.333,21.333 5.6508131,14.889091 0,14.889091 0,6.4452193 5.6522131,6.4452193z"
Stretch="Uniform"
Fill="#FFFFFFFF"
Width="24"
Height="24"
Margin="0,0,0,0"
RenderTransformOrigin="0.5,0.5" />
<Path x:Key="IconVolumeMute"
Data="M17.648219,6.9439999L20.472552,9.7694447 23.299285,6.9439999 24.802002,8.4505004 21.97767,11.275985 24.799303,14.09623 23.294185,15.6014 20.472552,12.778555 17.648219,15.604001 16.143001,14.098829 18.968634,11.275985 16.143001,8.4505004z M11.066151,4.8619084L6.479044,8.7121162 2.2668591,8.7121162 2.2668591,12.622163 6.4750738,12.622163 11.066151,16.473691z M13.333,0L13.333,21.332999 5.6509323,14.88902 0,14.88902 0,6.4451885 5.6534328,6.4451885z"
Stretch="Uniform"
Fill="#FFFFFFFF"
Width="18"
Height="18"
Margin="0,0,0,0"
RenderTransformOrigin="0.5,0.5" />
<Style x:Key="ToolTipTextStyle"
TargetType="{x:Type TextBlock}">
<Setter Property="FontWeight"
Value="Bold" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="VerticalAlignment"
Value="Top" />
<Setter Property="Foreground"
Value="Black" />
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Foreground"
Value="{Binding Tag, RelativeSource={RelativeSource Self}}" />
</Trigger>
</Style.Triggers>
</Style>
</local:DemoView.Resources>
<Grid>
<xctk:MaterialTabControl x:Name="_materialTabControl"
MaterialAccent="LightBlue"
SelectionChanged="MaterialTabControl_SelectionChanged">
<xctk:MaterialTabItem Header="Controls Page 1"
Padding="20"
FontSize="12">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<xctk:MaterialFrame Margin="16"
VerticalContentAlignment="Top"
Z="4">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Left"
Margin="20">
<TextBlock Text="Buttons : " />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 1"
MaterialAccent="Blue" />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 2"
MaterialAccent="LightBlue" />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 3"
MaterialAccent="Cyan" />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 4"
MaterialAccent="Teal" />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 5"
MaterialAccent="Green" />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 6"
MaterialAccent="LightGreen" />
<xctk:MaterialButton Margin="0,8,0,0"
Height="28"
Width="120"
Content="Button 7"
MaterialAccent="Lime" />
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Margin="16"
VerticalContentAlignment="Top"
Z="4">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Left"
Margin="20">
<TextBlock Text="Round Buttons : " />
<xctk:MaterialButton Margin="0,8,0,0"
Mode="Circle"
Height="64"
Width="64"
Content="{StaticResource IconVolumeUp}"
MaterialAccent="Blue" />
<xctk:MaterialButton Margin="0,8,0,0"
Mode="Circle"
Height="48"
Width="48"
Content="{StaticResource IconVolumeDown}"
MaterialAccent="LightBlue" />
<xctk:MaterialButton Margin="0,8,0,0"
Mode="Circle"
Height="36"
Width="36"
Content="{StaticResource IconVolumeMinus}"
MaterialAccent="Cyan" />
<xctk:MaterialButton Margin="0,8,0,0"
Mode="Circle"
Height="24"
Width="24"
Content="{StaticResource IconVolumeMute}"
MaterialAccent="Teal" />
<xctk:MaterialButton Margin="0,8,0,0"
Mode="Circle"
Height="18"
Width="18"
Content=""
MaterialAccent="Green" />
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Margin="16"
VerticalContentAlignment="Top"
Z="4">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Left"
Margin="20">
<TextBlock Text="Radio Buttons : " />
<xctk:MaterialRadioButton Content="Option 1"
Margin="0,8,0,0"
MaterialAccent="Blue" />
<xctk:MaterialRadioButton Content="Option 2"
Margin="0,8,0,0"
MaterialAccent="LightBlue" />
<xctk:MaterialRadioButton Content="Option 3"
Margin="0,8,0,0"
MaterialAccent="Cyan" />
<xctk:MaterialRadioButton Content="Option 4"
Margin="0,8,0,0"
MaterialAccent="Teal" />
<xctk:MaterialRadioButton Content="Option 5"
Margin="0,8,0,0"
MaterialAccent="Green" />
<xctk:MaterialRadioButton Content="Option 6"
Margin="0,8,0,0"
MaterialAccent="LightGreen" />
<xctk:MaterialRadioButton Content="Option 7"
Margin="0,8,0,0"
MaterialAccent="Lime" />
<xctk:MaterialRadioButton Content="Option 8"
Margin="0,8,0,0"
MaterialAccent="Yellow" />
</StackPanel>
</xctk:MaterialFrame>
</StackPanel >
</xctk:MaterialTabItem>
<xctk:MaterialTabItem Header="Controls Page 2"
Padding="20"
FontSize="12">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
Margin="16">
<StackPanel Orientation="Vertical"
Margin="20"
Width="260">
<TextBlock Text="TextFields : " />
<xctk:MaterialTextField Watermark="First Name"
Margin="0,36,0,0"
MaterialAccent="Blue" />
<xctk:MaterialTextField Watermark="Last Name"
Margin="0,36,0,0"
MaterialAccent="Blue" />
<xctk:MaterialTextField Watermark="Company Name"
Margin="0,36,0,0"
MaterialAccent="Blue" />
<xctk:MaterialTextField Watermark="Address"
Margin="0,36,0,0"
MaterialAccent="Blue" />
<xctk:MaterialTextField Watermark="Address Line 2"
Margin="0,36,0,0"
MaterialAccent="Blue" />
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
Margin="16"
VerticalContentAlignment="Top">
<StackPanel Margin="20">
<TextBlock Text="CheckBoxes: " />
<xctk:MaterialCheckBox Content="Option 1"
Margin="0,8,0,0"
MaterialAccent="Blue"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 2"
Margin="0,8,0,0"
MaterialAccent="LightBlue"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 3"
Margin="0,8,0,0"
MaterialAccent="Cyan"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 4"
Margin="0,8,0,0"
MaterialAccent="Teal"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 5"
Margin="0,8,0,0"
MaterialAccent="Green"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 6"
Margin="0,8,0,0"
MaterialAccent="LightGreen"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 7"
Margin="0,8,0,0"
MaterialAccent="Lime"
IsChecked="True" />
<xctk:MaterialCheckBox Content="Option 8"
Margin="0,8,0,0"
MaterialAccent="Yellow"
IsChecked="True" />
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
Margin="16"
VerticalContentAlignment="Top">
<StackPanel Margin="20">
<TextBlock Text="DropDowns: " />
<xctk:MaterialDropDown Content="DropDown Button 1"
Margin="0,8,0,0"
MaterialAccent="Blue">
<xctk:MaterialDropDown.DropDownContent>
<Border CornerRadius="2"
Height="46"
Width="160">
<TextBlock Text="DropDown Content"
Foreground="Black"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</xctk:MaterialDropDown.DropDownContent>
</xctk:MaterialDropDown>
<xctk:MaterialDropDown Content="DropDown Button 2"
Margin="0,8,0,0"
MaterialAccent="LightBlue">
<xctk:MaterialDropDown.DropDownContent>
<Border CornerRadius="2"
Height="46"
Width="160">
<TextBlock Text="DropDown Content"
Foreground="Black"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</xctk:MaterialDropDown.DropDownContent>
</xctk:MaterialDropDown>
<xctk:MaterialDropDown Content="DropDown Button 3"
Margin="0,8,0,0"
MaterialAccent="Cyan">
<xctk:MaterialDropDown.DropDownContent>
<Border CornerRadius="2"
Height="46"
Width="160">
<TextBlock Text="DropDown Content"
Foreground="Black"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</xctk:MaterialDropDown.DropDownContent>
</xctk:MaterialDropDown>
<xctk:MaterialDropDown Content="DropDown Button 4"
Margin="0,8,0,0"
MaterialAccent="Teal">
<xctk:MaterialDropDown.DropDownContent>
<Border CornerRadius="2"
Height="46"
Width="160">
<TextBlock Text="DropDown Content"
Foreground="Black"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</xctk:MaterialDropDown.DropDownContent>
</xctk:MaterialDropDown>
<xctk:MaterialDropDown Content="DropDown Button 5"
Margin="0,8,0,0"
MaterialAccent="Green">
<xctk:MaterialDropDown.DropDownContent>
<Border CornerRadius="2"
Height="46"
Width="160">
<TextBlock Text="DropDown Content"
Foreground="Black"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</xctk:MaterialDropDown.DropDownContent>
</xctk:MaterialDropDown>
</StackPanel>
</xctk:MaterialFrame>
</StackPanel>
</xctk:MaterialTabItem>
<xctk:MaterialTabItem Header="Controls Page 3"
Padding="20"
FontSize="12">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Margin="20">
<TextBlock Text="Switches : " />
<xctk:MaterialSwitch Width="80"
Margin="0,12,0,0"
MaterialAccent="Blue"
IsChecked="True" />
<xctk:MaterialSwitch Width="90"
Margin="0,12,0,0"
MaterialAccent="LightBlue"
IsChecked="True" />
<xctk:MaterialSwitch Width="100"
Margin="0,12,0,0"
MaterialAccent="Cyan"
IsChecked="True" />
<xctk:MaterialSwitch Width="110"
Margin="0,12,0,0"
MaterialAccent="Teal"
IsChecked="True" />
<xctk:MaterialSwitch Width="120"
Margin="0,12,0,0"
MaterialAccent="Green"
IsChecked="True" />
<xctk:MaterialSwitch Width="130"
Margin="0,12,0,0"
MaterialAccent="LightGreen"
IsChecked="True" />
<xctk:MaterialSwitch Width="140"
Margin="0,12,0,0"
MaterialAccent="Lime"
IsChecked="True" />
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Margin="15">
<TextBlock Text="Sliders : " />
<Grid TextElement.Foreground="Black">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Volume:"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Column="1"
Width="120"
MaterialAccent="Blue"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
<TextBlock Text="Bass:"
Grid.Row="1"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Row="1"
Grid.Column="1"
Width="120"
MaterialAccent="LightBlue"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
<TextBlock Text="Treble:"
Grid.Row="2"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Row="2"
Grid.Column="1"
Width="120"
MaterialAccent="Cyan"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
<TextBlock Text="Mid:"
Grid.Row="3"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Row="3"
Grid.Column="1"
Width="120"
MaterialAccent="Teal"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
<TextBlock Text="Master:"
Grid.Row="4"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Row="4"
Grid.Column="1"
Width="120"
MaterialAccent="Green"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
<TextBlock Text="Equalizer:"
Grid.Row="5"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Row="5"
Grid.Column="1"
Width="120"
MaterialAccent="LightGreen"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
<TextBlock Text="Balance:"
Grid.Row="6"
Margin="0,15,0,15" />
<xctk:MaterialSlider Grid.Row="6"
Grid.Column="1"
Width="120"
MaterialAccent="Lime"
Minimum="0"
Maximum="10"
VerticalAlignment="Center" />
</Grid>
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Margin="15">
<TextBlock Text="ToolTips : "/>
<Grid Margin="0,15,0,0">
<Image Source="../Resources/italy.4.gif"
Stretch="Fill"
Height="328"
Width="204" />
<TextBlock Text="Venice"
Margin="49,50,0,0"
Tag="{Binding MaterialBrushes[6], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="LightBlue"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 270,660" />
<TextBlock Text="Avg Temp: 13.0°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Text="Genoa"
Margin="15,76,0,0"
Tag="{Binding MaterialBrushes[7], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="Cyan"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 594,904" />
<TextBlock Text="Avg Temp: 15.7°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Text="San Marino"
Margin="100,92,0,0"
Tag="{Binding MaterialBrushes[8], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="Teal"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 32,576" />
<TextBlock Text="Avg Temp: 18.1°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Text="Florence"
Margin="58,113,0,0"
Tag="{Binding MaterialBrushes[9], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="Green"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 379,180" />
<TextBlock Text="Avg Temp: 14.9°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Text="Rome"
Margin="62,167,0,0"
Tag="{Binding MaterialBrushes[15], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="DeepOrange"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 4,321,244" />
<TextBlock Text="Avg Temp: 20.4°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Text="Brindisi"
Margin="149,180,0,0"
Tag="{Binding MaterialBrushes[16], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="Brown"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 89,846" />
<TextBlock Text="Avg Temp: 17.2°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBlock Text="Palermo"
Margin="72,237,0,0"
Tag="{Binding MaterialBrushes[18], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Style="{StaticResource ToolTipTextStyle}">
<TextBlock.ToolTip>
<xctk:MaterialToolTip MaterialAccent="BlueGray"
FontWeight="Light">
<StackPanel>
<TextBlock Text="Pop: 1,200,000" />
<TextBlock Text="Avg Temp: 18.5°C" />
</StackPanel>
</xctk:MaterialToolTip>
</TextBlock.ToolTip>
</TextBlock>
</Grid>
</StackPanel>
</xctk:MaterialFrame>
</StackPanel>
</xctk:MaterialTabItem>
<xctk:MaterialTabItem Header="Controls Page 4"
Padding="20"
FontSize="12">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Margin="20">
<TextBlock Text="ProgressBars : " />
<TextBlock Text="(Click to animate progressBars)"
Foreground="Black"
FontSize="11" />
<Grid Margin="0,15,0,10">
<xctk:MaterialProgressBar x:Name="firstMaterialProgressBar"
Width="160"
MaterialAccent="Blue"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=firstMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
<Grid Margin="0,10,0,10">
<xctk:MaterialProgressBar x:Name="secondMaterialProgressBar"
Width="160"
MaterialAccent="LightBlue"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=secondMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,10,0,10">
<xctk:MaterialProgressBar x:Name="thirdMaterialProgressBar"
Width="160"
MaterialAccent="Cyan"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=thirdMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,10,0,10">
<xctk:MaterialProgressBar x:Name="fourthMaterialProgressBar"
Width="160"
MaterialAccent="Teal"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=fourthMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,10,0,10">
<xctk:MaterialProgressBar x:Name="fifthMaterialProgressBar"
Width="160"
MaterialAccent="Green"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=fifthMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,10,0,10">
<xctk:MaterialProgressBar x:Name="sixthMaterialProgressBar"
Width="160"
MaterialAccent="LightGreen"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=sixthMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,10,0,10">
<xctk:MaterialProgressBar x:Name="seventhMaterialProgressBar"
Width="160"
MaterialAccent="Lime"
Minimum="0"
Maximum="100"
Height="20"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=seventhMaterialProgressBar, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Margin="20">
<TextBlock Text="Circular ProgressBars : " />
<TextBlock Text="(Click to animate progressBars)"
Foreground="Black"
FontSize="11"/>
<Grid Margin="0,15,0,6">
<xctk:MaterialProgressBarCircular x:Name="firstMaterialProgressBarCircular"
Width="75"
Height="75"
MaterialAccent="Blue"
Background="LightGray"
Minimum="0"
Maximum="100"
Thickness="15"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=firstMaterialProgressBarCircular, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,6,0,6">
<xctk:MaterialProgressBarCircular x:Name="secondMaterialProgressBarCircular"
Width="75"
Height="75"
Background="LightGray"
MaterialAccent="LightBlue"
Minimum="0"
Maximum="100"
Thickness="15"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=secondMaterialProgressBarCircular, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,6,0,6">
<xctk:MaterialProgressBarCircular x:Name="thirdMaterialProgressBarCircular"
Width="75"
Height="75"
Background="LightGray"
MaterialAccent="Cyan"
Minimum="0"
Maximum="100"
Thickness="15"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=thirdMaterialProgressBarCircular, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Grid Margin="0,6,0,6">
<xctk:MaterialProgressBarCircular x:Name="fourthMaterialProgressBarCircular"
Width="75"
Height="75"
Background="LightGray"
MaterialAccent="Teal"
Minimum="0"
Maximum="100"
Thickness="15"
MouseLeftButtonDown="MaterialProgressBar_MouseLeftButtonDown" />
<TextBlock Text="{Binding Value, ElementName=fourthMaterialProgressBarCircular, StringFormat={}{0:N0}%}"
Foreground="Black"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
</StackPanel>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Margin="20">
<TextBlock Text="ListBoxes : " />
<xctk:MaterialListBox Margin="0,15,0,0"
MaterialAccent="Blue">
<xctk:MaterialListBoxItem Content="New York"
Padding="10,0,10,0"/>
<xctk:MaterialListBoxItem Content="Tokyo"
Padding="10,0,10,0"/>
<xctk:MaterialListBoxItem Content="Paris"
IsSelected="True"
Padding="10,0,10,0"/>
<xctk:MaterialListBoxItem Content="Sydney"
Padding="10,0,10,0" />
</xctk:MaterialListBox>
<xctk:MaterialListBox Margin="0,15,0,0"
MaterialAccent="LightBlue">
<xctk:MaterialListBoxItem Content="Brazil"
Padding="10,0,10,0"/>
<xctk:MaterialListBoxItem Content="USA"
IsSelected="True"
Padding="10,0,10,0" />
<xctk:MaterialListBoxItem Content="China"
Padding="10,0,10,0"/>
</xctk:MaterialListBox>
<xctk:MaterialListBox Margin="0,15,0,0"
MaterialAccent="Cyan">
<xctk:MaterialListBoxItem Content="English"
IsSelected="True"
Padding="10,0,10,0"/>
<xctk:MaterialListBoxItem Content="French"
Padding="10,0,10,0"/>
</xctk:MaterialListBox>
<xctk:MaterialListBox Margin="0,15,0,0"
MaterialAccent="Teal">
<xctk:MaterialListBoxItem Content="Red"
Padding="10,0,10,0" />
<xctk:MaterialListBoxItem Content="Green"
Padding="10,0,10,0" />
<xctk:MaterialListBoxItem Content="Blue"
IsSelected="True"
Padding="10,0,10,0" />
</xctk:MaterialListBox>
<xctk:MaterialListBox Margin="0,15,0,0"
MaterialAccent="Green">
<xctk:MaterialListBoxItem Content="True"
IsSelected="True"
Padding="10,0,10,0" />
<xctk:MaterialListBoxItem Content="False"
Padding="10,0,10,0" />
</xctk:MaterialListBox>
</StackPanel>
</xctk:MaterialFrame>
</StackPanel>
</xctk:MaterialTabItem>
<xctk:MaterialTabItem Header="Controls Page 5"
x:Name="_materialTabItem5"
Padding="20"
FontSize="12" >
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Left"
Margin="16">
<Grid x:Name="_toastGrid"
Width="350">
<TextBlock Text="Toasts : "
Margin="20"/>
<Grid Margin="0,16,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<xctk:MaterialButton Content="Pop a toast"
Click="MaterialToastButton_Click"
Padding="15"
HorizontalAlignment="Center"/>
<Grid Grid.Row="1"
Margin="0,25,0,0"
Width="100"
Height="100">
<xctk:MaterialProgressBarCircular x:Name="_toastProgressBarCircular"
Background="LightGray"
Thickness="10"
Minimum="0"
Maximum="100" />
<TextBlock Text="Toast&#x0a;Timer"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Grid>
</Grid>
</xctk:MaterialFrame>
<xctk:MaterialFrame Z="4"
VerticalContentAlignment="Top"
HorizontalContentAlignment="Left"
Margin="16">
<StackPanel Orientation="Vertical"
Margin="20"
Width="200">
<TextBlock Text="ComboBoxes : " />
<xctk:MaterialComboBox Margin="0,36,0,0"
MaterialAccent="Blue">
<xctk:MaterialComboBoxItem Content="TV" />
<xctk:MaterialComboBoxItem Content="Computer"
IsSelected="True" />
<xctk:MaterialComboBoxItem Content="Cell phone" />
<xctk:MaterialComboBoxItem Content="Camera" />
<xctk:MaterialComboBoxItem Content="Radio" />
</xctk:MaterialComboBox>
<xctk:MaterialComboBox Margin="0,36,0,0"
MaterialAccent="LightBlue">
<xctk:MaterialComboBoxItem Content="Over 3000$" />
<xctk:MaterialComboBoxItem Content="From 2000$ - 3000$"
IsSelected="True" />
<xctk:MaterialComboBoxItem Content="From 1000$ - 2000$" />
<xctk:MaterialComboBoxItem Content="From 500$ - 1000$" />
<xctk:MaterialComboBoxItem Content="Under 500$" />
</xctk:MaterialComboBox>
<xctk:MaterialComboBox Margin="0,36,0,0"
MaterialAccent="Cyan">
<xctk:MaterialComboBoxItem Content="Sony" />
<xctk:MaterialComboBoxItem Content="Dell" />
<xctk:MaterialComboBoxItem Content="Samsung"
IsSelected="True" />
<xctk:MaterialComboBoxItem Content="Toshiba" />
<xctk:MaterialComboBoxItem Content="Sharp" />
</xctk:MaterialComboBox>
<xctk:MaterialComboBox Margin="0,36,0,0"
MaterialAccent="Teal">
<xctk:MaterialComboBoxItem Content="Over 100kg" />
<xctk:MaterialComboBoxItem Content="From 50 - 100kg" />
<xctk:MaterialComboBoxItem Content="From 30 - 50kg"
IsSelected="True" />
<xctk:MaterialComboBoxItem Content="From 10 - 30kg" />
<xctk:MaterialComboBoxItem Content="Under 10kg" />
</xctk:MaterialComboBox>
<xctk:MaterialComboBox Margin="0,36,0,0"
MaterialAccent="Green">
<xctk:MaterialComboBoxItem Content="Fed Ex" />
<xctk:MaterialComboBoxItem Content="UPS" />
<xctk:MaterialComboBoxItem Content="Regular Post"
IsSelected="True" />
</xctk:MaterialComboBox>
</StackPanel>
</xctk:MaterialFrame>
</StackPanel>
</xctk:MaterialTabItem>
</xctk:MaterialTabControl>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialControls.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialControls.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

41
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDemoView.cs.txt

@ -0,0 +1,41 @@
/**************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit.LiveExplorer
{
public class MaterialDemoView : DemoView
{
#region Constructor
public MaterialDemoView()
{
}
#endregion
}
}

151
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialDropDownView.xaml.txt

@ -24,7 +24,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A DropDownButton from the Xceed Wpf Toolkit with animations when opening the popup. It uses the MaterialButton animations and the Material Brushes.</Run> <Run>A DropDownButton from the Xceed Wpf Toolkit with animations when opening the popup. It uses the MaterialButton animations and the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -32,147 +31,19 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="DropDownPlacementMode"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="PlacementMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="120" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Text="DropDown Position: "
VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource DropDownPlacementMode}}"
SelectedItem="{Binding DropDownPosition, ElementName=materialDropDown}"
HorizontalAlignment="Left"
Width="110"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialDropDown}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Is Using fade Animation: "
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"/>
<CheckBox Grid.Column="1"
Grid.Row="2"
IsChecked="{Binding IsUsingFadeAnimation, ElementName=materialDropDown}"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Is Ink Effect Active: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<CheckBox x:Name="inkEffectActiveCheckBox"
Grid.Column="3"
Grid.Row="0"
IsChecked="{Binding IsInkEffectActive, ElementName=materialDropDown}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Ink Effect Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:ColorPicker Grid.Column="3"
Grid.Row="1"
SelectedColor="{Binding InkEffectBrush, ElementName=materialDropDown, Converter={StaticResource SolidColorBrushToColorConverter}}"
DisplayColorAndName="True"
VerticalAlignment="Center"
Width="125"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}" />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Ink Effect Opacity: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="2"
Value="{Binding InkEffectOpacity, ElementName=materialDropDown}"
Minimum="0"
Maximum="1"
Increment="0.05"
FormatString="N2"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialDropDown x:Name="materialDropDown"
Content="Click Me"
HorizontalAlignment="Center"
DropDownPosition="Bottom"
IsUsingFadeAnimation="True"
IsInkEffectActive="True">
<xctk:DropDownButton.DropDownContent>
<xctk:ColorCanvas Foreground="Black"/>
</xctk:DropDownButton.DropDownContent>
</xctk:MaterialDropDown>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialDropDown.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialDropDown.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

159
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialFrameView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A ContentControl with a fully customizable shadow that can be modified through Shadow properties or with a Z property that enables predefined shadows.</Run> <Run>A ContentControl with a fully customizable shadow that can be modified through Shadow properties or with a Z property that enables predefined shadows.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,174 +33,16 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<conv:EqualsMinusOneConverter x:Key="EqualsMinusOneConverter" />
<xctk:CornerRadiusToDoubleConverter x:Key="CornerRadiusToDoubleConverter" />
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Text="Z: "
VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Column="1"
Value="{Binding Z, ElementName=materialFrame}"
Minimum="-1"
Maximum="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="When the Z property is greater than 0, the shadow effects will be built using the default shadows."/>
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="CornerRadius: "
VerticalAlignment="Center" />
<xctk:DoubleUpDown Grid.Column="1"
Grid.Row="1"
Value="{Binding CornerRadius, ElementName=materialFrame, Converter={StaticResource CornerRadiusToDoubleConverter}}"
Minimum="0"
Maximum="30"
VerticalAlignment="Center"
Margin="5"/>
<!-- Second Column-->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Shadow Direction: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"
Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="0"
Value="{Binding ShadowDirection, ElementName=materialFrame}"
Minimum="0"
Maximum="360"
Increment="5"
VerticalAlignment="Center"
Margin="5"
ToolTip="The Z property should equal -1 in order to build the shadow from MaterialFrame Shadow properties."
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"/>
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Shadow Depth: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"
Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="1"
Value="{Binding ShadowDepth, ElementName=materialFrame}"
Minimum="0"
Maximum="40"
VerticalAlignment="Center"
Margin="5"
ToolTip="The Z property should equal -1 in order to build the shadow from MaterialFrame Shadow properties."
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"/>
<!--Third Column-->
<TextBlock Grid.Column="4"
Grid.Row="0"
Text="Shadow Blur Radius: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"
Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Column="5"
Grid.Row="0"
Value="{Binding ShadowBlurRadius, ElementName=materialFrame}"
Minimum="0"
Maximum="100"
VerticalAlignment="Center"
Margin="5"
ToolTip="The Z property should equal -1 in order to build the shadow from MaterialFrame Shadow properties."
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"/>
<TextBlock Grid.Column="4"
Grid.Row="1"
Text="Shadow Opacity: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"
Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Column="5"
Grid.Row="1"
Value="{Binding ShadowOpacity, ElementName=materialFrame}"
Minimum="0"
Maximum="1"
Increment="0.1"
FormatString="N1"
VerticalAlignment="Center"
Margin="5"
ToolTip="The Z property should equal -1 in order to build the shadow from MaterialFrame Shadow properties."
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"/>
<!--Fourth Column-->
<TextBlock Grid.Column="6"
Grid.Row="0"
Text="Shadow Color: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"
Style="{StaticResource DisableGrayText}" />
<xctk:ColorPicker Grid.Column="7"
Grid.Row="0"
SelectedColor="{Binding ShadowColor, ElementName=materialFrame}"
VerticalAlignment="Center"
Width="90"
Margin="5"
ToolTip="The Z property should equal -1 in order to build the shadow from MaterialFrame Shadow properties."
IsEnabled="{Binding Z, ElementName=materialFrame, Converter={StaticResource EqualsMinusOneConverter}}"/>
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialFrame x:Name="materialFrame"
Margin="20"
HorizontalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Width="400"
Height="300"
Z="2"
ShadowDirection="315"
ShadowDepth="10"
ShadowBlurRadius="20"
ShadowOpacity="0.7"
ShadowColor="Blue">
<TextBlock Text="This is a MaterialFrame"/>
</xctk:MaterialFrame>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialFrame.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialFrame.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

64
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.cs.txt

@ -33,79 +33,15 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
#endregion #endregion
#if !OPEN_SOURCE
#region EventHandlers
private void CheckedContentComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
if( materialHamburger == null )
return;
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
{
var selection = e.AddedItems[ 0 ] as ComboBoxItem;
if( selection != null )
{
if( selection.Tag != null )
{
materialHamburger.CheckedContent = selection.Tag;
}
else
{
materialHamburger.ClearValue( MaterialHamburger.CheckedContentProperty );
}
}
}
}
private void UncheckedContentComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
if( materialHamburger == null )
return;
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
{
var selection = e.AddedItems[ 0 ] as ComboBoxItem;
if( selection != null )
{
if( selection.Tag != null )
{
materialHamburger.UncheckedContent = selection.Tag;
}
else
{
materialHamburger.ClearValue( MaterialHamburger.UncheckedContentProperty );
}
}
}
}
private void MenuLocationComboBox_SelectionChanged( object sender, SelectionChangedEventArgs e )
{
if( ( e.AddedItems != null ) && ( e.AddedItems.Count > 0 ) )
{
var menuLocation = ( HamburgerLocation )e.AddedItems[ 0 ];
materialHamburgerMenu.CloseButtonLocation = ( menuLocation == HamburgerLocation.Right ) ? Location.Left : Location.Right;
}
}
private void IconButton_Click( object sender, RoutedEventArgs e )
{
var button = sender as IconButton;
if( button != null )
{
Process.Start( new ProcessStartInfo( button.Tag as string ) );
}
}
private void ApplyButton_Click( object sender, RoutedEventArgs e )
{
materialHamburger.IsChecked = false;
}
#endregion
#endif
} }
} }

604
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialHamburgerView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A ToggleButton that pops a menu from left, right, top or bottom of a Window (or any FrameworkElement). The menu can be an animated HamburgerMenu or any customized content. It uses the Material Brushes.</Run> <Run>A ToggleButton that pops a menu from left, right, top or bottom of a Window (or any FrameworkElement). The menu can be an animated HamburgerMenu or any customized content. It uses the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,577 +33,42 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="HamburgerLocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:HamburgerLocation" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="LocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:Location" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<conv:ZeroToBoolConverter x:Key="ZeroToBoolConverter" />
<ContentControl x:Key="CheckedContent1"
Content="Close" />
<ContentControl x:Key="UncheckedContent1"
Content="Open" />
<DataTemplate x:Key="MenuHeaderTemplate1">
<StackPanel Margin="20">
<TextBlock Text="{Binding}"
Margin="5" />
<Button Content="Test"
Margin="5" />
</StackPanel>
</DataTemplate>
<Path x:Key="LeftArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<ScaleTransform ScaleX="-1"
ScaleY="1" />
</Path.RenderTransform>
</Path>
<Path x:Key="RightArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16">
</Path>
<Path x:Key="TopArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<RotateTransform Angle="-90" />
</Path.RenderTransform>
</Path>
<Path x:Key="BottomArrowPath"
x:Shared="False"
Data="F1M-218.342,2910.79L-234.066,2926.52 -233.954,2926.63 -225.428,2926.63 -210.87,2912.07 -206.495,2907.7 -225.313,2888.88 -234.066,2888.88 -218.342,2904.6 -259.829,2904.6 -259.829,2910.79 -218.342,2910.79z"
Stretch="Uniform"
Fill="White"
Width="16"
Height="16"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<RotateTransform Angle="90" />
</Path.RenderTransform>
</Path>
<Style x:Key="DefaultHamburgerMenuCloseButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="Content"
Value="{StaticResource LeftArrowPath}" />
<Setter Property="Foreground"
Value="White" />
<Setter Property="Margin"
Value="4" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="BorderBrush"
Value="Transparent" />
<Setter Property="Cursor"
Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<!--Right Arrow when Menu is positionned on right-->
<DataTrigger Binding="{Binding MenuLocation, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}"
Value="Right">
<Setter Property="Content"
Value="{StaticResource RightArrowPath}" />
</DataTrigger>
<!--Top Arrow when Menu is positionned on top-->
<DataTrigger Binding="{Binding MenuLocation, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}"
Value="Top">
<Setter Property="Content"
Value="{StaticResource TopArrowPath}" />
</DataTrigger>
<!--Bottom Arrow when Menu is positionned on Bottom-->
<DataTrigger Binding="{Binding MenuLocation, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}"
Value="Bottom">
<Setter Property="Content"
Value="{StaticResource BottomArrowPath}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="HamburgerMenuCloseButtonStyle1"
TargetType="{x:Type Button}">
<Setter Property="Content"
Value="OK" />
</Style>
<Border x:Key="CustomizedHamburgerContent"
Background="White"
BorderBrush="Black"
BorderThickness="1"
Margin="5">
<StackPanel>
<xctk:MaterialTextField Text="Mike"
Watermark="Your Name"
Margin="10,30,10,10" />
<StackPanel Orientation="Horizontal"
Margin="10">
<TextBlock Text="Volume:"
Margin="3" />
<xctk:MaterialComboBox SelectedIndex="1"
Width="130">
<xctk:MaterialComboBoxItem Content="High" />
<xctk:MaterialComboBoxItem Content="Medium" />
<xctk:MaterialComboBoxItem Content="Low" />
<xctk:MaterialComboBoxItem Content="Vibration" />
</xctk:MaterialComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="10">
<TextBlock Text="Music: "
Margin="5" />
<xctk:MaterialRadioButton GroupName="Choice"
IsChecked="True"
Content="On"
Margin="5" />
<xctk:MaterialRadioButton GroupName="Choice"
Content="Off"
Margin="5" />
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="10">
<TextBlock Text="Plane Mode:"
Margin="5,0,5,0" />
<xctk:MaterialSwitch />
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="10">
<xctk:MaterialCheckBox IsChecked="True"
Content="English"
Margin="0,5,5,5" />
<xctk:MaterialCheckBox IsChecked="False"
Content="French"
Margin="5" />
</StackPanel>
<xctk:MaterialButton Content="Apply"
Margin="10"
Padding="8"
Click="ApplyButton_Click" />
</StackPanel>
</Border>
<Style x:Key="IconButtonStyle"
TargetType="{x:Type xctk:IconButton}">
<Setter Property="BorderThickness"
Value="0" />
<Setter Property="MouseOverForeground"
Value="{Binding MaterialAccentBrush, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}" />
<Setter Property="MousePressedForeground"
Value="{Binding MaterialAccentBrush, RelativeSource={RelativeSource AncestorType={x:Type xctk:MaterialHamburgerMenu}}}" />
<Setter Property="Background"
Value="White" />
<Setter Property="MouseOverBackground"
Value="White" />
<Setter Property="MousePressedBackground"
Value="White" />
<Setter Property="IconLocation"
Value="Left" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="Margin"
Value="5" />
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10,5,10,5">
<GroupBox Header="Features"
Margin="0,3,0,3">
<Grid Margin="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="190" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="160" />
</Grid.ColumnDefinitions>
<!-- First Column -->
<TextBlock Text="MaterialHamburger:"
Foreground="#FFC72035"
Grid.ColumnSpan="2" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialHamburger}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5,3,5,3" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="MenuLocation: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="2"
ItemsSource="{Binding Source={StaticResource HamburgerLocationEnumData}}"
SelectedItem="{Binding MenuLocation, ElementName=materialHamburger}"
SelectionChanged="MenuLocationComboBox_SelectionChanged"
Margin="5,3,5,3"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="0"
Grid.Row="3"
Text="Checked Content: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="3"
Margin="5,3,5,3"
VerticalContentAlignment="Center"
SelectedIndex="0"
SelectionChanged="CheckedContentComboBox_SelectionChanged">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Content 1"
Tag="{StaticResource CheckedContent1}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="4"
Text="Unchecked Content: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="4"
Margin="5,3,5,3"
VerticalContentAlignment="Center"
SelectedIndex="0"
SelectionChanged="UncheckedContentComboBox_SelectionChanged">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Content 1"
Tag="{StaticResource UncheckedContent1}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="5"
Text="Menu Owner: "
VerticalAlignment="Center" />
<ComboBox x:Name="toastOwnerComboBox"
Grid.Column="1"
Grid.Row="5"
Margin="5,3,5,3"
SelectedValue="{Binding MenuOwner, ElementName=materialHamburger}"
SelectedValuePath="Tag"
VerticalContentAlignment="Center">
<ComboBoxItem Content="Sample Window"
Tag="{x:Null}" />
<ComboBoxItem Content="LightBlue Border"
Tag="{Binding ElementName=LightBlueBorder}" />
<ComboBoxItem Content="LightGreen Border"
Tag="{Binding ElementName=LightGreenBorder}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="6"
Text="Menu Content: "
VerticalAlignment="Center" />
<ComboBox x:Name="menuContentComboBox"
Grid.Column="1"
Grid.Row="6"
Margin="5,3,5,3"
SelectedIndex="0"
VerticalContentAlignment="Center">
<ComboBoxItem Content="HamburgerMenu with items">
<ComboBoxItem.Tag>
<xctk:MaterialHamburgerMenu x:Name="materialHamburgerMenu"
Header="Xceed Products"
HeaderTemplate="{x:Null}"
CloseButtonLocation="Right"
Padding="0"
CloseButtonStyle="{StaticResource DefaultHamburgerMenuCloseButtonStyle}"
IsAnimatingItems="True">
<TextBlock Text="WPF Controls"
Foreground="Gray"
HorizontalAlignment="Center"
Margin="5" />
<xctk:IconButton Content="DataGrid For WPF"
Tag="https://xceed.com/xceed-datagrid-for-wpf/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/DataGrid.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="Toolkit For WPF"
Tag="https://xceed.com/xceed-toolkit-plus-for-wpf/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Toolkit.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="Business Suite For WPF"
Tag="https://xceed.com/xceed-business-suite-for-wpf/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Business.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<Separator Margin="0,20" />
<TextBlock Text=".NET Libraries"
HorizontalAlignment="Center"
Foreground="Gray"
Margin="5,0,5,5" />
<xctk:IconButton Content="Zip For .NET"
Tag="https://xceed.com/xceed-zip-for-net/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Zip.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="SFTP For .NET"
Tag="https://xceed.com/xceed-sftp-for-net/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/SFTP.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
<xctk:IconButton Content="Real-Time Zip For .NET"
Tag="https://xceed.com/xceed-real-time-zip-for-net/"
Click="IconButton_Click"
Style="{StaticResource IconButtonStyle}">
<xctk:IconButton.Icon>
<Image Source="../Resources/Zip.png"
Width="20"
Margin="5" />
</xctk:IconButton.Icon>
</xctk:IconButton>
</xctk:MaterialHamburgerMenu>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="Customized content"
Tag="{StaticResource CustomizedHamburgerContent}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="7"
Text="Can Resize Menu: "
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
Grid.Row="7"
Margin="5,3,5,3"
IsChecked="{Binding CanResizeMenu, ElementName=materialHamburger}"
VerticalContentAlignment="Center" />
<!-- Second Column -->
<TextBlock Text="MaterialHamburgerMenu:"
Foreground="#FFC72035"
Grid.Column="2"
Grid.ColumnSpan="2"
Margin="10,0,0,0" />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialHamburgerMenu}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}" />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Header: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<TextBox Grid.Column="3"
Grid.Row="2"
Text="{Binding Header, ElementName=materialHamburgerMenu}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}" />
<TextBlock Grid.Column="2"
Grid.Row="3"
Text="Header Template: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="3"
SelectedValue="{Binding HeaderTemplate, ElementName=materialHamburgerMenu}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Template 1"
Tag="{StaticResource MenuHeaderTemplate1}" />
</ComboBox>
<TextBlock Grid.Column="2"
Grid.Row="4"
Text="Close Button Location: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="4"
ItemsSource="{Binding Source={StaticResource LocationEnumData}}"
SelectedItem="{Binding CloseButtonLocation, ElementName=materialHamburgerMenu}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}" />
<TextBlock Grid.Column="2"
Grid.Row="5"
Text="Close Button Style: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="3"
Grid.Row="5"
SelectedValue="{Binding CloseButtonStyle, ElementName=materialHamburgerMenu}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultHamburgerMenuCloseButtonStyle}" />
<ComboBoxItem Content="Style 1"
Tag="{StaticResource HamburgerMenuCloseButtonStyle1}" />
</ComboBox>
<TextBlock Grid.Column="2"
Grid.Row="6"
Text="Is Animating Items: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<CheckBox Grid.Column="3"
Grid.Row="6"
IsChecked="{Binding IsAnimatingItems, ElementName=materialHamburgerMenu}"
VerticalAlignment="Center"
Margin="5,3,5,3"
IsEnabled="{Binding SelectedIndex, ElementName=menuContentComboBox, Converter={StaticResource ZeroToBoolConverter}}" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialHamburger x:Name="materialHamburger"
Margin="5"
MenuContent="{Binding SelectedItem.Tag, ElementName=menuContentComboBox}" />
<StackPanel Orientation="Horizontal">
<Border x:Name="LightBlueBorder"
Background="LightBlue"
Width="335"
Height="330"
Margin="5" />
<Border x:Name="LightGreenBorder"
Background="LightGreen"
Width="335"
Height="330"
Margin="5" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialHamburger.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialHamburger.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

124
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialListBoxView.xaml.txt

@ -27,7 +27,6 @@
<Run>MaterialListBox is a ListBox that is using the Material Brushes and contains MaterialListBoxItems.</Run> <Run>MaterialListBox is a ListBox that is using the Material Brushes and contains MaterialListBoxItems.</Run>
<LineBreak /> <LineBreak />
<Run>MaterialListBoxItems are ListBoxItems that are using the Material Brushes. They use an ink animation when they are selected.</Run> <Run>MaterialListBoxItems are ListBoxItems that are using the Material Brushes. They use an ink animation when they are selected.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -35,122 +34,17 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<xctk:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="135" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Is Ink Effect Active: "
VerticalAlignment="Center" />
<CheckBox x:Name="inkEffectActiveCheckBox"
Grid.Column="1"
Grid.Row="0"
IsChecked="{Binding IsInkEffectActive, ElementName=materialListBox}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Can be set a MaterialListBox control or individually on each MaterialListBoxItem." />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Ink Effect Brush: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:ColorPicker Grid.Column="1"
Grid.Row="1"
SelectedColor="{Binding InkEffectBrush, ElementName=materialListBox, Converter={StaticResource SolidColorBrushToColorConverter}}"
DisplayColorAndName="True"
VerticalAlignment="Center"
Width="125"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
ToolTip="Can be set a MaterialListBox control or individually on each MaterialListBoxItem." />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Ink Effect Opacity: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:DoubleUpDown Grid.Column="1"
Grid.Row="2"
Value="{Binding InkEffectOpacity, ElementName=materialListBox}"
Minimum="0"
Maximum="1"
Increment="0.05"
FormatString="N2"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
ToolTip="Can be set a MaterialListBox control or individually on each MaterialListBoxItem." />
<!-- Second Column-->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<ComboBox Grid.Column="3"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialListBox}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialListBox x:Name="materialListBox"
Margin="20"
HorizontalAlignment="Center"
SelectionMode="Extended"
IsInkEffectActive="True">
<xctk:MaterialListBoxItem Content="First Item"/>
<xctk:MaterialListBoxItem Content="Second Item" />
<xctk:MaterialListBoxItem Content="Third Item" />
<xctk:MaterialListBoxItem Content="Fourth Item" />
<xctk:MaterialListBoxItem Content="Fifth Item" />
</xctk:MaterialListBox>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialListBox.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialListBox.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

27
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.cs.txt

@ -33,45 +33,18 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
this.Loaded += this.MaterialProgressBarCircularView_Loaded;
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region Private Methods
private void AnimateDeterminateProgressBar()
{
var storyboard = new Storyboard();
// Animate Determinate Circular ProgressBar
DoubleAnimation valueAnim = new DoubleAnimation( materialDeterminateProgressBarCircular.Minimum, materialDeterminateProgressBarCircular.Maximum, System.TimeSpan.FromMilliseconds( 4000 ) );
Storyboard.SetTarget( valueAnim, materialDeterminateProgressBarCircular );
Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarCircular.ValueProperty ) );
storyboard.Children.Add( valueAnim );
storyboard.Begin( this );
}
#endregion
#region Event Handlers
private void MaterialProgressBarCircularView_Loaded( object sender, RoutedEventArgs e )
{
this.AnimateDeterminateProgressBar();
}
private void ResetButton_Click( object sender, RoutedEventArgs e )
{
this.AnimateDeterminateProgressBar();
}
#endregion
#endif
} }
} }

191
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarCircularView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A circular ProgressBar that uses the Material Brushes. It contains properties to animate the indeterminate state.</Run> <Run>A circular ProgressBar that uses the Material Brushes. It contains properties to animate the indeterminate state.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,7 +32,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -45,181 +43,18 @@
</ResourceDictionary> </ResourceDictionary>
</local:DemoView.Resources> </local:DemoView.Resources>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Text="Thickness: "
VerticalAlignment="Center" />
<xctk:DoubleUpDown x:Name="thicknessDoubleUpDown"
Grid.Column="1"
Value="25"
Minimum="1"
Maximum="40"
Margin="5"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialDeterminateProgressBarCircular}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Indeterminate Indicator Max Length: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="inteterminateIndicatorMaxLengthUpDown"
Grid.Column="3"
Grid.Row="0"
Value="{Binding IndeterminateIndicatorMaxLength, ElementName=materialIndeterminateProgressBarCircular}"
Minimum="{Binding Value, ElementName=inteterminateIndicatorMinLengthUpDown}"
Maximum="1"
Increment="0.01"
Margin="5"
Width="50"
FormatString="N2"
VerticalContentAlignment="Center"
ToolTip="The maximum percentage of the progress bar's size that the indicator will accept. Must be between 0 and 1."/>
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Indeterminate Indicator Min Length: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<xctk:DoubleUpDown x:Name="inteterminateIndicatorMinLengthUpDown"
Grid.Column="3"
Grid.Row="1"
Value="{Binding IndeterminateIndicatorMinLength, ElementName=materialIndeterminateProgressBarCircular}"
Minimum="0"
Maximum="{Binding Value, ElementName=inteterminateIndicatorMaxLengthUpDown}"
Increment="0.01"
Margin="5"
Width="50"
FormatString="N2"
VerticalContentAlignment="Center"
ToolTip="The minimum percentage of the progress bar's size that the indicator will accept. Must be between 0 and 1."/>
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Indeterminate Indicator Speed Ratio: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="2"
Value="{Binding IndeterminateIndicatorSpeedRatio, ElementName=materialIndeterminateProgressBarCircular}"
Minimum="0.1"
Maximum="5"
Increment="0.5"
Margin="5"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="2"
Grid.Row="3"
Text="Indeterminate Rotation Speed Ratio: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="3"
Value="{Binding IndeterminateRotationSpeedRatio, ElementName=materialIndeterminateProgressBarCircular}"
Minimum="0.1"
Maximum="5"
Increment="0.5"
Margin="5"
VerticalContentAlignment="Center" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<Grid HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Determinate:" />
<Grid Grid.Row="0"
Grid.Column="1"
Margin="20">
<xctk:MaterialProgressBarCircular x:Name="materialDeterminateProgressBarCircular"
IsIndeterminate="False"
Thickness="{Binding Value, ElementName=thicknessDoubleUpDown}"
Width="125"
Height="125"
Minimum="0"
Maximum="100" />
<TextBlock Text="{Binding Value, ElementName=materialDeterminateProgressBarCircular, StringFormat={}{0:N0}%}"
FontSize="15"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
<Button Grid.Row="0"
Grid.Column="2"
Content="Reset"
Click="ResetButton_Click"
VerticalAlignment="Center"
Padding="10" />
<TextBlock Grid.Row="1"
Grid.Column="0"
Text="Indeterminate:" />
<xctk:MaterialProgressBarCircular x:Name="materialIndeterminateProgressBarCircular"
Grid.Row="1"
Grid.Column="1"
IsIndeterminate="True"
Thickness="{Binding Value, ElementName=thicknessDoubleUpDown}"
MaterialAccentBrush="{Binding MaterialAccentBrush, ElementName=materialDeterminateProgressBarCircular}"
IndeterminateIndicatorSpeedRatio="1"
IndeterminateRotationSpeedRatio="1"
IndeterminateIndicatorMaxLength="0.75"
IndeterminateIndicatorMinLength="0.04"
Width="125"
Height="125"
Margin="20" />
</Grid>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialProgressBarCircular.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialProgressBarCircular.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

27
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarView.xaml.cs.txt

@ -32,46 +32,19 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
public MaterialProgressBarView() public MaterialProgressBarView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
this.Loaded += this.MaterialProgressBarView_Loaded;
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region Private Methods
private void AnimateDeterminateProgressBar()
{
var storyboard = new Storyboard();
// Animate Determinate ProgressBar
DoubleAnimation valueAnim = new DoubleAnimation( materialDeterminateProgressBar.Minimum, materialDeterminateProgressBar.Maximum, System.TimeSpan.FromMilliseconds( 4000 ) );
Storyboard.SetTarget( valueAnim, materialDeterminateProgressBar );
Storyboard.SetTargetProperty( valueAnim, new PropertyPath( MaterialProgressBarCircular.ValueProperty ) );
storyboard.Children.Add( valueAnim );
storyboard.Begin( this );
}
#endregion
#region Event Handlers
private void MaterialProgressBarView_Loaded( object sender, RoutedEventArgs e )
{
this.AnimateDeterminateProgressBar();
}
private void ResetButton_Click( object sender, RoutedEventArgs e )
{
this.AnimateDeterminateProgressBar();
}
#endregion
#endif
} }
} }

157
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialProgressBarView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A linear ProgressBar that uses the Material Brushes. It contains properties to animate the indeterminate state.</Run> <Run>A linear ProgressBar that uses the Material Brushes. It contains properties to animate the indeterminate state.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,7 +32,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -45,150 +43,15 @@
</ResourceDictionary> </ResourceDictionary>
</local:DemoView.Resources> </local:DemoView.Resources>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Indeterminate Indicator Max Length: "
VerticalAlignment="Center"/>
<xctk:DoubleUpDown x:Name="inteterminateIndicatorMaxLengthUpDown"
Grid.Column="1"
Grid.Row="0"
Value="{Binding IndeterminateIndicatorMaxLength, ElementName=materialIndeterminateProgressBar}"
Minimum="{Binding Value, ElementName=inteterminateIndicatorMinLengthUpDown}"
Maximum="1"
Increment="0.01"
Margin="5"
Width="50"
FormatString="N2"
VerticalContentAlignment="Center"
ToolTip="The maximum percentage of the progress bar's size that the indicator will accept. Must be between 0 and 1."/>
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Indeterminate Indicator Min Length: "
VerticalAlignment="Center"/>
<xctk:DoubleUpDown x:Name="inteterminateIndicatorMinLengthUpDown"
Grid.Column="1"
Grid.Row="1"
Value="{Binding IndeterminateIndicatorMinLength, ElementName=materialIndeterminateProgressBar}"
Minimum="0"
Maximum="{Binding Value, ElementName=inteterminateIndicatorMaxLengthUpDown}"
Increment="0.01"
Margin="5"
Width="50"
FormatString="N2"
VerticalContentAlignment="Center"
ToolTip="The minimum percentage of the progress bar's size that the indicator will accept. Must be between 0 and 1."/>
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Indeterminate Indicator Speed Ratio: "
VerticalAlignment="Center"/>
<xctk:DoubleUpDown Grid.Column="1"
Grid.Row="2"
Value="{Binding IndeterminateIndicatorSpeedRatio, ElementName=materialIndeterminateProgressBar}"
Minimum="0.1"
Maximum="5"
Increment="0.5"
Margin="5"
VerticalContentAlignment="Center" />
<!-- Second Column -->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialDeterminateProgressBar}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<Grid HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Determinate:" />
<StackPanel Grid.Row="0"
Grid.Column="1"
Orientation="Horizontal">
<xctk:MaterialProgressBar x:Name="materialDeterminateProgressBar"
IsIndeterminate="False"
Width="400"
Height="10"
Maximum="100"
Minimum="0"
Margin="20" />
<TextBlock Text="{Binding Value, ElementName=materialDeterminateProgressBar, StringFormat={}{0:N0}%}"
FontSize="15"
Width="45"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</StackPanel>
<Button Grid.Row="0"
Grid.Column="2"
Content="Reset"
Click="ResetButton_Click"
VerticalAlignment="Center"
Padding="10" />
<TextBlock Grid.Row="1"
Grid.Column="0"
Text="Indeterminate:" />
<xctk:MaterialProgressBar x:Name="materialIndeterminateProgressBar"
Grid.Row="1"
Grid.Column="1"
IsIndeterminate="True"
IndeterminateIndicatorSpeedRatio="1"
IndeterminateIndicatorMaxLength="0.25"
IndeterminateIndicatorMinLength="0"
MaterialAccentBrush="{Binding MaterialAccentBrush, ElementName=materialDeterminateProgressBar}"
Width="400"
Height="10"
Margin="20"
HorizontalAlignment="Left"/>
</Grid>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialProgressBar.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialProgressBar.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

64
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialRadioButtonView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A RadioButton with transition animations when the checked state is changed. It uses the Material Brushes.</Run> <Run>A RadioButton with transition animations when the checked state is changed. It uses the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,78 +32,15 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Text="Check Mark Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
VerticalAlignment="Center"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding CheckMarkBrush, ElementName=materialRadioButton}"
ItemTemplate="{StaticResource ColorItemTemplate}"
Margin="5"/>
<!-- Second Column -->
<TextBlock Grid.Column="2"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<ComboBox Grid.Column="3"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialRadioButton}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel HorizontalAlignment="Center">
<xctk:MaterialRadioButton x:Name="materialRadioButton"
GroupName="Choice"
IsChecked="True"
Content="First" />
<xctk:MaterialRadioButton x:Name="materialRadioButton2"
GroupName="Choice"
Content="Second"
CheckMarkBrush="{Binding CheckMarkBrush, ElementName=materialRadioButton}"
MaterialAccentBrush="{Binding MaterialAccentBrush, ElementName=materialRadioButton}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialRadioButton.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialRadioButton.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

280
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialSliderView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A Slider with customizable and animated thumb and bubble that is using the Material Brushes.</Run> <Run>A Slider with customizable and animated thumb and bubble that is using the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,310 +33,31 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<winConv:IntToBoolConverter x:Key="IntToBoolConverter" />
<xctk:InverseBoolConverter x:Key="InverseBoolConverter" />
<ObjectDataProvider x:Key="SliderEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:MaterialSliderModeEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="SliderBubbleLocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:MaterialSliderBubbleLocationEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="SliderOrientationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="Orientation" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<DataTemplate x:Key="MaterialSliderBubbleTemplate1">
<Border Background="Black"
Padding="7">
<TextBlock Text="{Binding ., StringFormat=N1}"
FontSize="12"
Foreground="White"
HorizontalAlignment="Center" />
</Border>
</DataTemplate>
<DataTemplate x:Key="MaterialSliderBubbleTemplate2">
<Grid>
<Ellipse Fill="Red"
Width="60"
Height="60"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<TextBlock Text="{Binding ., StringFormat=N2}"
FontSize="20"
Foreground="Yellow"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Grid>
</DataTemplate>
<Style x:Key="MaterialSliderThumbStyle1"
TargetType="{x:Type Thumb}">
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="Width"
Value="10" />
<Setter Property="Height"
Value="10" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Grid>
<Border x:Name="border"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="Center"
BorderBrush="Orange"
BorderThickness="2"
Background="Black" />
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource TemplatedParent}}"
Value="True">
<Setter Property="BorderBrush"
Value="Green"
TargetName="border" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialSliderThumbStyle2"
TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Grid>
<Image Source="..\Resources\PencilTool16.png"
Stretch="None" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Mode: "
VerticalAlignment="Center" />
<ComboBox x:Name="modeComboBox"
Grid.Column="1"
Grid.Row="0"
ItemsSource="{Binding Source={StaticResource SliderEnumData}}"
SelectedItem="{Binding Mode, ElementName=materialSlider}"
Width="100"
VerticalAlignment="Center"
Margin="5" />
<TextBlock x:Name="bubbleTemplateTextBlock"
Grid.Column="0"
Grid.Row="1"
Text="Bubble Template: "
VerticalAlignment="Center"
IsEnabled="{Binding SelectedIndex, ElementName=modeComboBox, Converter={StaticResource IntToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="1"
Grid.Row="1"
SelectedValue="{Binding BubbleTemplate, ElementName=materialSlider}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding SelectedIndex, ElementName=modeComboBox, Converter={StaticResource IntToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Template 1"
Tag="{StaticResource MaterialSliderBubbleTemplate1}" />
<ComboBoxItem Content="Template 2"
Tag="{StaticResource MaterialSliderBubbleTemplate2}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Bubble Location: "
VerticalAlignment="Center"
IsEnabled="{Binding SelectedIndex, ElementName=modeComboBox, Converter={StaticResource IntToBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="1"
Grid.Row="2"
ItemsSource="{Binding Source={StaticResource SliderBubbleLocationEnumData}}"
SelectedItem="{Binding BubbleLocation, ElementName=materialSlider}"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding SelectedIndex, ElementName=modeComboBox, Converter={StaticResource IntToBoolConverter}}"
Style="{StaticResource DisableGrayComboBox}"
ToolTip="The location of the Slider's bubble. If its orientation is Vertical : Over will be on the left and under will be on the right of the slider."/>
<!-- Second Column -->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Thumb Style: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="0"
SelectedValue="{Binding ThumbStyle, ElementName=materialSlider}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Width="70"
Margin="5">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Style 1"
Tag="{StaticResource MaterialSliderThumbStyle1}" />
<ComboBoxItem Content="Style 2"
Tag="{StaticResource MaterialSliderThumbStyle2}" />
</ComboBox>
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Thumb Resize Scale Factor: "
VerticalAlignment="Center"
Margin="10,0,0,0"
IsEnabled="{Binding IsEnabled, ElementName=bubbleTemplateTextBlock, Converter={StaticResource InverseBoolConverter}}"
Style="{StaticResource DisableGrayText}" />
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="1"
Value="{Binding ThumbResizeScaleFactor, ElementName=materialSlider}"
Minimum="0.6"
Maximum="4"
Increment="0.1"
FormatString="N1"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding IsEnabled, ElementName=bubbleTemplateTextBlock, Converter={StaticResource InverseBoolConverter}}" />
<!--Third Column-->
<TextBlock Grid.Column="4"
Grid.Row="0"
Text="Show Ticks: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<CheckBox Grid.Column="5"
Grid.Row="0"
IsChecked="{Binding ShowTicks, ElementName=materialSlider}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="4"
Grid.Row="1"
Text="Orientation: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="5"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource SliderOrientationEnumData}}"
SelectedItem="{Binding Orientation, ElementName=materialSlider}"
VerticalAlignment="Center"
Width="90"
Margin="5" />
<TextBlock Grid.Column="4"
Grid.Row="2"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="5"
Grid.Row="2"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialSlider}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialSlider x:Name="materialSlider"
Maximum="10"
Minimum="0"
Value="2"
Margin="20"
ShowTicks="True"
Mode="WithBubble"
BubbleTemplate="{x:Null}"
ThumbStyle="{x:Null}"
Orientation="Horizontal">
<xctk:MaterialSlider.Resources>
<Style TargetType="xctk:MaterialSlider">
<Style.Triggers>
<Trigger Property="Orientation"
Value="Horizontal">
<Setter Property="Width"
Value="500" />
</Trigger>
<Trigger Property="Orientation"
Value="Vertical">
<Setter Property="Height"
Value="300" />
</Trigger>
</Style.Triggers>
</Style>
</xctk:MaterialSlider.Resources>
</xctk:MaterialSlider>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialSlider.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialSlider.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

101
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialSwitchView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A ToggleSwitch from the Xceed WPF Toolkit with thumb animations when Checked state is changed and that is using the Material Brushes.</Run> <Run>A ToggleSwitch from the Xceed WPF Toolkit with thumb animations when Checked state is changed and that is using the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,99 +32,17 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<Path x:Key="UnPinPath"
Data="M537.76,0L767,237.883 699.552,307.874 654.177,260.828 449.89,472.781 460.135,483.414 447.983,639.291 336.562,523.67 0,767 265.122,449.537 154.528,334.849 304.815,322.276 311.431,329.066 336,303.562 336,300 339.432,300 515.648,117.076 470.311,69.9921z"
Stretch="Uniform"
Margin="6"
Fill="White" />
<Path x:Key="PinPath"
Data="M537.76,0L767,237.883 699.552,307.874 654.177,260.828 449.89,472.781 460.135,483.414 447.983,639.291 336.562,523.67 0,767 265.122,449.537 154.528,334.849 304.815,322.276 311.431,329.066 336,303.562 336,300 339.432,300 515.648,117.076 470.311,69.9921z"
Stretch="Uniform"
Margin="6"
Fill="White"
RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<RotateTransform Angle="-45" />
</Path.RenderTransform>
</Path>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialSwitch}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Thumb Checked Background: "
VerticalAlignment="Center"
Margin="10,0,0,0"/>
<ComboBox Grid.Column="3"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding ThumbCheckedBackground, ElementName=materialSwitch}"
ItemTemplate="{StaticResource ColorItemTemplate}"
ToolTip="Background used when MaterialSwitch is checked. ThumbBackground property will be used when unchecked."
Margin="5"/>
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialSwitch x:Name="materialSwitch"
Margin="20"
HorizontalAlignment="Center"
Width="60"
MinHeight="18"
ThumbBackground="Gray"
ThumbLeftContent="{StaticResource UnPinPath}"
ThumbRightContent="{StaticResource PinPath}"/>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialSwitch.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialSwitch.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

229
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialTabsView.xaml.txt

@ -27,7 +27,6 @@
<Run>MaterialTabControl is a a TabControl with animated transitions when the current selection is changed. Is is using the Material Brushes and contains MaterialTabItems.</Run> <Run>MaterialTabControl is a a TabControl with animated transitions when the current selection is changed. Is is using the Material Brushes and contains MaterialTabItems.</Run>
<LineBreak /> <LineBreak />
<Run>MaterialTabItems are TabItems that are using the Material Brushes and who contains customizable ink animations on mouse press.</Run> <Run>MaterialTabItems are TabItems that are using the Material Brushes and who contains customizable ink animations on mouse press.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -35,220 +34,24 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<GroupBox Header="MaterialTabControl Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Is Ink Bar Active: "
VerticalAlignment="Center" />
<CheckBox x:Name="inkBarActiveCheckBox"
Grid.Column="1"
Grid.Row="0"
IsChecked="{Binding IsInkBarActive, ElementName=materialTabControl}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Ink Bar Brush: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkBarActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding InkBarBrush, ElementName=materialTabControl}"
ItemTemplate="{StaticResource ColorItemTemplate}"
IsEnabled="{Binding IsChecked, ElementName=inkBarActiveCheckBox}"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Is Sliding Animation Active: "
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
Grid.Row="2"
IsChecked="{Binding IsSlidingAnimationActive, ElementName=materialTabControl}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<GroupBox Header="MaterialTabItem Features"
Grid.Column="1"
Margin="10,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Is Ink Effect Active: "
VerticalAlignment="Center" />
<CheckBox x:Name="inkEffectActiveCheckBox"
Grid.Column="1"
Grid.Row="0"
IsChecked="{Binding IsInkEffectActive, ElementName=materialTabControl}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Can be set on a MaterialTabControl control or individually on each MaterialTabItem." />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Ink Effect Brush: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding InkEffectBrush, ElementName=materialTabControl}"
ItemTemplate="{StaticResource ColorItemTemplate}"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Margin="5"
ToolTip="Can be set on a MaterialTabControl control or individually on each MaterialTabItem." />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Ink Effect Opacity: "
VerticalAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
Style="{StaticResource DisableGrayText}" />
<xctk:DoubleUpDown Grid.Column="1"
Grid.Row="2"
Value="{Binding InkEffectOpacity, ElementName=materialTabControl}"
Minimum="0"
Maximum="1"
Increment="0.05"
FormatString="N2"
VerticalAlignment="Center"
Margin="5"
IsEnabled="{Binding IsChecked, ElementName=inkEffectActiveCheckBox}"
ToolTip="Can be set on a MaterialTabControl control or individually on each MaterialTabItem." />
<TextBlock Grid.Column="0"
Grid.Row="3"
Text="Selected Foreground: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="3"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding SelectedForeground, ElementName=materialTabControl}"
ItemTemplate="{StaticResource ColorItemTemplate}"
Margin="5"
ToolTip="Can be set on a MaterialTabControl control or individually on each MaterialTabItem." />
</Grid>
</GroupBox>
</Grid>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="TabStripPlacement is Top:"
Margin="20" />
<xctk:MaterialTabControl x:Name="materialTabControl"
TabStripPlacement="Top"
IsInkEffectActive="True"
IsInkBarActive="True"
IsSlidingAnimationActive="True">
<xctk:MaterialTabItem Header="First"
HorizontalContentAlignment="Center"
Content="MaterialTabItem #1" />
<xctk:MaterialTabItem Header="Second"
HorizontalContentAlignment="Center"
Content="MaterialTabItem #2" />
<xctk:MaterialTabItem Header="Third"
HorizontalContentAlignment="Center"
Content="MaterialTabItem #3" />
<xctk:MaterialTabItem Header="Fourth"
HorizontalContentAlignment="Center"
Content="MaterialTabItem #4" />
<xctk:MaterialTabItem Header="Fifth"
HorizontalContentAlignment="Center"
Content="MaterialTabItem #5" />
</xctk:MaterialTabControl>
</StackPanel>
<StackPanel Orientation="Horizontal"
Margin="0,40,0,0">
<TextBlock Text="TabStripPlacement is Left:"
Margin="20" />
<xctk:MaterialTabControl x:Name="leftMaterialTabs"
TabStripPlacement="Left"
IsInkEffectActive="{Binding IsInkEffectActive, ElementName=materialTabControl}"
InkEffectBrush="{Binding InkEffectBrush, ElementName=materialTabControl}"
InkEffectOpacity="{Binding InkEffectOpacity, ElementName=materialTabControl}"
InkBarBrush="{Binding InkBarBrush, ElementName=materialTabControl}"
SelectedForeground="{Binding SelectedForeground, ElementName=materialTabControl}"
IsInkBarActive="{Binding IsInkBarActive, ElementName=materialTabControl}"
IsSlidingAnimationActive="{Binding IsSlidingAnimationActive, ElementName=materialTabControl}">
<xctk:MaterialTabItem Header="First"
VerticalContentAlignment="Center"
Content="MaterialTabItem #1" />
<xctk:MaterialTabItem Header="Second"
VerticalContentAlignment="Center"
Content="MaterialTabItem #2" />
<xctk:MaterialTabItem Header="Third"
VerticalContentAlignment="Center"
Content="MaterialTabItem #3" />
<xctk:MaterialTabItem Header="Fourth"
VerticalContentAlignment="Center"
Content="MaterialTabItem #4" />
<xctk:MaterialTabItem Header="Fifth"
VerticalContentAlignment="Center"
Content="MaterialTabItem #5" />
</xctk:MaterialTabControl>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialTabs.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialTabs.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

216
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialTextFieldView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A TextBox containing a customizable animated watermark that remains active when text is entered. It uses the Material Brushes.</Run> <Run>A TextBox containing a customizable animated watermark that remains active when text is entered. It uses the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,207 +33,24 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="TextFieldEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:MaterialTextFieldModeEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<DataTemplate x:Key="TextFieldTemplate1">
<Border Background="#FF49A9F5">
<TextBlock Text="{Binding}"
Foreground="White" />
</Border>
</DataTemplate>
<DataTemplate x:Key="TextFieldTemplate2">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\building16.png"
Stretch="None" />
<TextBlock Text="{Binding}"
Foreground="Black"
Margin="4,0,0,0" />
</StackPanel>
</DataTemplate>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Text="Watermark: "
VerticalAlignment="Center" />
<TextBox Grid.Column="1"
Text="{Binding Watermark, ElementName=materialTextField, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Width="250"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Watermark Mode: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource TextFieldEnumData}}"
SelectedItem="{Binding WatermarkMode, ElementName=materialTextField}"
Width="95"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Watermark Template: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Grid.Row="2"
SelectedValue="{Binding WatermarkTemplate, ElementName=materialTextField}"
SelectedValuePath="Tag"
Width="95"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="5">
<ComboBoxItem Content="None"
Tag="{x:Null}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource TextFieldTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource TextFieldTemplate2}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="3"
Text="Watermark Scale Factor: "
VerticalAlignment="Center" />
<xctk:DoubleUpDown Grid.Column="1"
Grid.Row="3"
Value="{Binding WatermarkScaleFactor, ElementName=materialTextField}"
Minimum="0"
Maximum="5"
Increment="0.1"
FormatString="N1"
Width="70"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5" />
<!-- Second Column-->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Watermark Foreground: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes,RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding WatermarkForeground, ElementName=materialTextField}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Watermark Focus Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="1"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding WatermarkFocusBrush, ElementName=materialTextField}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Line Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="2"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding LineBrush, ElementName=materialTextField}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2"
Grid.Row="3"
Text="Line Focus Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="3"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding LineFocusBrush, ElementName=materialTextField}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialTextField x:Name="materialTextField"
Watermark="Company"
Width="250"
Margin="100"
WatermarkForeground="{Binding MaterialBrushes[17], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
WatermarkScaleFactor="0.7"
WatermarkMode="OnFocus"
LineBrush="{Binding MaterialBrushes[17], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}">
<xctk:MaterialTextField.Text>
<Binding Path="Text"
ElementName="testTextBox"
UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<sample:RequiredRule />
</Binding.ValidationRules>
</Binding>
</xctk:MaterialTextField.Text>
</xctk:MaterialTextField>
<TextBox x:Name="testTextBox"
Visibility="Collapsed" />
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialTextField.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialTextField.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToastView.xaml.cs.txt

@ -30,21 +30,5 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void ToastButton_Click( object sender, RoutedEventArgs e )
{
var materialToast = new MaterialToast( ( ( ComboBoxItem )toastOwnerComboBox.SelectedItem ).Tag as FrameworkElement );
materialToast.MaterialAccentBrush = (SolidColorBrush)toastMaterialAccentBrushComboBox.SelectedItem;
materialToast.Location = ( MaterialToastLocationEnum )toastLocationComboBox.SelectedItem;
materialToast.SlidingDirection = ( Orientation )toastSlidingDirectionComboBox.SelectedItem;
materialToast.Content = "Simple Toast";
materialToast.DisplayTime = System.TimeSpan.FromMilliseconds( toastDisplayTimeIntegerUpDown.Value.Value );
materialToast.HideOnClick = toastHideOnclickCheckBox.IsChecked.Value;
materialToast.IsCloseButtonVisible = toastIsCloseButtonVisibleCheckBox.IsChecked.Value;
materialToast.CloseButtonStyle = ( ( ComboBoxItem )toastClosebuttonStyleComboBox.SelectedItem ).Tag as Style;
materialToast.CornerRadius = new CornerRadius( toastCornerRadiusIntegerUpDown.Value.Value );
materialToast.ShowToast();
}
#endif
} }
} }

271
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToastView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A ContentControl that can be customized to display a content in any corner of any window or FrameworkElement. It is using the Material Brushes.</Run> <Run>A ContentControl that can be customized to display a content in any corner of any window or FrameworkElement. It is using the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,296 +32,26 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="ToastLocationEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:MaterialToastLocationEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="ToastSlidingDirectionEnumData"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="Orientation" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<Style x:Key="MaterialToastCloseButtonStyle1"
TargetType="{x:Type Button}">
<Setter Property="Margin"
Value="2" />
<Setter Property="Content"
Value="OK" />
<Setter Property="Foreground"
Value="Yellow" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="BorderBrush"
Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Green" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--First Column-->
<TextBlock Grid.Column="0"
Text="Owner: "
VerticalAlignment="Center" />
<ComboBox x:Name="toastOwnerComboBox"
Grid.Column="1"
SelectedIndex="0"
Width="125"
Margin="5"
VerticalContentAlignment="Center"
HorizontalAlignment="Left">
<ComboBoxItem Content="LightBlue Border"
Tag="{Binding ElementName=lightBlueBorder}" />
<ComboBoxItem Content="LightGreen Border"
Tag="{Binding ElementName=greenBlueBorder}" />
<ComboBoxItem Content="Sample Window"
Tag="{x:Null}" />
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Location: "
VerticalAlignment="Center" />
<ComboBox x:Name="toastLocationComboBox"
Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource ToastLocationEnumData}}"
SelectedIndex="0"
Margin="5"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Sliding Direction: "
VerticalAlignment="Center" />
<ComboBox x:Name="toastSlidingDirectionComboBox"
Grid.Column="1"
Grid.Row="2"
ItemsSource="{Binding Source={StaticResource ToastSlidingDirectionEnumData}}"
Tag="{Binding SelectedItem, ElementName=toastLocationComboBox}"
Margin="5"
VerticalContentAlignment="Center">
<ComboBox.Style>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="SelectedIndex"
Value="1" />
<Setter Property="IsEnabled"
Value="True" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource Self}}"
Value="{x:Static xctk:MaterialToastLocationEnum.Right}">
<Setter Property="SelectedIndex"
Value="0" />
<Setter Property="IsEnabled"
Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource Self}}"
Value="{x:Static xctk:MaterialToastLocationEnum.Left}">
<Setter Property="SelectedIndex"
Value="0" />
<Setter Property="IsEnabled"
Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource Self}}"
Value="{x:Static xctk:MaterialToastLocationEnum.Top}">
<Setter Property="SelectedIndex"
Value="1" />
<Setter Property="IsEnabled"
Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource Self}}"
Value="{x:Static xctk:MaterialToastLocationEnum.Bottom}">
<Setter Property="SelectedIndex"
Value="1" />
<Setter Property="IsEnabled"
Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>
<TextBlock Grid.Column="0"
Grid.Row="3"
Text="Corner Radius: "
VerticalAlignment="Center" />
<xctk:IntegerUpDown x:Name="toastCornerRadiusIntegerUpDown"
Grid.Column="1"
Grid.Row="3"
Value="2"
Minimum="0"
Maximum="30"
Increment="1"
Margin="5"
VerticalContentAlignment="Center" />
<!-- Second Column -->
<TextBlock Grid.Column="2"
Text="Display Time: "
VerticalAlignment="Center"
Margin="7,0,0,0" />
<xctk:IntegerUpDown x:Name="toastDisplayTimeIntegerUpDown"
Grid.Column="3"
Value="3000"
Minimum="0"
Maximum="10000"
Increment="500"
Margin="5"
VerticalContentAlignment="Center"
ToolTip="Duration in milliseconds for displaying a toast after it's completely popped in and before it starts popping out. 0 will keep the toast popped in." />
<TextBlock Grid.Column="2"
Grid.Row="1"
Text="Hide On Click: "
VerticalAlignment="Center"
Margin="7,0,0,0" />
<CheckBox x:Name="toastHideOnclickCheckBox"
Grid.Column="3"
Grid.Row="1"
IsChecked="False"
Margin="5"
VerticalContentAlignment="Center"
ToolTip="When true, clicking anywhere on a toast will close it." />
<TextBlock Grid.Column="2"
Grid.Row="2"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="7,0,0,0"/>
<ComboBox x:Name="toastMaterialAccentBrushComboBox"
Grid.Column="3"
Grid.Row="2"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialBrushes[6], RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
Width="95"
ItemTemplate="{StaticResource ColorItemTemplate}"
Margin="5"/>
<!-- Third Column-->
<TextBlock Grid.Column="4"
Grid.Row="0"
Text="Is Close Button Visible: "
VerticalAlignment="Center"
Margin="7,0,0,0" />
<CheckBox x:Name="toastIsCloseButtonVisibleCheckBox"
Grid.Column="5"
Grid.Row="0"
IsChecked="False"
Margin="5"
VerticalContentAlignment="Center" />
<TextBlock Grid.Column="4"
Grid.Row="1"
Text="Close Button Style: "
VerticalAlignment="Center"
Margin="7,0,0,0"
IsEnabled="{Binding IsChecked, ElementName=toastIsCloseButtonVisibleCheckBox}"
Style="{StaticResource DisableGrayText}" />
<ComboBox x:Name="toastClosebuttonStyleComboBox"
Grid.Column="5"
Grid.Row="1"
Width="85"
Margin="5"
SelectedIndex="0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
IsEnabled="{Binding IsChecked, ElementName=toastIsCloseButtonVisibleCheckBox}"
Style="{StaticResource DisableGrayComboBox}">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="OK Button"
Tag="{StaticResource MaterialToastCloseButtonStyle1}" />
</ComboBox>
<Button Grid.Row="2"
Grid.Column="4"
Grid.ColumnSpan="2"
Content="Pop Toast!"
Margin="7,0,0,0"
Padding="5"
Click="ToastButton_Click" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<Border x:Name="lightBlueBorder"
Background="LightBlue"
Width="300"
Height="280"
Margin="20" />
<Border x:Name="greenBlueBorder"
Background="LightGreen"
Width="300"
Height="280"
Margin="20" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialToast.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialToast.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

62
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MaterialToolTipView.xaml.txt

@ -25,7 +25,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>A ToolTip with animations when opening. It is using the Material Brushes.</Run> <Run>A ToolTip with animations when opening. It is using the Material Brushes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,7 +32,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -45,70 +43,10 @@
</ResourceDictionary> </ResourceDictionary>
</local:DemoView.Resources> </local:DemoView.Resources>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Material Accent Brush: "
VerticalAlignment="Center" />
<ComboBox x:Name="materialAccentBrushComboBox"
Grid.Column="1"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialButton}"
ItemTemplate="{StaticResource ColorItemTemplate}"
Width="95"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:MaterialButton x:Name="materialButton"
Content="MaterialButton using MaterialToolTip"
Margin="20"
Padding="5"
HorizontalAlignment="Center">
<xctk:MaterialButton.ToolTip>
<xctk:MaterialToolTip Placement="Mouse"
DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}"
MaterialAccentBrush="{Binding MaterialAccentBrush}">
<StackPanel Orientation="Horizontal">
<ContentControl>
<ContentControl.Content>
<Path Data="M17.071346,6.6599999C17.78875,8.1508932 18.122005,9.9854851 17.917633,11.917816 17.780151,13.210711 17.415701,14.404805 16.885771,15.449L15.177,14.644304C15.617841,13.787608 15.9243,12.790113 16.036884,11.719817 16.208162,10.105325 15.913901,8.568861 15.306683,7.365747z M20.566984,5.2669997C21.512329,7.3320866 21.947803,9.7617378 21.678318,12.318976 21.49543,14.033849 21.006458,15.634024 20.297501,17.052L18.59,16.251213C19.210964,15.018133 19.637339,13.622355 19.796829,12.11588 20.034515,9.8762961 19.647739,7.7448602 18.813787,5.9662089z M13.335,0L13.335,21.334999 5.6516771,14.88951 0,14.88951 0,6.4454007 5.6543674,6.4454007z"
Stretch="Uniform"
Fill="{Binding MaterialAccentBrush}"
Width="15"
Height="15" />
</ContentControl.Content>
</ContentControl>
<TextBlock Text="Press to increment volume."
Margin="5,0,0,0"/>
</StackPanel>
</xctk:MaterialToolTip>
</xctk:MaterialButton.ToolTip>
</xctk:MaterialButton>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialToolTip.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MaterialToolTip.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView> </local:MaterialDemoView>

88
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiCalendarView.xaml.cs.txt

@ -28,100 +28,18 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.MultiCalendar.Views
{ {
public MultiCalendarView() public MultiCalendarView()
{ {
#if !OPEN_SOURCE
this.Initialized += new EventHandler( this.MultiCalendarView_Initialized );
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void MultiCalendarView_Initialized( object sender, EventArgs e )
{
int year = System.DateTime.Now.Year;
int month = System.DateTime.Now.Month;
_multiCalendar.DisplayDateStart = new System.DateTime( year - 1, 1, 1 );
_multiCalendar.DisplayDateEnd = new System.DateTime( year + 3, 12, 31 );
_multiCalendar2.DisplayDateStart = new System.DateTime( year, month, 1 );
var endYear = (month <= 9) ? year : year + 1;
var endMonth = (month + 3) % 12;
var endDay = System.DateTime.DaysInMonth( endYear, endMonth );
var endDate = new System.DateTime( endYear, endMonth, endDay );
_multiCalendar2.DisplayDateEnd = endDate;
_multiCalendar2.HighlightedDates.Add( new System.DateTime( year, month, 12 ) );
_multiCalendar2.HighlightedDates.Add( new System.DateTime( year, month, 20 ) );
_multiCalendar2.SelectedDates.Add( new System.DateTime( year, month, 21 ) );
_multiCalendar2.SelectedDates.Add( new System.DateTime( year, month, 22 ) );
_multiCalendar2.SelectedDates.Add( new System.DateTime( year, month, 23 ) );
var blackoutStart = _multiCalendar2.DisplayDateStart.AddMonths( 1 );
blackoutStart.AddDays( 10 );
_multiCalendar2.BlackoutDates.Add( new CalendarDateRange( blackoutStart.AddDays( 10 ), blackoutStart.AddDays( 15 ) ) );
}
private void BlackoutDates_Click( object sender, RoutedEventArgs e )
{
var cb = sender as CheckBox;
_multiCalendar.BlackoutDates.Clear();
if( cb.IsChecked.HasValue && cb.IsChecked.Value )
{
//We don't want to blackout selected dates
_multiCalendar.SelectedDates.Clear();
var firstDate = _multiCalendar.FirstDisplayedDate;
// Current Month
var startDate = new System.DateTime( firstDate.Year, firstDate.Month, 8 );
var endDate = new System.DateTime( firstDate.Year, firstDate.Month, 14 );
_multiCalendar.BlackoutDates.Add( new CalendarDateRange( startDate, endDate ) );
// Next Month
startDate = startDate.AddMonths( 1 );
endDate = endDate.AddMonths( 1 );
_multiCalendar.BlackoutDates.Add( new CalendarDateRange( startDate, endDate ) );
}
}
private void HighlightedDates_Click( object sender, RoutedEventArgs e )
{
var cb = sender as CheckBox;
_multiCalendar.HighlightedDates.Clear();
if( cb.IsChecked.HasValue && cb.IsChecked.Value )
{
for( int i = 0; i < 3; i++ )
{
System.DateTime date = _multiCalendar.FirstDisplayedDate.AddMonths( i );
for( int j = 1; j < 5; j++ )
{
_multiCalendar.HighlightedDates.Add( new System.DateTime( date.Year, date.Month, j * 5 ) );
}
}
}
}
private void MonthlyBackgrounds_Click( object sender, RoutedEventArgs e )
{
var cb = sender as CheckBox;
_multiCalendar2.MonthlyBackgrounds.Clear();
if( cb.IsChecked.HasValue && cb.IsChecked.Value )
{
// TODO : Replace these test images with our own custom examples
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 1, new SolidColorBrush( System.Windows.Media.Color.FromArgb(128, 0, 0, 255 ) ) ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 2, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/February.jpg", UriKind.RelativeOrAbsolute ), 0.2 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 3, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/March.jpg", UriKind.RelativeOrAbsolute ), 0.5 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 4, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/April.jpg", UriKind.RelativeOrAbsolute ), 0.2 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 5, new SolidColorBrush( System.Windows.Media.Color.FromArgb( 128, 0, 255, 0 ) ) ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 6, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/June.jpg", UriKind.RelativeOrAbsolute ), 0.5 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 7, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/July.jpg", UriKind.RelativeOrAbsolute ), 0.2 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 8, new SolidColorBrush( System.Windows.Media.Color.FromArgb( 128, 255, 0, 0 ) ) ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 9, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/September.jpg", UriKind.RelativeOrAbsolute ), 0.5 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 10, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/October.jpg", UriKind.RelativeOrAbsolute ), 0.2 ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 11, new SolidColorBrush( System.Windows.Media.Color.FromArgb( 128, 255, 255, 255 ) ) ) );
_multiCalendar2.MonthlyBackgrounds.Add( new MonthlyBackgroundData( 12, new Uri( "pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/MultiCalendar/Resources/December.jpg", UriKind.RelativeOrAbsolute ), 0.5 ) );
}
}
#endif
} }
} }

775
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiCalendarView.xaml.txt

@ -30,7 +30,6 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>The Background/Foreground of any CalendarDayButton can be easily customized based on its state(selected/highlighted/blackout/mouseOver/focused/today) and the background of any Calendar can be customized with an image or a brush.</Run> <Run>The Background/Foreground of any CalendarDayButton can be easily customized based on its state(selected/highlighted/blackout/mouseOver/focused/today) and the background of any Calendar can be customized with an image or a brush.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -38,728 +37,72 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<conv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter"/>
<conv:ThicknessToDoubleConverter x:Key="ThicknessToDoubleConverter"/>
<ObjectDataProvider x:Key="SelectModes"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="CalendarSelectionMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="OrientationModes"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="Orientation" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<Style x:Key="ButtonStyle1Base"
TargetType="Button">
<Setter Property="Background"
Value="Green" />
<Setter Property="Foreground"
Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Cursor="Hand"
Background="{TemplateBinding Background}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<ContentPresenter Margin="2" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Opacity"
Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="LightGreen" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="NextButtonStyle1"
TargetType="Button"
BasedOn="{StaticResource ButtonStyle1Base}">
<Setter Property="Content"
Value="Next"/>
</Style>
<Style x:Key="PreviousButtonStyle1"
TargetType="Button"
BasedOn="{StaticResource ButtonStyle1Base}">
<Setter Property="Content"
Value="Prev" />
</Style>
<Style x:Key="ButtonStyle2Base"
TargetType="Button"
BasedOn="{StaticResource ButtonStyle1Base}">
<Setter Property="Background"
Value="Blue" />
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="LightBlue" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="NextButtonStyle2"
TargetType="Button"
BasedOn="{StaticResource ButtonStyle2Base}">
<Setter Property="Content">
<Setter.Value>
<Path Stroke="White"
Data="M 3 10 L 8 5 L 3 0"
Stretch="Uniform"
Margin="3"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PreviousButtonStyle2"
TargetType="Button"
BasedOn="{StaticResource ButtonStyle2Base}">
<Setter Property="Content">
<Setter.Value>
<Path Stroke="White"
Data="M 3 10 L -2 5 L 3 0"
Stretch="Uniform"
Margin="3" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="HeaderButtonStyle1"
TargetType="Button">
<Setter Property="FontWeight"
Value="Bold" />
<Setter Property="Focusable"
Value="False" />
<Setter Property="FontSize"
Value="15" />
<Setter Property="Background"
Value="Green" />
<Setter Property="Foreground"
Value="White" />
<Setter Property="Margin"
Value="1" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="HorizontalAlignment"
Value="Center" />
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Cursor="Hand"
BorderBrush="Yellow"
BorderThickness="2"
CornerRadius="3"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="1"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="HeaderButtonStyle2"
TargetType="Button">
<Setter Property="Focusable"
Value="False" />
<Setter Property="Background"
Value="Transparent"/>
<Setter Property="BorderThickness"
Value="0"/>
<Setter Property="FontStyle"
Value="Italic"/>
<Setter Property="Foreground"
Value="Blue" />
<Setter Property="Margin"
Value="1" />
</Style>
<DataTemplate x:Key="DayTitleTemplate1">
<TextBlock Foreground="#FF333333"
FontWeight="Bold"
FontSize="9.5"
FontFamily="Verdana"
Margin="0,6,0,6"
Text="{Binding}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</DataTemplate>
<DataTemplate x:Key="DayTitleTemplate2">
<TextBlock Foreground="Green"
FontWeight="Bold"
FontSize="15"
FontStyle="Italic"
Text="{Binding}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</DataTemplate>
<DataTemplate x:Key="BlackoutTemplate1">
<Border Background="Red"
Margin="5,4" />
</DataTemplate>
<DataTemplate x:Key="BlackoutTemplate2">
<Path Margin="3"
Fill="Red"
Stretch="Fill"
Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" />
</DataTemplate>
<DataTemplate x:Key="BlackoutDefaultTemplate">
<Path Opacity="0.2"
Margin="3"
Fill="#FF000000"
Stretch="Fill"
Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" />
</DataTemplate>
</local:DemoView.Resources>
<TabControl>
<TabItem Header="Main">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Margin="5">
<GroupBox.Resources>
<Style x:Key="TextBlockStyle"
TargetType="TextBlock">
<Setter Property="Width"
Value="130" />
<Setter Property="Margin"
Value="0,10,0,0" />
<Setter Property="VerticalAlignment"
Value="Center" />
</Style>
</GroupBox.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--first Column-->
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Selection Mode:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ComboBox Width="110"
ItemsSource="{Binding Source={StaticResource SelectModes}}"
SelectedItem="{Binding SelectionMode, ElementName=_multiCalendar}"
ToolTip="Gets/Sets the Selection mode used for the control."
Margin="0,10,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Orientation:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ComboBox VerticalAlignment="Center"
Width="110"
Margin="0,10,0,0"
ToolTip="Gets/Sets the Orientation used for the control."
ItemsSource="{Binding Source={StaticResource OrientationModes}}"
SelectedItem="{Binding Orientation, ElementName=_multiCalendar}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Month Count:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<xctk:IntegerUpDown Minimum="1"
Maximum="36"
VerticalAlignment="Center"
Margin="0,10,0,0"
ToolTip="Gets/Sets how many calendars are displayed."
Value="{Binding MonthCount, ElementName=_multiCalendar}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Row Count:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<xctk:IntegerUpDown Minimum="1"
Maximum="18"
VerticalAlignment="Center"
Margin="0,10,0,0"
ToolTip="Gets/Sets how many rows are used to display the calendars."
Value="{Binding RowCount, ElementName=_multiCalendar}" />
<TextBlock Text=" *"
Style="{StaticResource TextBlockStyle}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Column Count:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<xctk:IntegerUpDown Minimum="1"
Maximum="18"
VerticalAlignment="Center"
Margin="0,10,0,0"
ToolTip="Gets/Sets how many columns are used to display the calendars."
Value="{Binding ColumnCount, ElementName=_multiCalendar}" />
<TextBlock Text=" *"
Style="{StaticResource TextBlockStyle}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Display Date Start:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<DatePicker Width="110"
Margin="0,10,0,0"
HorizontalContentAlignment="Left"
ToolTip="Gets/Sets the first Calendar of the MultiCalendar control."
SelectedDate="{Binding DisplayDateStart, ElementName=_multiCalendar}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Display Date End:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<DatePicker Width="110"
Margin="0,10,0,0"
HorizontalContentAlignment="Left"
ToolTip="Gets/Sets the last Calendar of the MultiCalendar control."
SelectedDate="{Binding DisplayDateEnd, ElementName=_multiCalendar}" />
</StackPanel>
</StackPanel>
<!--Second Column-->
<StackPanel Grid.Column="1">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Selected Date:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<TextBlock Style="{StaticResource TextBlockStyle}"
ToolTip="Gets/Sets the selected date of the MultiCalendar control."
Text="{Binding SelectedDate, ElementName=_multiCalendar, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Selected Dates:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ListBox Height="100"
Width="150"
Margin="0,10,0,0"
ToolTip="Gets/Sets the Selected dates collection of the MultiCalendar control."
ItemsSource="{Binding SelectedDates, ElementName=_multiCalendar, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="BlackoutDates:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<CheckBox Width="80"
Margin="0,10,0,0"
ToolTip="Gets/Sets the blackout dates collection of the MultiCalendar control."
Click="BlackoutDates_Click" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="HighlightedDates:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<CheckBox Width="80"
Margin="0,10,0,0"
ToolTip="Gets/Sets the highlighted dates collection of the MultiCalendar control."
Click="HighlightedDates_Click" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Hide Inactive Dates:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<CheckBox Width="80"
Margin="0,10,0,0"
ToolTip="Gets/Sets if inactive dates are hidden."
IsChecked="{Binding HideInactiveDates, ElementName=_multiCalendar}" />
</StackPanel>
</StackPanel>
<!-- //# TODODOC-->
<TextBlock Grid.Row="1"
Grid.ColumnSpan="2"
Margin="0,10,0,0"
TextWrapping="WrapWithOverflow"
Text="* The value is adjusted automatically when MonthCount changes. However, as soon as a custom value is assigned manually, this custom value will remain and no longer be adjusted automatically." />
</Grid>
</GroupBox>
<StackPanel Grid.Row="1"
Margin="10">
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
MaxHeight="400">
<xctk:MultiCalendar x:Name="_multiCalendar"
MonthCount="3"
Orientation="Horizontal"
SelectionMode="SingleRange" />
</ScrollViewer>
</StackPanel>
</Grid>
</TabItem>
<TabItem Header="Customization">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Margin="5">
<GroupBox.Resources>
<Style x:Key="TextBlockStyle"
TargetType="TextBlock">
<Setter Property="Width"
Value="180" />
<Setter Property="Margin"
Value="0,5,0,0" />
<Setter Property="VerticalAlignment"
Value="Center" />
</Style>
<Style x:Key="TextBlockStyle2"
TargetType="TextBlock"
BasedOn="{StaticResource TextBlockStyle}">
<Setter Property="Width"
Value="230" />
</Style>
</GroupBox.Resources>
<Grid Margin="5,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- first Column-->
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendars Background:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Background used for each individual calendar of the MultiCalendar control. MonthlyBackgrounds property should not be set in order to use this property."
SelectedColor="{Binding CalendarsBackground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendars BorderBrush:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the BorderBrush used for each individual calendar of the MultiCalendar control."
SelectedColor="{Binding CalendarsBorderBrush, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendars BorderThickness:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<xctk:DoubleUpDown Width="85"
ToolTip="Gets/Sets the BorderThickness used for each individual calendar of the MultiCalendar control."
Value="{Binding CalendarsBorderThickness, ElementName=_multiCalendar2, Converter={StaticResource ThicknessToDoubleConverter}}"
Maximum="5"
Minimum="0"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Header Button Style:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ComboBox Width="85"
Margin="0,5,0,0"
ToolTip="Gets/Sets the Header Button style used for each individual calendar of the MultiCalendar control."
SelectedValue="{Binding CalendarHeaderButtonStyle, ElementName=_multiCalendar2}"
SelectedValuePath="Tag">
<ComboBoxItem Tag="{StaticResource HeaderButtonStyle1}"
Content="Style1" />
<ComboBoxItem Tag="{StaticResource HeaderButtonStyle2}"
Content="Style2" />
<ComboBoxItem Tag="{x:Null}"
Content="Default" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Day Title DataTemplate:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ComboBox Width="85"
Margin="0,5,0,0"
ToolTip="Gets/Sets the day dataTemplate used in each individual calendar of the MultiCalendar control."
SelectedValue="{Binding CalendarDayTitleDataTemplate, ElementName=_multiCalendar2}"
SelectedValuePath="Tag">
<ComboBoxItem Tag="{StaticResource DayTitleTemplate1}"
Content="Default" />
<ComboBoxItem Tag="{StaticResource DayTitleTemplate2}"
Content="Template1" />
<ComboBoxItem Tag="{x:Null}"
Content="Null" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Next Button Style:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ComboBox Width="85"
Margin="0,5,0,0"
ToolTip="Gets/Sets the Next Button style of the MultiCalendar control."
SelectedValue="{Binding NextButtonStyle, ElementName=_multiCalendar2}"
SelectedValuePath="Tag">
<ComboBoxItem Tag="{StaticResource NextButtonStyle1}"
Content="Style1"/>
<ComboBoxItem Tag="{StaticResource NextButtonStyle2}"
Content="Style2" />
<ComboBoxItem Tag="{x:Null}"
Content="Default" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Previous Button Style:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<ComboBox Width="85"
Margin="0,5,0,0"
ToolTip="Gets/Sets the Previous Button style of the MultiCalendar control."
SelectedValue="{Binding PreviousButtonStyle, ElementName=_multiCalendar2}"
SelectedValuePath="Tag">
<ComboBoxItem Tag="{StaticResource PreviousButtonStyle1}"
Content="Style1" />
<ComboBoxItem Tag="{StaticResource PreviousButtonStyle2}"
Content="Style2" />
<ComboBoxItem Tag="{x:Null}"
Content="Default" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Monthly Backgrounds:"
Style="{StaticResource TextBlockStyle}" />
<!-- //# TODODOC-->
<CheckBox Width="85"
Margin="0,5,0,0"
ToolTip="Gets/Sets the monthly backgrounds collection of the MultiCalendar control."
Click="MonthlyBackgrounds_Click" />
</StackPanel>
</StackPanel>
<!--second column-->
<StackPanel Grid.Column="1">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Hightlighted Background:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Background used for highlighted dates in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonHighlightedBackground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Hightlighted Foreground:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Foreground used for highlighted dates in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonHighlightedForeground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Selected Background:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Background used for selected dates in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonSelectedBackground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Selected Foreground:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Foreground used for selected dates in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonSelectedForeground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Today Background:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Background used for today date in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonTodayBackground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Today Foreground:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Foreground used for today date in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonTodayForeground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button MouseOver Background:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Background used for the date under the mouse in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonMouseOverBackground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button MouseOver Foreground:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the Foreground used for the date under the mouse in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonMouseOverForeground, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button CurrentDate BorderBrush:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<xctk:ColorPicker Width="85"
ToolTip="Gets/Sets the BorderBrush used for the current date in the MultiCalendar control."
SelectedColor="{Binding CalendarButtonCurrentDateBorderBrush, ElementName=_multiCalendar2, Converter={StaticResource SolidColorBrushToColorConverter}}"
Margin="0,5,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Calendar Button Blackout DataTemplate:"
Style="{StaticResource TextBlockStyle2}" />
<!-- //# TODODOC-->
<ComboBox Width="85"
Margin="0,5,0,0"
ToolTip="Gets/Sets the Blackout DataTemplate used for the Blackout dates in the MultiCalendar control."
SelectedValue="{Binding CalendarButtonBlackoutDataTemplate, ElementName=_multiCalendar2}"
SelectedValuePath="Tag">
<ComboBoxItem Tag="{StaticResource BlackoutTemplate1}"
Content="Template1" />
<ComboBoxItem Tag="{StaticResource BlackoutTemplate2}"
Content="Template2" />
<ComboBoxItem Tag="{StaticResource BlackoutDefaultTemplate}"
Content="Default" />
</ComboBox>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<StackPanel Grid.Row="1"
Margin="10">
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
MaxHeight="400">
<xctk:MultiCalendar x:Name="_multiCalendar2"
SelectionMode="SingleRange"
MonthCount="3"
CalendarsBackground="White"
CalendarsBorderBrush="Blue"
CalendarsBorderThickness="0"
NextButtonStyle="{x:Null}"
PreviousButtonStyle="{x:Null}"
CalendarHeaderButtonStyle="{x:Null}"
CalendarDayTitleDataTemplate="{StaticResource DayTitleTemplate1}"
CalendarButtonHighlightedBackground="Yellow"
CalendarButtonHighlightedForeground="Black"
CalendarButtonSelectedBackground="Blue"
CalendarButtonSelectedForeground="White"
CalendarButtonTodayBackground="Gray"
CalendarButtonTodayForeground="White"
CalendarButtonMouseOverBackground="LightBlue"
CalendarButtonMouseOverForeground="Black"
CalendarButtonCurrentDateBorderBrush="DarkOrange"
CalendarButtonBlackoutDataTemplate="{StaticResource BlackoutDefaultTemplate}"/>
</ScrollViewer>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MultiCalendar.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\MultiCalendar.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

23
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.cs.txt

@ -30,32 +30,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.DataGrid.Views
{ {
public MultiColumnComboBoxView() public MultiColumnComboBoxView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void OnGroupCheck( object sender, System.Windows.RoutedEventArgs e )
{
DataGridCollectionView collectionView = ( DataGridCollectionView )_combo.ItemsSource;
bool isChecked = ( ( CheckBox )sender ).IsChecked.GetValueOrDefault( false );
bool isGrouped = ( collectionView.GroupDescriptions.Count > 0 );
if( isGrouped != isChecked )
{
if( isChecked )
{
collectionView.GroupDescriptions.Add( new PropertyGroupDescription( "ShipCountry" ) );
collectionView.GroupDescriptions.Add( new PropertyGroupDescription( "ShipCity" ) );
}
else
{
collectionView.GroupDescriptions.Clear();
}
}
}
#endif
} }
} }

134
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/MultiColumnComboBoxView.xaml.txt

@ -24,137 +24,25 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>The multi-column combo box uses the power of Xceed's datagrid control to create an advanced ComboBox.</Run> <Run>The multi-column combo box uses the power of Xceed's datagrid control to create an advanced ComboBox.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This Control is only available in the "Plus" version.</Run> <Run>This Control is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<xcdg:DataGridCollectionViewSource x:Key="cvsOrder"
Source="{Binding}" >
<xcdg:DataGridCollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="ShipCountry" />
<PropertyGroupDescription PropertyName="ShipCity" />
</xcdg:DataGridCollectionViewSource.GroupDescriptions>
</xcdg:DataGridCollectionViewSource>
<!--Important! Base the style on the predefined default style for the DataGrid-->
<Style x:Key="baseStyle" TargetType="{x:Type xcdg:DataGridControl}"
BasedOn="{StaticResource {x:Static xcdg:MultiColumnComboBox.DefaultDataGridStyleResourceKey}}">
<Setter Property="View">
<Setter.Value>
<!-- Setting a view to allow group drop-down navigation. -->
<!-- Because it declare a new view, this style can only -->
<!-- be used by one MultiColumnComboBox instance -->
<xcdg:TableflowView />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="coloredDataGridStyle" TargetType="{x:Type xcdg:DataGridControl}" BasedOn="{StaticResource baseStyle}" >
<Style.Resources>
<Style TargetType="{x:Type xcdg:DataRow}">
<Setter Property="Background" Value="LemonChiffon" />
</Style>
</Style.Resources>
</Style>
<conv:FlagPathConverter x:Key="flagPathConverter" />
<!-- DataTemplate to display a Country -->
<DataTemplate x:Key="countryDataTemplate">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
Margin="5,0,0,0">
<!--The flagPathConverter resource changes the value of a
group (e.g., "Canada") to an image. -->
<Image MaxHeight="15"
Margin="0, 0, 5, 0"
Source="{Binding Converter={StaticResource flagPathConverter}}" />
<TextBlock Text="{Binding}"
TextTrimming="WordEllipsis"
VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</local:DemoView.Resources>
<StackPanel>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Show headers option -->
<TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
Text="ShowColumnHeaders: "/>
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Margin="5"
IsChecked="{Binding ShowColumnHeaders, ElementName=_combo}" />
<!-- Show GroupBy control option -->
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
Text="ShowGroupByControl: " />
<CheckBox Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="5"
IsChecked="{Binding ShowGroupByControl, ElementName=_combo}" />
<!-- Group source option -->
<TextBlock Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"
Text="Grouped: " />
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Margin="5"
IsChecked="True"
Click="OnGroupCheck"/>
<!-- DataGrid Styling -->
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0"
Text="Applied DataGrid Style: "/>
<ComboBox x:Name="styles" Grid.Row="1" Grid.Column="3" SelectedIndex="0" Width="225" VerticalAlignment="Center" Margin="5">
<ComboBoxItem Content="No Style" Tag="{StaticResource baseStyle}" />
<ComboBoxItem Content="Styled with yellow row background" Tag="{StaticResource coloredDataGridStyle}" />
</ComboBox>
</Grid>
</GroupBox>
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
<xcdg:MultiColumnComboBox x:Name="_combo"
Width="200"
HorizontalAlignment="Left"
AutoCreateColumns="False"
ItemsSource="{Binding Source={StaticResource cvsOrder}}"
DataGridStyle="{Binding ElementName=styles, Path=SelectedItem.Tag}">
<xcdg:MultiColumnComboBox.Columns>
<xcdg:Column FieldName="OrderID" Title="Order ID" />
<xcdg:Column FieldName="CustomerID" Title="Customer ID" />
<xcdg:Column FieldName="ShipCountry" Title="Ship Country" CellContentTemplate="{StaticResource countryDataTemplate}"/>
<xcdg:Column FieldName="ShipCity" Title="Ship City" />
</xcdg:MultiColumnComboBox.Columns>
<xcdg:MultiColumnComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding OrderID}" />
<TextBlock Margin="10,0,0,0"
Text="{Binding CustomerID, StringFormat= ({0})}"/>
</StackPanel>
</DataTemplate>
</xcdg:MultiColumnComboBox.ItemTemplate>
</xcdg:MultiColumnComboBox>
</StackPanel>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MultiColumnsComboBox.png" Width="500" Height="300"/> <Image Source="..\OpenSourceImages\MultiColumnsComboBox.png" Width="500" Height="300"/>
##END-->
</local:DemoView> </local:DemoView>

116
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.cs.txt

@ -37,140 +37,30 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PileFlowPanel.Views
public PileFlowPanelView() public PileFlowPanelView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.SharedEmployees;
#endif
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_pileFlowPanel.PileFlowItemActivated += new Xceed.Wpf.Toolkit.PileFlowPanel.PileFlowItemActivatedHandler( this.PileFlowItemActivated );
_pileFlowPanel.PileFlowItemDeactivated += new Xceed.Wpf.Toolkit.PileFlowPanel.PileFlowItemDeactivatedHandler( this.PileFlowItemDeactivated );
ObservableCollection<Product> products = SampleDataProvider.GetProducts();
foreach( Product product in products )
{
this.AddImage( product );
}
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region Event Handlers
private void PileFlowItemActivated( object sender, Xceed.Wpf.Toolkit.PileFlowPanel.PileFlowActivationEventArgs e )
{
//# Modify the text label.
_pileFlowPanel.ContentLabel.Visibility = Visibility.Visible;
_pileFlowLabel.Text = e.Item.Element.Tag as string;
//# Enable the first PileFlowItem.
if( object.Equals( ( ( PileFlowItem )sender ).Element, _employeesPileFlowCard ) )
{
_employeeListBox.IsEnabled = true;
}
}
private void PileFlowItemDeactivated( object sender, EventArgs e )
{
//# Hide the text Label.
_pileFlowPanel.ContentLabel.Visibility = Visibility.Collapsed;
_pileFlowLabel.Text = null;
//# Enable the first PileFlowItem.
if( object.Equals( ( ( PileFlowItem )sender ).Element, _employeesPileFlowCard ) )
{
_employeeListBox.IsEnabled = false;
}
}
private void OnEmployeeButtonPress( object sender, EventArgs e )
{
Xceed.Wpf.Toolkit.MessageBox.Show( "Employee data has been saved.", "Employee", MessageBoxButton.OK, MessageBoxImage.Asterisk);
}
private void OnShowReflectionsClick( object sender, RoutedEventArgs e )
{
CheckBox checkBox = ( CheckBox )sender;
foreach( UIElement item in _pileFlowPanel.Children )
{
if( item is PileFlowCard )
{
(( PileFlowCard )item).ShowReflection = ( bool )checkBox.IsChecked;
}
}
}
private void OnBeginReflectionOpacityChanged( object sender, RoutedPropertyChangedEventArgs<object> e )
{
this.ModifyReflection( sender, true );
}
private void OnEndReflectionOpacityChanged( object sender, RoutedPropertyChangedEventArgs<object> e )
{
this.ModifyReflection( sender, false );
}
#endregion
#endif
#region Implementation #region Implementation
#if !OPEN_SOURCE
private void ModifyReflection( object sender, bool isBeginReflectionOpacity )
{
if( _pileFlowPanel != null )
{
DoubleUpDown opacity = ( DoubleUpDown )sender;
foreach( UIElement item in _pileFlowPanel.Children )
{
if( item is PileFlowCard )
{
PileFlowCard card = ( PileFlowCard )item;
double opacityValue = ( opacity.Value != null ) ? ( double )opacity.Value : 0d;
if( isBeginReflectionOpacity )
{
card.BeginReflectionOpacity = opacityValue;
}
else
{
card.EndReflectionOpacity = opacityValue;
}
}
}
}
}
private void AddImage( Product product )
{
BitmapImage imageSource = null;
byte[] imageBytes = product.Photo;
if( imageBytes != null )
{
Stream imageStream = new MemoryStream( imageBytes );
imageSource = new BitmapImage();
imageSource.BeginInit();
imageSource.CacheOption = BitmapCacheOption.OnLoad;
imageSource.StreamSource = imageStream;
imageSource.EndInit();
//# Use a border to delimit the photos
Border border = new Border();
border.BorderBrush = new SolidColorBrush( Colors.Black );
border.BorderThickness = new Thickness( 2 );
border.Background = new ImageBrush( imageSource );
//# Use a PileFlowCard to use Reflection.
PileFlowCard card = new PileFlowCard();
card.Child = border;
card.Tag = product.ProductName;
_pileFlowPanel.Children.Add( card );
}
}
#endif
#endregion #endregion
} }

320
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PileFlowPanelView.xaml.txt

@ -31,308 +31,40 @@
<LineBreak /> <LineBreak />
<Run> <Run>
The PileFlowPanel class also contains a label that can be configured to display the PileFlowItem data via the property ContentLabel. When the PileFlowPanel has focus, this sample lets the arrow buttons or the mouse wheel modify the selection.</Run> The PileFlowPanel class also contains a label that can be configured to display the PileFlowItem data via the property ContentLabel. When the PileFlowPanel has focus, this sample lets the arrow buttons or the mouse wheel modify the selection.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<Style TargetType="{x:Type Border}" x:Key="BorderStyle">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="BorderBrush">
<Setter.Value>
<SolidColorBrush Color="Black"/>
</Setter.Value>
</Setter>
</Style>
<conv:SizeToIntegerConverter x:Key="SizeToIntegerConverter" />
<conv:FullNameStringConverter x:Key="FullNameStringConverter" />
<SolidColorBrush x:Key="mouseOverBrush" Color="Blue" />
<SolidColorBrush x:Key="mouseOverLabelBrush" Color="LightBlue" />
<SolidColorBrush x:Key="normalLabelBrush" Color="Snow" />
<DataTemplate x:Key="seriesTemplate">
<Canvas Width="{Binding Path=W}" Height="{Binding Path=H}">
<Rectangle x:Name="rect" RadiusX="5" RadiusY="5" Width="{Binding Path=W}" Height="{Binding Path=H}" Fill="{Binding Path=Interior}">
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="rect" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource mouseOverBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="rect" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{Binding Path=Interior}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
</DataTemplate>
<DataTemplate x:Key="LabelTemplate">
<Border x:Name="border" DockPanel.Dock="Top" BorderThickness="1" CornerRadius ="4" Background="{StaticResource normalLabelBrush}">
<Border.BorderBrush>
<SolidColorBrush Color="Black"/>
</Border.BorderBrush>
<TextBlock FontFamily="Sans Serif" FontSize="12" Margin="2,2,2,1"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Text}">
<TextBlock.Foreground>
<SolidColorBrush Color="Navy"/>
</TextBlock.Foreground>
</TextBlock>
<Border.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource mouseOverLabelBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Mouse.MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource normalLabelBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Border.Triggers>
</Border>
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<GroupBox Header="PileFlowPanel Features" Grid.Row="0" Margin="0,5,0,5">
<Grid Margin="0,5,5,5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- 1st column -->
<TextBlock Text="Content Label Offset Y: " VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Column="1" Minimum="-150" Maximum="170" Value="{Binding ContentLabelOffsetY, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Content Label Size X: " Grid.Row="1" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="500" Value="{Binding ContentLabelSize, ElementName=_pileFlowPanel, Converter={StaticResource SizeToIntegerConverter}, ConverterParameter=width}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Content Label Size Y: " Grid.Row="2" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="500" Value="{Binding ContentLabelSize, ElementName=_pileFlowPanel, Converter={StaticResource SizeToIntegerConverter}, ConverterParameter=height}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Animation Duration: " Grid.Row="3" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="3" Grid.Column="1" Minimum="0" Maximum="3000" Increment="10" Value="{Binding AnimationDuration, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Last Move decelarion Ratio: " Grid.Row="4" VerticalAlignment="Center" />
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" FormatString="N1" Minimum="0" Maximum="1" Increment="0.1" Value="{Binding LastMoveDecelerationRatio, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Center Offset X " Grid.Row="5" VerticalAlignment="Center" />
<xctk:IntegerUpDown Grid.Row="5" Grid.Column="1" Minimum="0" Maximum="300" Increment="2" Value="{Binding CenterOffsetX, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<!-- 2nd column -->
<TextBlock Text="Flow Items Count: " Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Column="3" Minimum="1" Value="{Binding FlowItemsCount, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Flow Items Ratio: " Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="1" Grid.Column="3" Minimum="0" Maximum="100" Value="{Binding FlowItemRatio, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Item Width: " Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding ItemWidth, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Item Height: " Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="3" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding ItemHeight, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Flow Offset X " Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="4" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding FlowOffsetX, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="Flow Offset Y " Grid.Row="5" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0"/>
<xctk:IntegerUpDown Grid.Row="5" Grid.Column="3" Minimum="0" Maximum="300" Value="{Binding FlowOffsetY, ElementName=_pileFlowPanel}" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" />
</Grid>
</GroupBox>
<GroupBox Header="PileFlowCard Features" Grid.Row="0" Grid.Column="1" Margin="0,5,2,5">
<Grid Margin="0,5,2,5" HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Show Reflection: " VerticalAlignment="Center" />
<CheckBox x:Name="_showReflection" Grid.Column="1" IsChecked="True" Click="OnShowReflectionsClick" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,2,5" />
<TextBlock Text="Begin Reflection Opacity: " Grid.Row="1" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="1" Increment="0.02" AllowInputSpecialValues="None" Value="0.58" ValueChanged="OnBeginReflectionOpacityChanged" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,2,5" />
<TextBlock Text="End Reflection Opacity: " Grid.Row="2" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="1" Increment="0.02" AllowInputSpecialValues="None" Value="0" ValueChanged="OnEndReflectionOpacityChanged" IsEnabled="{Binding IsChecked, ElementName=_showReflection}" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,2,5" />
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" />
<ScrollViewer Grid.Row="2" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Visible" CanContentScroll="true">
<!-- For MVVM : An ItemsControl can be used :
<ItemsControl ItemsSource="{Binding TheItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<xctk:PileFlowPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>-->
<xctk:PileFlowPanel x:Name="_pileFlowPanel"
MinHeight="175"
ContentLabelOffsetY="100"
ContentLabelSize="200,28"
AnimationDuration="1000"
LastMoveDecelerationRatio="0.6"
FlowItemsCount="6"
FlowItemRatio="70"
ItemWidth="200"
ItemHeight="200"
FlowOffsetX="20"
FlowOffsetY="20"
CenterOffsetX="30">
<xctk:PileFlowPanel.ContentLabel>
<Border Background="#ffff50" DockPanel.Dock="Left" Style="{StaticResource BorderStyle}">
<TextBlock x:Name="_pileFlowLabel" Margin="0,5,0,0" TextAlignment="Center" />
<Border.BitmapEffect>
<DropShadowBitmapEffect />
</Border.BitmapEffect>
</Border>
</xctk:PileFlowPanel.ContentLabel>
<xctk:PileFlowCard x:Name="_employeesPileFlowCard" Tag="Employees">
<StackPanel>
<TextBlock Text="List of Employees" TextAlignment="Center" />
<xctk:CheckListBox x:Name="_employeeListBox" ItemsSource="{Binding}" DisplayMemberPath="LastName" />
</StackPanel>
</xctk:PileFlowCard>
<xctk:PileFlowCard>
<xctk:PileFlowCard.Tag>
<MultiBinding Converter="{StaticResource FullNameStringConverter}">
<Binding Path="[0].FirstName" />
<Binding Path="[0].LastName" />
</MultiBinding>
</xctk:PileFlowCard.Tag>
<Border Background="Beige">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Grid.RowSpan="5" Source="{Binding Path=[0].Photo}" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding Path=[0].FirstName}" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=[0].LastName}" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=[0].Title}" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=[0].Title}" />
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Path=[0].HomePhone}" />
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Path=[0].Address}" />
<TextBlock Grid.Row="5" Grid.ColumnSpan="2" Text="This employee has been working at IBM since March 10, 1999." TextWrapping="Wrap" />
<Button Grid.Row="6" Grid.ColumnSpan="2" Content="Save" Width="75" Click="OnEmployeeButtonPress" />
</Grid>
</Border>
</xctk:PileFlowCard>
<xctk:PileFlowCard Tag="sale's price relative to distance">
<Border Background="LightGray">
<xctk:Chart>
<xctk:Chart.Legend>
<xctk:Legend Visibility="Collapsed" />
</xctk:Chart.Legend>
<xctk:Chart.Areas>
<xctk:Area>
<xctk:Area.XAxis>
<xctk:Axis AxisLabelsLayout="ShowToFit" ShowAxisLabel="False" LabelTemplate="{StaticResource LabelTemplate}"/>
</xctk:Area.XAxis>
<xctk:Area.YAxis>
<xctk:Axis AxisLabelsLayout="ShowToFit" ShowAxisLabel="False" LabelTemplate="{StaticResource LabelTemplate}"/>
</xctk:Area.YAxis>
<xctk:Area.Series>
<xctk:Series DefaultInterior="Red" Template="{StaticResource seriesTemplate}">
<xctk:Series.DataPoints>
<xctk:DataPoint X="125" Y="6" />
<xctk:DataPoint X="150" Y="7" />
<xctk:DataPoint X="50" Y="4" />
<xctk:DataPoint X="25" Y="2" />
</xctk:Series.DataPoints>
<xctk:Series.Layout>
<xctk:ColumnLayout />
</xctk:Series.Layout>
</xctk:Series>
</xctk:Area.Series>
</xctk:Area>
</xctk:Chart.Areas>
</xctk:Chart>
</Border>
</xctk:PileFlowCard>
</xctk:PileFlowPanel>
</ScrollViewer>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\PileFlowPanel.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\PileFlowPanel.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

28
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAttributesView.xaml.cs.txt

@ -53,9 +53,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
[CategoryOrder("Information", 0)] [CategoryOrder("Information", 0)]
[CategoryOrder( "Conections", 1 )] [CategoryOrder( "Conections", 1 )]
[CategoryOrder( "Other", 2 )] [CategoryOrder( "Other", 2 )]
#if !OPEN_SOURCE
[ExpandedCategory( "Conections", false )]
#endif
public abstract class Person : INotifyPropertyChanged public abstract class Person : INotifyPropertyChanged
{ {
// All properties have their own "[Category(...)]" attribute to specify which category they // All properties have their own "[Category(...)]" attribute to specify which category they
@ -69,9 +66,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
[Category( "Information" )] [Category( "Information" )]
[Description( "This property uses the [Editor(..)] attribute to provide a custom editor using the 'FirstNameEditor' class. In the Plus version, it also depends on the IsMale property to change its foreground and source." )] [Description( "This property uses the [Editor(..)] attribute to provide a custom editor using the 'FirstNameEditor' class. In the Plus version, it also depends on the IsMale property to change its foreground and source." )]
[Editor( typeof( FirstNameEditor ), typeof( FirstNameEditor ) )] [Editor( typeof( FirstNameEditor ), typeof( FirstNameEditor ) )]
#if !OPEN_SOURCE
[DependsOn( "IsMale" )]
#endif
public string FirstName public string FirstName
{ {
get{ return _firstName; } get{ return _firstName; }
@ -122,7 +116,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public string NameInParentheses { get; set; } public string NameInParentheses { get; set; }
[Category( "Other" )] [Category( "Other" )]
//# TODODOC
[Description( "This property uses the [Browsable(false)] attribute to not display the property" )] [Description( "This property uses the [Browsable(false)] attribute to not display the property" )]
[BrowsableAttribute( false )] [BrowsableAttribute( false )]
public string InvisibleProperty public string InvisibleProperty
@ -134,7 +127,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
[Range(0d, 10d)] [Range(0d, 10d)]
[Category( "Other" )] [Category( "Other" )]
[DefaultValue(5d)] [DefaultValue(5d)]
//# TODODOC
[Description( "This property uses the [Range(0,10)] and DefaultValue attributes to set the Minimum, Maximum and default properties." )] [Description( "This property uses the [Range(0,10)] and DefaultValue attributes to set the Minimum, Maximum and default properties." )]
public double RangeDouble public double RangeDouble
{ {
@ -191,36 +183,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
{ {
public FrameworkElement ResolveEditor( Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem propertyItem ) public FrameworkElement ResolveEditor( Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem propertyItem )
{ {
#if !OPEN_SOURCE
ComboBox comboBox = new ComboBox();
if( ( ( Person )propertyItem.Instance ).IsMale )
{
comboBox.Foreground = new SolidColorBrush( Colors.Green );
comboBox.ItemsSource = new List<string>() {"Tom", "Mark", "Bryan"};
}
else
{
comboBox.Foreground = new SolidColorBrush( Colors.Red );
comboBox.ItemsSource = new List<string>() { "Jane", "Christine", "Kathy" };
}
comboBox.SelectedIndex = 0;
#else
TextBox textBox = new TextBox(); TextBox textBox = new TextBox();
textBox.Background = new SolidColorBrush( Colors.Red ); textBox.Background = new SolidColorBrush( Colors.Red );
#endif
//create the binding from the bound property item to the editor //create the binding from the bound property item to the editor
var _binding = new Binding( "Value" ); //bind to the Value property of the PropertyItem var _binding = new Binding( "Value" ); //bind to the Value property of the PropertyItem
_binding.Source = propertyItem; _binding.Source = propertyItem;
_binding.ValidatesOnExceptions = true; _binding.ValidatesOnExceptions = true;
_binding.ValidatesOnDataErrors = true; _binding.ValidatesOnDataErrors = true;
_binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; _binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay;
#if !OPEN_SOURCE
BindingOperations.SetBinding( comboBox, ComboBox.SelectedItemProperty, _binding );
return comboBox;
#else
BindingOperations.SetBinding( textBox, TextBox.TextProperty, _binding ); BindingOperations.SetBinding( textBox, TextBox.TextProperty, _binding );
return textBox; return textBox;
#endif
} }
} }

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.cs.txt

@ -35,16 +35,5 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
} }
} }
#if !OPEN_SOURCE
public struct Coords
{
public int X { get; set; }
public int Y { get; set; }
public override string ToString()
{
return string.Format( "{0}, {1}", X, Y );
}
}
#endif
} }

55
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridCustomPropertyView.xaml.txt

@ -25,7 +25,6 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
Using the CustomPropertyItems class, you can flexibly modify the display of each of your properties. Using the CustomPropertyItems class, you can flexibly modify the display of each of your properties.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -33,7 +32,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -45,13 +43,7 @@
<StackPanel Grid.Row="0" Margin="10"> <StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample adds 'CustomPropertyItem' to the 'Properties' collection and directly controls the display of each item." <TextBlock Text="This sample adds 'CustomPropertyItem' to the 'Properties' collection and directly controls the display of each item."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click the XAML and Code tabs to see details.)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1" <ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -60,57 +52,10 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/CustomProperty.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/CustomProperty.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<!--
No assignement of either PropertyNameBinding or PropertyValueBinding. CustomProperties
will each have all the values directly set.
-->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" Width="350" MaxHeight="280">
<xctk:PropertyGrid.EditorDefinitions>
<xctk:EditorTextDefinition TargetProperties="firstName,lastName"
FontWeight="Bold"
FontStyle="Italic"/>
</xctk:PropertyGrid.EditorDefinitions>
<xctk:PropertyGrid.Properties>
<!--Use CustomPropertyItem to control each of their characteristics. -->
<!--Here we specify a DefinitionKey to assign a specific CUSTOM editor. -->
<xctk:CustomPropertyItem DisplayName="First Name" Value="Nancy" Category="Name"
DefinitionKey="firstName" />
<xctk:CustomPropertyItem DisplayName="Last Name" Value="Davolio" Category="Name"
DefinitionKey="lastName"/>
<!-- Here we specify a DefinitionKey to assign a specific DEFAULT editor. -->
<!-- Since the XAML parser will parse "29" as a string, the TypeConverter defined
on Int32 struct will automatically make the conversion. -->
<xctk:CustomPropertyItem DisplayName="Age" Value="29" Category="Other"
DefinitionKey="{x:Type s:Int32}" />
<!-- For thoses values where no TypeConverter supporting strings is defined, you must
use property element syntax to define the value. -->
<xctk:CustomPropertyItem DisplayName="Coordinates" Category="Other"
Description="Location on the state map">
<xctk:CustomPropertyItem.Value>
<v:Coords X="12" Y="15"/>
</xctk:CustomPropertyItem.Value>
</xctk:CustomPropertyItem>
<!--Here we define a specific editor directly. No value -->
<xctk:CustomPropertyItem DisplayName="Picture" Category="Other">
<xctk:CustomPropertyItem.Editor>
<Image Source="/Samples/PropertyGrid/Resources/woman.png"
Stretch="None"
HorizontalAlignment="Left"/>
</xctk:CustomPropertyItem.Editor>
</xctk:CustomPropertyItem>
</xctk:PropertyGrid.Properties>
<!-- You must specify that the grouping is based on the value of "Category" property. -->
<xctk:PropertyGrid.CategoryGroupDescription>
<PropertyGroupDescription PropertyName="Category"/>
</xctk:PropertyGrid.CategoryGroupDescription>
</xctk:PropertyGrid>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

8
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefaultEditorsView.xaml.cs.txt

@ -64,9 +64,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
selectedObject.UInt16 = (ushort)9; selectedObject.UInt16 = (ushort)9;
selectedObject.UInt32 = (uint)10; selectedObject.UInt32 = (uint)10;
selectedObject.UInt64 = (ulong)11; selectedObject.UInt64 = (ulong)11;
#if !OPEN_SOURCE
selectedObject.File = new FileInfo( "c:\\MyFile.txt" );
#endif
this.DataContext = selectedObject; this.DataContext = selectedObject;
} }
@ -146,11 +143,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
[Category( "Non-Numeric Editors" )] [Category( "Non-Numeric Editors" )]
[Description( "This property uses a Char as the default editor." )] [Description( "This property uses a Char as the default editor." )]
public Char Char { get; set; } public Char Char { get; set; }
#if !OPEN_SOURCE
[Category( "Non-Numeric Editors" )]
[Description( "This property uses a FilePicker as the default editor." )]
public FileInfo File { get; set; }
#endif
[Category( "Non-Numeric Editors" )] [Category( "Non-Numeric Editors" )]
[Description( "This property uses a PrimitiveTypeCollectionEditor as the default editor." )] [Description( "This property uses a PrimitiveTypeCollectionEditor as the default editor." )]
public List<string> ListOfStrings { get; set; } public List<string> ListOfStrings { get; set; }

20
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.cs.txt

@ -28,26 +28,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridDefinitionKeyView() public PropertyGridDefinitionKeyView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var person = new Person();
person.FirstName = "John";
person.LastName = "Smith";
person.ReferenceNo = 252521;
this.DataContext = person;
#endif
}
#if !OPEN_SOURCE
private class Person
{
[DefinitionKey( "nameType" )]
public string FirstName { get; set; }
[DefinitionKey( "nameType" )]
public string LastName { get; set; }
[DefinitionKey( typeof( int? ) )]
public object ReferenceNo { get; set; }
} }
#endif
} }
} }

18
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDefinitionKeyView.xaml.txt

@ -32,7 +32,6 @@
<LineBreak/> <LineBreak/>
<LineBreak/> <LineBreak/>
It can also be used to specify a specific default editor when a property type does not resolve to a valid editor (e.g., Object). It can also be used to specify a specific default editor when a property type does not resolve to a valid editor (e.g., Object).
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -40,7 +39,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -56,13 +54,7 @@
<TextBlock Text="The ReferenceNo property, declare a DefinitionKey to 'int?' to displayed the content with a IntegerUpDown dispite it's type is 'object'" <TextBlock Text="The ReferenceNo property, declare a DefinitionKey to 'int?' to displayed the content with a IntegerUpDown dispite it's type is 'object'"
TextWrapping="Wrap" TextWrapping="Wrap"
Margin="0,0,0,10"/> Margin="0,0,0,10"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click XAML and Code tabs to see details)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1" <ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -73,15 +65,5 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/DefinitionKey.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/DefinitionKey.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" HorizontalAlignment="Stretch" Width="350" MaxHeight="200"
SelectedObject="{Binding}">
<xctk:PropertyGrid.EditorDefinitions>
<!-- This EditorDefinition will be used for FirstName and LastName -->
<xctk:EditorTextDefinition TargetProperties="nameType" FontStyle="Italic" FontWeight="Bold" />
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

91
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.cs.txt

@ -20,9 +20,6 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Core.Attributes;
#endif
using Xceed.Wpf.Toolkit.Core; using Xceed.Wpf.Toolkit.Core;
using System.Windows.Controls; using System.Windows.Controls;
using System.Globalization; using System.Globalization;
@ -41,90 +38,16 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridDisplayLocalizationView() public PropertyGridDisplayLocalizationView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var person = new Person();
person.FirstName = "John";
person.LastName = "Doe";
person.FavoriteActor1 = ActorNoDisplayName.billcosby;
person.FavoriteActor2 = ActorWithDisplayName.bradpitt;
person.FavoriteActor3 = ActorWithDisplayName.NotInThisList;
_propertyGrid.SelectedObject = person;
#endif
} }
#if !OPEN_SOURCE
private void ComboBox_SelectionChanged( object sender, System.Windows.Controls.SelectionChangedEventArgs e )
{
DisplayLocalizationRes.Culture = object.Equals(( ( ComboBox )sender ).SelectedItem,"French" )
? new CultureInfo( "fr" )
: CultureInfo.InvariantCulture;
// This will refresh the PropertyGrid.
if( _propertyGrid != null )
{
var selected = _propertyGrid.SelectedObject;
_propertyGrid.SelectedObject = null;
_propertyGrid.SelectedObject = selected;
}
}
public enum ActorNoDisplayName
{
alpacino,
arnoldschwarzenegger,
benaffleck,
billcosby,
bradpitt,
NotInThisList
};
[TypeConverter(typeof(EnumDisplayNameConverter))]
public enum ActorWithDisplayName
{
[ExtendedDisplayName( "Al Pacino" )]
alpacino,
[ExtendedDisplayName( "Arnold Schwarzenegger" )]
arnoldschwarzenegger,
[ExtendedDisplayName( "Ben Affleck" )]
benaffleck,
[ExtendedDisplayName( "Bill Cosby" )]
billcosby,
[ExtendedDisplayName( "Brad Pitt" )]
bradpitt,
[LocalizedDisplayName( "NotListed", typeof(DisplayLocalizationRes) )]
NotInThisList
};
[CategoryOrder( "InfoCategory", 1 )]
[CategoryOrder( "DetailsCategory", 2 )]
public class Person
{
[LocalizedDisplayName( "FirstName", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FirstNameDesc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "InfoCategory", typeof( DisplayLocalizationRes ) )]
public string FirstName { get; set; }
[LocalizedDisplayName( "LastName", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "LastNameDesc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "InfoCategory", typeof( DisplayLocalizationRes ) )]
public string LastName { get; set; }
[LocalizedDisplayName( "FavoriteActor1", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FavoriteActor1Desc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "DetailsCategory", typeof( DisplayLocalizationRes ) )]
public ActorNoDisplayName FavoriteActor1 { get; set; }
[LocalizedDisplayName( "FavoriteActor2", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FavoriteActor2Desc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "DetailsCategory", typeof( DisplayLocalizationRes ) )]
public ActorWithDisplayName FavoriteActor2 { get; set; }
[LocalizedDisplayName( "FavoriteActor3", typeof( DisplayLocalizationRes ) )]
[LocalizedDescription( "FavoriteActor3Desc", typeof( DisplayLocalizationRes ) )]
[LocalizedCategory( "DetailsCategory", typeof( DisplayLocalizationRes ) )]
public ActorWithDisplayName FavoriteActor3 { get; set; }
}
#endif
} }
} }

29
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridDisplayLocalizationView.xaml.txt

@ -31,46 +31,17 @@
<Run>LocalizedDisplayName, LocalizedDescription, LocalizedCategory:</Run> <Run>LocalizedDisplayName, LocalizedDescription, LocalizedCategory:</Run>
<LineBreak/> <LineBreak/>
<Run>Theses attributes allow to easily localize the DisplayName, Description, and Category attributes values using standard Resx resource files.</Run> <Run>Theses attributes allow to easily localize the DisplayName, Description, and Category attributes values using standard Resx resource files.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="In this sample, the properties names and descriptions where localized.&#x0a;Select 'Favorite Actor' properties and see description:" />
<Grid Grid.Row="1" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="30" Width="450" Height="22">
<TextBlock Text="Language:" Margin="0,0,5,30" />
<ComboBox SelectionChanged="ComboBox_SelectionChanged" SelectedIndex="0" Width="150">
<ComboBox.Items>
<s:String>English (Default)</s:String>
<s:String>French</s:String>
</ComboBox.Items>
</ComboBox>
</StackPanel>
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="1" NameColumnWidth="250" Width="450" MaxHeight="280" />
</Grid>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\Localization.png" Width="400" Height="300"/> <Image Source="..\OpenSourceImages\Localization.png" Width="400" Height="300"/>
##END-->
</local:DemoView> </local:DemoView>

48
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.cs.txt

@ -32,58 +32,10 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridEditorDefinitionsView() public PropertyGridEditorDefinitionsView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var selectedObject = new EditorDefinitionsSampleObject();
selectedObject.Boolean = true;
selectedObject.Color = Colors.Red;
selectedObject.ColorCombo = Colors.Blue;
selectedObject.DateTime = System.DateTime.Now;
selectedObject.Int32 = 42;
selectedObject.PersonTemplate = new Person() { FirstName = "John", LastName = "Smith" };
selectedObject.String = "This is a string";
selectedObject.StringCombo = "String Value 1";
selectedObject.File = new FileInfo("MyFile.txt");
this.DataContext = selectedObject;
#endif
} }
#if !OPEN_SOURCE
public class EditorDefinitionsSampleObject
{
[PropertyOrder( 0 )]
public string String { get; set; }
[PropertyOrder( 1 )]
public bool Boolean { get; set; }
[PropertyOrder( 2 )]
public int Int32 { get; set; }
[PropertyOrder( 3 )]
public System.DateTime DateTime { get; set; }
[PropertyOrder( 4 )]
public System.Windows.Media.Color? Color { get; set; }
[PropertyOrder( 5 )]
public string StringCombo { get; set; }
[PropertyOrder( 6 )]
public System.Windows.Media.Color? ColorCombo { get; set; }
[PropertyOrder( 7 )]
public Person PersonTemplate { get; set; }
[PropertyOrder( 8 )]
public FileInfo File { get; set; }
}
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
#endif
}
#if !OPEN_SOURCE
public class ColorSampleItem
{
public System.Windows.Media.Color? Color { get; set; }
public string DisplayString { get; set; }
} }
#endif
} }

107
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorDefinitionsView.xaml.txt

@ -24,28 +24,10 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
VerticalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"
Title="Ready-to-use EditorDefinitions"> Title="Ready-to-use EditorDefinitions">
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<x:Array x:Key="comboSource1" Type="s:String" >
<s:String>String Value 1</s:String>
<s:String>String Value 2</s:String>
<s:String>String Value 3</s:String>
</x:Array>
<x:Array x:Key="comboSource2" Type="s:Object" >
<v:ColorSampleItem Color="{x:Null}" DisplayString="(No color selected)"/>
<v:ColorSampleItem Color="{x:Static sm:Colors.Red}" DisplayString="Red Color"/>
<v:ColorSampleItem Color="{x:Static sm:Colors.Green}" DisplayString="Green Color"/>
<v:ColorSampleItem Color="{x:Static sm:Colors.Blue}" DisplayString="Blue Color"/>
</x:Array>
<Style x:Key="textBoxStyle" TargetType="TextBox">
<Setter Property="Background" Value="LightBlue"/>
</Style>
</local:DemoView.Resources>
<!--##END-->
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
Using the various EditorDefinitions provided with the PropertyGrid, you can easily customize and reuse the existing default editor to suit your needs. Style the editing element or use one of the common properties directly provided on the editor definition class. The provided editor definitions are the following: Using the various EditorDefinitions provided with the PropertyGrid, you can easily customize and reuse the existing default editor to suit your needs. Style the editing element or use one of the common properties directly provided on the editor definition class. The provided editor definitions are the following:
@ -72,7 +54,6 @@
EditorIntegerUpDownDefinition EditorIntegerUpDownDefinition
<LineBreak /> <LineBreak />
EditorDoubleUpDownDefinition EditorDoubleUpDownDefinition
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -80,7 +61,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Toolkit Plus for WPF. Click here for more details about Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
etc. etc.
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -89,13 +69,7 @@
<StackPanel DockPanel.Dock="Top"> <StackPanel DockPanel.Dock="Top">
<TextBlock Text="Each of the displayed properties has their display or behavior affected by an different EditorDefinition " <TextBlock Text="Each of the displayed properties has their display or behavior affected by an different EditorDefinition "
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click XAML and Code tabs to see details)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer VerticalScrollBarVisibility="Auto" <ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
<StackPanel> <StackPanel>
@ -103,72 +77,13 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/EditorDefinitions.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/EditorDefinitions.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:PropertyGrid x:Name="_propertyGrid" SelectedObject="{Binding}" Width="450" MaxHeight="320" Margin="10" >
<xctk:PropertyGrid.EditorDefinitions>
<!--
Only the "integer" is demonstrated here.
But all other numeric types are also supported (eg. EditorDoubleUpDownDefinition, etc.)
-->
<xctk:EditorIntegerUpDownDefinition TargetProperties="{x:Type s:Int32}"
TextAlignment="Right" />
<!-- CheckBox -->
<xctk:EditorCheckBoxDefinition TargetProperties="{x:Type s:Boolean}"
IsThreeState="True" />
<!-- ColorPicker -->
<xctk:EditorColorPickerDefinition TargetProperties="{x:Type sm:Color}"
DisplayColorAndName="False"
ShowDropDownButton="False"/>
<!-- FilePicker -->
<xctk:EditorFilePickerDefinition TargetProperties="{x:Type sys:FileInfo}"
Filter="Text file | *.txt"
Title="Select your file"/>
<!-- DateTimeUpDown -->
<xctk:EditorDateTimeUpDownDefinition TargetProperties="{x:Type s:DateTime}"
Format="Custom"
FormatString="yyyy-MM" />
<!-- TextBox -->
<!-- On any EditorDefintion, you can use the "EditingElementStyle" to have a more complete customization
of the underlying editor -->
<xctk:EditorTextDefinition TargetProperties="{x:Type s:String}"
FontStyle="Italic"
FontWeight="Bold"
EditingElementStyle="{StaticResource textBoxStyle}" />
<!-- ComboBox (simple) -->
<!-- When using SelectedObject[s], the DataContext will be the PropertyItem. Bind to the "Value" property. -->
<xctk:EditorComboBoxDefinition TargetProperties="StringCombo"
ItemsSource="{StaticResource comboSource1}"
SelectedItemBinding="{Binding Value}" />
<!-- ComboBox (complex) -->
<xctk:EditorComboBoxDefinition TargetProperties="ColorCombo"
ItemsSource="{StaticResource comboSource2}"
DisplayMemberPath="DisplayString"
SelectedValuePath="Color"
SelectedValueBinding="{Binding Value}" />
<!-- Custom DataTemplate -->
<xctk:EditorTemplateDefinition TargetProperties="PersonTemplate">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<!-- When using SelectedObject[s], the DataContext will be the PropertyItem. Bind to the "Value" property. -->
<TextBlock Text="{Binding Value.LastName}" FontWeight="Bold" />
<TextBlock Text=", " />
<TextBlock Text="{Binding Value.FirstName}" />
</StackPanel>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
<!--##END-->
</DockPanel> </DockPanel>

161
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridExpandingNonPrimitivesView.xaml.cs.txt

@ -28,185 +28,24 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var supervisor = new Supervisor()
{
Name = "Micheal Jones",
Department = DepartmentEnum.Production,
Managers = new List<Manager>()
{
new Manager()
{
Name = "Ken Clark",
Skills = "Negociation",
Workers = new ObservableCollection<Worker>()
{
new Worker()
{
Name = "Martina Kanes",
YearExperience = 5
},
new Worker()
{
Name = "Kelly Stewart",
YearExperience = 3
},
new Worker()
{
Name = "Mark Applebum",
YearExperience = 7
}
}
},
new Manager()
{
Name = "Julia Benetton",
Skills = "Creative",
Workers = new ObservableCollection<Worker>()
{
new Worker()
{
Name = "John Quick",
YearExperience = 1
},
new Worker()
{
Name = "Martha Adrian",
YearExperience = 2
},
new Worker()
{
Name = "Kevin Stevens",
YearExperience = 5
}
}
}
},
Info = new Info()
{
Address = "64 Main Street",
City = "New York",
Country = "USA",
Phone = "1-800-555-9636"
}
};
this.DataContext = supervisor;
#endif
} }
} }
#if !OPEN_SOURCE
public enum DepartmentEnum
{
Production,
Marketing,
Sales,
Accounting
}
public class Supervisor
{
public string Name
{
get;
set;
}
public DepartmentEnum Department
{
get;
set;
}
public List<Manager> Managers
{
get;
set;
}
public Info Info
{
get;
set;
}
}
public class Manager
{
public string Name
{
get;
set;
}
public string Skills
{
get;
set;
}
public ObservableCollection<Worker> Workers
{
get;
set;
}
public override string ToString()
{
return this.Name;
}
}
public class Worker
{
public string Name
{
get;
set;
}
public int YearExperience
{
get;
set;
}
public override string ToString()
{
return this.Name;
}
}
public class Info
{
public string Address
{
get;
set;
}
public string Phone
{
get;
set;
}
public string City
{
get;
set;
}
public string Country
{
get; set;
}
public override string ToString()
{
return "Info";
}
}
#endif
} }

47
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridExpandingNonPrimitivesView.xaml.txt

@ -26,68 +26,21 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
The PropertyGrid allows you to expand non-primitive type properties from the SelectedObject to view or edit their sub-properties. It also allows you to expand collections or lists properties to view their items and drill down on these items properties, directly from the propertyGrid, instead of passing by the CollectionEditor. The PropertyGrid allows you to expand non-primitive type properties from the SelectedObject to view or edit their sub-properties. It also allows you to expand collections or lists properties to view their items and drill down on these items properties, directly from the propertyGrid, instead of passing by the CollectionEditor.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Is Expanding Non Primitive Types:"
VerticalAlignment="Center" />
<!-- //# TODODOC -->
<CheckBox Grid.Column="1"
IsChecked="{Binding IsExpandingNonPrimitiveTypes, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Expand the the non-primitive type properties on the SelectedObject." />
</Grid>
</GroupBox>
<DockPanel Grid.Row="1"
Margin="10">
<TextBlock DockPanel.Dock="Top"
Text="Usage:"
Style="{StaticResource Header}" />
<Grid Margin="10">
<xctk:PropertyGrid x:Name="_propertyGrid"
SelectedObject="{Binding}"
IsExpandingNonPrimitiveTypes="True"
Width="500"
MaxHeight="650" />
</Grid>
</DockPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ExpandingNonPrimitives.png" Width="660" Height="430"/> <Image Source="..\OpenSourceImages\ExpandingNonPrimitives.png" Width="660" Height="430"/>
##END-->
</local:DemoView> </local:DemoView>

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.cs.txt

@ -39,9 +39,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridMultiSelectedObjectsView() public PropertyGridMultiSelectedObjectsView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
_propertyGrid.SelectedObjectsOverride = new List<object>() { _textBox, _button, _comboBox };
#endif
} }
} }
} }

33
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridMultiSelectedObjectsView.xaml.txt

@ -24,51 +24,18 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>When many objects are assigned to a PropertyGrid, the PpropertyGrid will show all the common properties so that they can be changed simultaneously on each object.</Run> <Run>When many objects are assigned to a PropertyGrid, the PpropertyGrid will show all the common properties so that they can be changed simultaneously on each object.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<x:Array Type="sys:String" x:Key="_comboBoxSource" >
<sys:String>Green</sys:String>
<sys:String>Red</sys:String>
<sys:String>Blue</sys:String>
</x:Array>
</local:DemoView.Resources>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel >
<TextBlock Text="Selected Object 1 : a TextBox" />
<TextBox x:Name="_textBox" Text="This is my TextBox" Margin="10" Width="150" Foreground="Red"/>
<TextBlock Text="Selected Object 2 : a Button"/>
<Button x:Name="_button" Content="My Button" Margin="10" Width="150" Foreground="Red"/>
<TextBlock Text="Selected Object 3 : a ComboBox" />
<ComboBox x:Name="_comboBox" ItemsSource="{StaticResource _comboBoxSource}" SelectedIndex="0" Margin="10" Width="150" Foreground="Red"/>
</StackPanel>
<xctk:PropertyGrid Grid.Column="1" x:Name="_propertyGrid" ShowAdvancedOptions="True" AutoGenerateProperties="False" MaxHeight="350" VerticalAlignment="Top">
<xctk:PropertyGrid.PropertyDefinitions>
<xctk:PropertyDefinition
TargetProperties="FontSize,FontWeight,Foreground,Background,HorizontalContentAlignment,Width,Margin,ToolTip" />
</xctk:PropertyGrid.PropertyDefinitions>
</xctk:PropertyGrid>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MultiSelectedObjects.png" Width="660" Height="430"/> <Image Source="..\OpenSourceImages\MultiSelectedObjects.png" Width="660" Height="430"/>
##END-->
</local:DemoView> </local:DemoView>

49
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.cs.txt

@ -32,59 +32,10 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
public PropertyGridPropertiesSourceView() public PropertyGridPropertiesSourceView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
var list = new ObservableCollection<object>();
list.Add( new MyData( "string", "First text" ) );
list.Add( new MyData( "Second string", "Second text" ) );
list.Add( new MyData( "Color", Colors.Blue ) );
list.Add( new MyData( "DateTime", System.DateTime.Now ) );
list.Add( new MyData( "TimeSpan", System.TimeSpan.FromMinutes( 120 ) ) );
list.Add( new MyData( "HorizontalAlignment", System.Windows.HorizontalAlignment.Center ) );
list.Add( new MyData( "bool", true ) );
list.Add( new MyData( "decimal", ( decimal )1 ) );
list.Add( new MyData( "int", ( int )2 ) );
list.Add( new MyData( "Second int", ( int )2 ) );
list.Add( new MyData( "short", ( short )3 ) );
list.Add( new MyData( "long", ( long )4 ) );
list.Add( new MyData( "float", ( float )5 ) );
list.Add( new MyData( "byte", ( byte )6 ) );
list.Add( new MyData( "sbyte", ( sbyte )7 ) );
list.Add( new MyData( "uint", ( uint )8 ) );
list.Add( new MyData( "ulong", ( ulong )8 ) );
list.Add( new MyData( "ushort", ( ushort )10 ) );
list.Add( new MyData( "FontFamily", Fonts.SystemFontFamilies.First() ) );
list.Add( new MyData( "FontStyle", FontStyles.Italic ) );
list.Add( new MyData( "FontStretch", FontStretches.ExtraExpanded ) );
// PropertyGrid PropertiesSource property is bound to the DataContext
this.DataContext = list;
#endif
} }
#if !OPEN_SOURCE
private void InsertProperty( object sender, RoutedEventArgs e )
{
( ( IList<object> )this.DataContext ).Insert( 0, new MyData( "New string", "new data" ) );
}
private void RemoveProperty( object sender, RoutedEventArgs e )
{
if( _propertyGrid.SelectedProperty != null )
{
( ( IList<object> )this.DataContext ).Remove( _propertyGrid.SelectedProperty );
}
}
private class MyData
{
public MyData( string name, object value )
{
this.MyName = name;
this.MyValue = value;
}
public string MyName { get; set; }
public object MyValue { get; set; }
}
#endif
} }
} }

49
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesSourceView.xaml.txt

@ -24,7 +24,6 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
When setting the PropertiesSource or Properties property, you can provide your own data to be displayed in the PropertyGrid. This allows you to easily insert and remove properties at runtime. The usage scheme is similar to the one used for the standard ItemsControl. When setting the PropertiesSource or Properties property, you can provide your own data to be displayed in the PropertyGrid. This allows you to easily insert and remove properties at runtime. The usage scheme is similar to the one used for the standard ItemsControl.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -32,7 +31,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -45,13 +43,7 @@
<StackPanel Grid.Row="0" Margin="10"> <StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample uses the 'PropertiesSource', 'PropertyNameBinding', and 'PropertyValueBinding', as well as collection of generic objects to display its properties." <TextBlock Text="This sample uses the 'PropertiesSource', 'PropertyNameBinding', and 'PropertyValueBinding', as well as collection of generic objects to display its properties."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click the XAML and Code tabs to see details.)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="2" <ScrollViewer Grid.Row="2"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -62,52 +54,11 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/PropertiesSource.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/PropertiesSource.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="Insert new property" Click="InsertProperty" Margin="20" Padding="5"/>
<Button Content="Remove selected property" Click="RemoveProperty" Margin="20" Padding="5"/>
</StackPanel>
<!--
The PropertyNameBinding and PropertyValueBinding properties provide the bindings that will be used
on each item of the properties' source in order to provide the Name and Value of each property.
-->
<xctk:PropertyGrid x:Name="_propertyGrid" Grid.Row="2" Width="350" MaxHeight="600"
IsCategorized="False"
ShowSortOptions="False"
PropertiesSource="{Binding}"
PropertyNameBinding="{Binding MyName}"
PropertyValueBinding="{Binding MyValue}" >
<xctk:PropertyGrid.Resources>
<xctk:EditorTimeSpanConverter x:Key="timeSpanConv"/>
</xctk:PropertyGrid.Resources>
<xctk:PropertyGrid.EditorDefinitions>
<!-- The property with the name "Second string" will have this special editor. -->
<xctk:EditorTextDefinition TargetProperties="Second string"
FontStyle="Italic"
FontWeight="Bold" >
<xctk:EditorTextDefinition.EditingElementStyle>
<Style TargetType="{x:Type TextBox}"
BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Background" Value="LightBlue"/>
</Style>
</xctk:EditorTextDefinition.EditingElementStyle>
</xctk:EditorTextDefinition>
<!-- All properties whose value type is TimeSpan will use this special editor. -->
<!--Here we use a DateTimeUpDown editor in conjunction with a built-in converter to
create a TimeSpanEditor-->
<xctk:EditorDateTimeUpDownDefinition TargetProperties="{x:Type s:TimeSpan}"
Format="Custom"
FormatString="HH:mm"
Binding="{Binding MyValue, Converter={StaticResource timeSpanConv}}" />
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.cs.txt

@ -34,17 +34,5 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
InitializeComponent(); InitializeComponent();
} }
} }
#if !OPEN_SOURCE
public class Employee
{
public string Name { get; set; }
public bool IsConfirmed { get; set; }
public string Department { get; set; }
}
public class Representent : Employee
{
public string Details { get; set; }
}
#endif
} }

69
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertiesView.xaml.txt

@ -28,7 +28,6 @@
<LineBreak/> <LineBreak/>
<LineBreak/> <LineBreak/>
The sample also demonstrate the usage of CategoryGroupDescription to control the categorization of the elements. The sample also demonstrate the usage of CategoryGroupDescription to control the categorization of the elements.
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -36,7 +35,6 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -48,13 +46,7 @@
<StackPanel Grid.Row="0" Margin="10"> <StackPanel Grid.Row="0" Margin="10">
<TextBlock Text="This sample adds Employee items directly under the Properties property and defines the editor through the DefaultEditorDefinition property." <TextBlock Text="This sample adds Employee items directly under the Properties property and defines the editor through the DefaultEditorDefinition property."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<!--##EXCLUDE_OPEN_SOURCE-->
<TextBlock Text="(Click the XAML and Code tabs to see details.)"
FontStyle="Italic"
Margin="0,10,0,0"/>
<!--##END-->
</StackPanel> </StackPanel>
<!--##INCLUDE_OPEN_SOURCE
<ScrollViewer Grid.Row="1" <ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"> HorizontalScrollBarVisibility="Auto">
@ -65,72 +57,11 @@
<local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/Properties.xaml.txt" /> <local:XamlBox CodeSource="/Samples/PropertyGrid/OpenSourceImages/Properties.xaml.txt" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
##END-->
<!--##EXCLUDE_OPEN_SOURCE-->
<!--
PropertyNameBinding will be used to determine the property name's display text.
Value will be specified through DefaultEditorDefinition.
-->
<DockPanel Grid.Row="1">
<StackPanel DockPanel.Dock="Top" Margin="20"
Orientation="Horizontal">
<TextBlock Margin="0,0,10,0" VerticalAlignment="Center"
Text="Category GroupDescription Property:" />
<ComboBox x:Name="categoryGroupCombo" Width="150"
IsEnabled="{Binding IsCategorized, ElementName=_propertyGrid}"
DisplayMemberPath="PropertyName"
SelectedIndex="0">
<PropertyGroupDescription PropertyName="Department"/>
<PropertyGroupDescription PropertyName="IsConfirmed"/>
</ComboBox>
</StackPanel>
<xctk:PropertyGrid x:Name="_propertyGrid" Width="350" MaxHeight="275" VerticalAlignment="Top"
PropertyNameBinding="{Binding Name}"
CategoryGroupDescription="{Binding SelectedItem, ElementName=categoryGroupCombo}"
SelectedObjectName="Meeting" >
<xctk:PropertyGrid.Properties>
<!--Here we define the items to be displayed in the property grid (a list of Employees). -->
<v:Employee Name="Tom" IsConfirmed="True" Department="Sales"/>
<v:Employee Name="John" IsConfirmed="false" Department="Management"/>
<v:Representent Name="Brad" IsConfirmed="True"
Department="Sales"
Details="On the phone"/>
<v:Employee Name="Kevin" IsConfirmed="false" Department="Management"/>
<v:Employee Name="Jane" IsConfirmed="True" Department="Management"/>
<v:Employee Name="Sean" IsConfirmed="True" Department="Sales"/>
</xctk:PropertyGrid.Properties>
<xctk:PropertyGrid.DefaultEditorDefinition>
<!-- This editor will be the default editor for items of the property grid. -->
<xctk:EditorCheckBoxDefinition Binding="{Binding IsConfirmed}"/>
</xctk:PropertyGrid.DefaultEditorDefinition>
<xctk:PropertyGrid.EditorDefinitions>
<!--
Define a specific editor for the Representent with a "details" field.
Since no PropertyValueBinding is defined, the type of the item itself
will be used as a key to detect the possible defined editor.
-->
<xctk:EditorTemplateDefinition TargetProperties="{x:Type v:Representent}">
<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate >
<StackPanel HorizontalAlignment="Stretch">
<CheckBox IsChecked="{Binding IsConfirmed}" Margin="5,0,0,0" />
<DockPanel HorizontalAlignment="Stretch">
<TextBlock DockPanel.Dock="Left" Text="Details: " VerticalAlignment="Center"/>
<TextBox Text="{Binding Details}" FontStyle="Italic" HorizontalAlignment="Stretch" />
</DockPanel>
</StackPanel>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
</xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
</DockPanel>
<!--##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.cs.txt

@ -87,8 +87,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
set; set;
} }
//# TODODOC
//# Those attribute will be overrien in xaml
[Category( "Information" )] [Category( "Information" )]
[DisplayName( "Favorite Color" )] [DisplayName( "Favorite Color" )]
[Description( "This property uses the ColorPicker as the default editor." )] [Description( "This property uses the ColorPicker as the default editor." )]

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridSpecifyingPropertiesView.xaml.txt

@ -33,18 +33,6 @@
MaxHeight="245" MaxHeight="245"
Margin="10" Margin="10"
AutoGenerateProperties="False"> AutoGenerateProperties="False">
<!--##EXCLUDE_OPEN_SOURCE-->
<!-- //# TODODOC
The following categories DisplayOrder will be overriden -->
<xctk:PropertyGrid.CategoryDefinitions>
<xctk:CategoryDefinition Name="Information"
DisplayOrder="0" />
<xctk:CategoryDefinition Name="Connections"
DisplayOrder="2" />
<xctk:CategoryDefinition Name="Clothes"
DisplayOrder="1" />
</xctk:PropertyGrid.CategoryDefinitions>
<!--##END-->
<xctk:PropertyGrid.PropertyDefinitions> <xctk:PropertyGrid.PropertyDefinitions>
<!-- //# TODODOC <!-- //# TODODOC

23
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.cs.txt

@ -32,32 +32,9 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Gauge.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void BackgroundPortionsButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _gauge.BGPortions;
diag.NewItemTypes = new List<System.Type>() { typeof( GaugePortion ) };
diag.ShowDialog();
}
private void BorderPortionsButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _gauge.BorderPortions;
diag.NewItemTypes = new List<System.Type>() { typeof( BorderGaugePortion ) };
diag.ShowDialog();
}
private void MarkersButton_Click( object sender, RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _gauge.Markers;
diag.NewItemTypes = new List<System.Type>() { typeof( Marker ) };
diag.ShowDialog();
}
#endif
} }
} }

1019
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RadialGaugeView.xaml.txt

File diff suppressed because it is too large

33
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.cs.txt

@ -30,40 +30,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Rating.Views
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void ValueType_SelectionChanged( object sender, System.Windows.Controls.SelectionChangedEventArgs e )
{
if( _valueType.SelectedValue != null )
{
if( _valueType.SelectedValue.ToString() == RatingValueType.Exact.ToString() )
{
_rating.Value = 2.5;
_rating.ValueType = RatingValueType.Exact;
_value.Visibility = System.Windows.Visibility.Visible;
_percentage.Visibility = System.Windows.Visibility.Collapsed;
}
else
{
_rating.Value = 0.5;
_rating.ValueType = RatingValueType.Percentage;
_value.Visibility = System.Windows.Visibility.Collapsed;
_percentage.Visibility = System.Windows.Visibility.Visible;
}
}
}
private void RatingItemsButton_Click( object sender, System.Windows.RoutedEventArgs e )
{
CollectionControlDialog diag = new CollectionControlDialog();
diag.ItemsSource = _rating.Items;
diag.NewItemTypes = new List<System.Type>() { typeof( RatingItem ) };
diag.ShowDialog();
}
private void Rating_RatingValueChanged( object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e )
{
// add custom handling here
}
#endif
} }
} }

432
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RatingView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>The Rating control fills icons to represent a value on a scale. It can be interactive and is also fully customizable.</Run> <Run>The Rating control fills icons to represent a value on a scale. It can be interactive and is also fully customizable.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,409 +33,38 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<conv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<!-- Add Rating Control properties-->
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<!-- Column 1 -->
<TextBlock Text="Value Type:"
VerticalAlignment="Center" />
<ComboBox x:Name="_valueType"
Grid.Column="1"
SelectionChanged="ValueType_SelectionChanged"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the ValueType used for the Rating control."
SelectedValue="{Binding ValueType, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Exact"
Tag="{x:Static xctk:RatingValueType.Exact}" />
<ComboBoxItem Content="Percentage"
Tag="{x:Static xctk:RatingValueType.Percentage}" />
</ComboBox>
<TextBlock Text="Value:"
VerticalAlignment="Center"
Grid.Row="1" />
<xctk:DecimalUpDown x:Name="_value"
Grid.Row="1"
Grid.Column="1"
Minimum="0.00"
Maximum="{Binding ItemCount, ElementName=_rating}"
Increment="0.05"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the current Rating value (exact)."
Value="{Binding Value, ElementName=_rating}" />
<xctk:DecimalUpDown x:Name="_percentage"
Grid.Row="1"
Grid.Column="1"
Minimum="0.00"
Maximum="1.00"
Increment="0.02"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the current Rating value (percentage)."
Visibility="Collapsed"
Value="{Binding Value, ElementName=_rating}" />
<TextBlock Text="Item Count:"
VerticalAlignment="Center"
Grid.Row="2" />
<xctk:IntegerUpDown x:Name="_itemCount"
Grid.Row="2"
Grid.Column="1"
Minimum="0"
Maximum="10"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the amount of elements in the Rating control."
Value="{Binding ItemCount, ElementName=_rating}" />
<TextBlock Text="Stroke:"
VerticalAlignment="Center"
Grid.Row="3" />
<xctk:DoubleUpDown x:Name="_strokeThickness"
Grid.Row="3"
Grid.Column="1"
Minimum="0"
Maximum="5"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the icon's stroke thickness."
Value="{Binding IconStrokeThickness, ElementName=_rating}" />
<TextBlock Text="Precision:"
VerticalAlignment="Center"
Grid.Row="4" />
<ComboBox x:Name="_precision"
Grid.Row="4"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Precision used for the Rating control."
SelectedValue="{Binding Precision, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Full"
Tag="{x:Static xctk:RatingPrecision.Full}" />
<ComboBoxItem Content="Half"
Tag="{x:Static xctk:RatingPrecision.Half}" />
<ComboBoxItem Content="Exact"
Tag="{x:Static xctk:RatingPrecision.Exact}" />
</ComboBox>
<TextBlock Text="Orientation:"
VerticalAlignment="Center"
Grid.Row="5" />
<ComboBox x:Name="_orientation"
Grid.Row="5"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Orientation used for the Rating control."
SelectedValue="{Binding Orientation, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Horizontal"
Tag="{x:Static xctk:RatingOrientation.Horizontal}" />
<ComboBoxItem Content="Vertical"
Tag="{x:Static xctk:RatingOrientation.Vertical}" />
</ComboBox>
<TextBlock Text="FillDirection:"
VerticalAlignment="Center"
Grid.Row="6" />
<ComboBox x:Name="_fillDirection"
Grid.Row="6"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Layout Direction used for the Rating control."
SelectedValue="{Binding FillDirection, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Right"
Tag="{x:Static xctk:RatingFillDirection.Right}" />
<ComboBoxItem Content="Left"
Tag="{x:Static xctk:RatingFillDirection.Left}" />
<ComboBoxItem Content="Up"
Tag="{x:Static xctk:RatingFillDirection.Up}" />
<ComboBoxItem Content="Down"
Tag="{x:Static xctk:RatingFillDirection.Down}" />
</ComboBox>
<TextBlock Text="Rating Items"
VerticalAlignment="Center"
Grid.Row="7" />
<Button x:Name="_ratingItemsButton"
Grid.Row="7"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5"
Content="Rating Items"
Click="RatingItemsButton_Click" />
<!-- Column 2 -->
<TextBlock Text="ReadOnly:"
VerticalAlignment="Center"
Grid.Column="3" />
<CheckBox x:Name="_readOnly"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsChecked="{Binding ReadOnly, ElementName=_rating}" />
<TextBlock Text="Height:"
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="3" />
<xctk:IntegerUpDown x:Name="_height"
Grid.Row="1"
Grid.Column="4"
Minimum="10"
Maximum="100"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the height of the Rating control."
Value="{Binding IconHeight, ElementName=_rating}" />
<TextBlock Text="Icon Padding:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="3" />
<xctk:DecimalUpDown x:Name="_iconPadding"
Grid.Row="2"
Grid.Column="4"
Minimum="0.0"
Maximum="20.0"
Increment="1.0"
VerticalAlignment="Center"
Margin="5"
ToolTip="Indicates the padding used between each icon."
Value="{Binding IconPadding, ElementName=_rating}" />
<TextBlock Text="Icon Type:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="3" />
<ComboBox x:Name="_iconType"
Grid.Row="3"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the IconType used for the Rating control."
SelectedValue="{Binding IconType, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Star"
Tag="{x:Static xctk:RatingIconType.Star}" />
<ComboBoxItem Content="Circle"
Tag="{x:Static xctk:RatingIconType.Circle}" />
<ComboBoxItem Content="Square"
Tag="{x:Static xctk:RatingIconType.Square}" />
<ComboBoxItem Content="Triangle"
Tag="{x:Static xctk:RatingIconType.Triangle}" />
<ComboBoxItem Content="Custom"
Tag="{x:Static xctk:RatingIconType.Custom}" />
</ComboBox>
<TextBlock Text="Custom Path:"
VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="3" />
<TextBox x:Name="_customPath"
Grid.Row="4"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsEnabled="False"
ToolTip="Gets/Sets the path for the custom icon used for the Rating control."
Text="{Binding CustomPath, ElementName=_rating}" />
<TextBlock Text="Value Tooltip"
VerticalAlignment="Center"
Grid.Row="5"
Grid.Column="3" />
<CheckBox x:Name="_showTooltip"
Grid.Row="5"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsChecked="{Binding ShowValueTooltip, ElementName=_rating}" />
<TextBlock Text="Show Labels"
VerticalAlignment="Center"
Grid.Row="6"
Grid.Column="3" />
<CheckBox x:Name="_showLabels"
Grid.Row="6"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
IsChecked="{Binding ShowLabels, ElementName=_rating}" />
<TextBlock Text="Label Position:"
VerticalAlignment="Center"
Grid.Row="7"
Grid.Column="3" />
<ComboBox x:Name="_labelPosition"
Grid.Row="7"
Grid.Column="4"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the Position for the Labels."
SelectedValue="{Binding LabelPosition, ElementName=_rating}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Before"
Tag="{x:Static xctk:RatingLabelPosition.Before}" />
<ComboBoxItem Content="After"
Tag="{x:Static xctk:RatingLabelPosition.After}" />
</ComboBox>
<!-- Column 3 -->
<TextBlock Text="Active Border:"
VerticalAlignment="Center"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_activeBorder"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's border [active state]."
SelectedColor="{Binding ActiveBorderColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Active Fill:"
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_activeFill"
Grid.Row="1"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's fill [active state]."
SelectedColor="{Binding ActiveFillColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Inactive Border:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_inactiveBorder"
Grid.Row="2"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's border [inactive state]."
SelectedColor="{Binding InactiveBorderColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Inactive Fill:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_inactiveFill"
Grid.Row="3"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's fill [inactive state]."
SelectedColor="{Binding InactiveFillColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Hover Border:"
VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_hoverBorder"
Grid.Row="4"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's border [hover state]."
SelectedColor="{Binding HoverBorderColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
<TextBlock Text="Hover Fill:"
VerticalAlignment="Center"
Grid.Row="5"
Grid.Column="6" />
<xctk:ColorPicker x:Name="_hoverFill"
Grid.Row="5"
Grid.Column="7"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the color of the icon's fill [hover state]."
SelectedColor="{Binding HoverFillColor, ElementName=_rating, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</Grid>
</GroupBox>
<StackPanel Grid.Row="1"
Margin="10">
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:Rating Name="_rating"
VerticalAlignment="top"
HorizontalAlignment="Left"
ValueType="Exact"
ReadOnly="True"
IconHeight="50"
ItemCount="5"
Value="2.5"
Orientation="Horizontal"
FillDirection="Right"
Precision="Exact"
IconType="Star"
CustomPath="M 0,19 L 35,39 24,45 55,63 47,68 100,100 67,58 75,54 51,32 58,28 39,0 z"
IconPadding="2"
IconStrokeThickness="1"
ActiveBorderColor="Black"
ActiveFillColor="Orange"
InactiveBorderColor="Blue"
InactiveFillColor="AliceBlue"
HoverBorderColor="Red"
HoverFillColor="Yellow"
ShowValueTooltip="False"
RatingValueChanged="Rating_RatingValueChanged" />
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\Rating.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\Rating.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RichTextboxView.xaml.cs.txt

@ -27,7 +27,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Text.Views
{ {
PlainText, PlainText,
Rtf, Rtf,
Xaml Xaml,
Html
}; };
/// <summary> /// <summary>
@ -63,6 +64,10 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Text.Views
{ {
_richTextBox.TextFormatter = new XamlFormatter(); _richTextBox.TextFormatter = new XamlFormatter();
} }
else if (object.Equals(TextFormatterEnum.Html, tagValue))
{
_richTextBox.TextFormatter = new HtmlFormatter();
}
} }
} }
} }

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/RichTextboxView.xaml.txt

@ -49,6 +49,7 @@
<ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.PlainText}">Plain Text</ComboBoxItem> <ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.PlainText}">Plain Text</ComboBoxItem>
<ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.Rtf}">RTF</ComboBoxItem> <ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.Rtf}">RTF</ComboBoxItem>
<ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.Xaml}">Xaml</ComboBoxItem> <ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.Xaml}">Xaml</ComboBoxItem>
<ComboBoxItem Tag="{x:Static rich:TextFormatterEnum.Html}">Html</ComboBoxItem>
</ComboBox> </ComboBox>
<TextBlock Text="Text:" Grid.Row="1" VerticalAlignment="Center"/> <TextBlock Text="Text:" Grid.Row="1" VerticalAlignment="Center"/>
<TextBox x:Name="_text" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" IsReadOnly="True" Width="500" Height="70" Margin="5" ScrollViewer.VerticalScrollBarVisibility="Auto" <TextBox x:Name="_text" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" IsReadOnly="True" Width="500" Height="70" Margin="5" ScrollViewer.VerticalScrollBarVisibility="Auto"

22
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SlideShowView.xaml.cs.txt

@ -38,29 +38,7 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.SlideShow.Views
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
ObservableCollection<PictureItem> pictures = new ObservableCollection<PictureItem>();
for (int i = 1; i <= 9; i++)
{
BitmapImage image = new BitmapImage();
image.BeginInit();
string filename = ("pack://application:,,,/Xceed.Wpf.Toolkit.LiveExplorer;component/Samples/SlideShow/Resources/photo_" + i + ".jpg");
image.UriSource = new Uri(filename, UriKind.RelativeOrAbsolute);
pictures.Add(new PictureItem("Picture " + i , image));
image.EndInit();
}
foreach (PictureItem picItem in pictures)
{
SlideShowItem aSlideShowItem = new SlideShowItem();
Image image = new Image();
image.Source = picItem.Photo;
image.Stretch = Stretch.Fill;
aSlideShowItem.Item = image;
aSlideShowItem.Description = picItem.Description;
_slideShow.Items.Add(aSlideShowItem);
}
#endif
} }
} }

204
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SlideShowView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>The SlideShow is used to display SlideShowItems in a fashion similar to a diaporama. SlideShowItems are not limited to images and can be built using any UIElement.</Run> <Run>The SlideShow is used to display SlideShowItems in a fashion similar to a diaporama. SlideShowItems are not limited to images and can be built using any UIElement.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,191 +33,28 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<conv:CountToIndexConverter x:Key="CountToIndexConverter" />
<conv:IndexToPositionConverter x:Key="IndexToPositionConverter" />
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="0,5,10,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="180" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="75" />
</Grid.ColumnDefinitions>
<!-- 1st Column-->
<!--Display DisplayCountLabel-->
<TextBlock Text="DisplayCountLabel: "
VerticalAlignment="Center" />
<CheckBox x:Name="_displayCountLabel"
Grid.Column="1"
IsChecked="{Binding DisplayCountLabel, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--Display Caption-->
<TextBlock Grid.Row="1"
Text="Display Caption: "
VerticalAlignment="Center" />
<CheckBox Grid.Row="1"
x:Name="_displayCaption"
Grid.Column="1"
IsChecked="{Binding DisplayCaption, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--SliderNavigation Bar-->
<TextBlock Grid.Row="2"
Text="Display SliderNavigationBar: "
VerticalAlignment="Center" />
<CheckBox Grid.Row="2"
x:Name="_displaySliderNavigationBar"
Grid.Column="1"
IsChecked="{Binding DisplaySliderNavigationBar, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--Navigation Bar-->
<TextBlock Grid.Row="3"
Text="Display NavigationBar: "
VerticalAlignment="Center" />
<CheckBox Grid.Row="3"
x:Name="_displayNavigationBar"
Grid.Column="1"
IsChecked="{Binding DisplayNavigationBar, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--SideNavigation Bar-->
<TextBlock Grid.Row="4"
Text="Display SideNavigationButtons: "
VerticalAlignment="Center" />
<CheckBox Grid.Row="4"
x:Name="_displaySideNavigationButtons"
Grid.Column="1"
IsChecked="{Binding DisplaySideNavigationButtons, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--2nd Column-->
<!--PauseSlideShowOnMouseOver-->
<TextBlock Grid.Row="0"
Text="PauseSlideShowOnMouseOver: "
Grid.Column="2"
VerticalAlignment="Bottom"
Margin="10,0,5,5" />
<CheckBox Grid.Row="0"
x:Name="_pauseSlideShowOnMouseOver"
Grid.Column="3"
IsChecked="{Binding PauseSlideShowOnMouseOver, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--AllowLooping-->
<TextBlock Grid.Row="1"
Text="Allow Looping: "
Grid.Column="2"
VerticalAlignment="Bottom"
Margin="10,0,5,5" />
<CheckBox Grid.Row="1"
x:Name="_allowRotation"
Grid.Column="3"
IsChecked="{Binding AllowLooping, ElementName=_slideShow}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="5,5,2,5" />
<!--Interval-->
<TextBlock Grid.Row="2"
Text="TimeInterval: "
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,5,5,5" />
<xctk:IntegerUpDown Grid.Row="2"
x:Name="_interval"
Grid.Column="3"
Minimum="100"
Maximum="10000"
Value="{Binding TimeInterval, ElementName=_slideShow, Mode=TwoWay}"
DisplayDefaultValueOnEmptyText="True"
DefaultValue="500"
Height="20"
Width="50"
Increment="100"
Margin="5,5,16,5"
HorizontalAlignment="Left" />
<!--TransitionMode-->
<TextBlock Grid.Row="3"
Text="TransitionMode: "
Grid.Column="2"
VerticalAlignment="Center"
Margin="10,5,5,5" />
<ComboBox Grid.Row="3"
Grid.Column="3"
SelectedIndex="0"
Width="100"
SelectedValue="{Binding TransitionMode, ElementName=_slideShow}"
SelectedValuePath="Content"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="5,5,16,5">
<ComboBoxItem Content="Sliding" />
<ComboBoxItem Content="Fading" />
<ComboBoxItem Content="None" />
</ComboBox>
</Grid>
</GroupBox>
<StackPanel Grid.Row="1">
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<xctk:SlideShow x:Name="_slideShow"
Height="280"
Margin="-10,0,0,0">
</xctk:SlideShow>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\SlideShow.png" Width="600" Height="280"/> <Image Source="..\OpenSourceImages\SlideShow.png" Width="600" Height="280"/>
##END-->
</local:DemoView> </local:DemoView>

60
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StyleableWindowView.xaml.cs.txt

@ -47,80 +47,28 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Window.Views
private const string MessageBoxStyleKey = "messageBoxStyle"; private const string MessageBoxStyleKey = "messageBoxStyle";
private const string WindowControlStyleKey = "windowControlStyle"; private const string WindowControlStyleKey = "windowControlStyle";
private const string WindowButtonStyle = "FancyButtonStyle"; private const string WindowButtonStyle = "FancyButtonStyle";
#if OPEN_SOURCE
private const string StyleableWindowMessage = "StyleableWindow is a standalone window that can be styled just like ChildWindow or MessageBox. This is a feature of the \"Plus\" version."; private const string StyleableWindowMessage = "StyleableWindow is a standalone window that can be styled just like ChildWindow or MessageBox. This is a feature of the \"Plus\" version.";
#else
private const string StyleableWindowNoStyleKey = "styleableWindowNoStyle";
private const string StyleableWindowStyleKey = "styleableWindowStyle";
private StyleableWindow _styleableWindow;
#endif
public StyleableWindowView() public StyleableWindowView()
{ {
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
this.Unloaded += new RoutedEventHandler( OnSampleUnloaded );
#endif
this.UpdateWindowsStyles(null,null); this.UpdateWindowsStyles(null,null);
} }
#if !OPEN_SOURCE
private void OnSampleUnloaded( object sender, RoutedEventArgs e )
{
//# Be sure to close the window
if( _styleableWindow != null )
{
_styleableWindow.Close();
}
}
#endif
private void OnStyleableWindow_Click( object sender, RoutedEventArgs e ) private void OnStyleableWindow_Click( object sender, RoutedEventArgs e )
{ {
#if OPEN_SOURCE
var msgBox = new Xceed.Wpf.Toolkit.MessageBox(); var msgBox = new Xceed.Wpf.Toolkit.MessageBox();
msgBox.DataContext = this.DataContext; msgBox.DataContext = this.DataContext;
msgBox.Text = StyleableWindowMessage; msgBox.Text = StyleableWindowMessage;
msgBox.Caption = StyledMsgBoxTitle; msgBox.Caption = StyledMsgBoxTitle;
msgBox.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) ? ( Style )this.Resources[ MessageBoxStyleKey ] : null; msgBox.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) ? ( Style )this.Resources[ MessageBoxStyleKey ] : null;
msgBox.ShowDialog(); msgBox.ShowDialog();
#else
if( _styleableWindow == null )
{
_styleableWindow = new StyleableWindow();
_styleableWindow.Width = 500;
_styleableWindow.Height = 300;
_styleableWindow.Title = StyleableWindowTitle;
_styleableWindow.DataContext = this.DataContext;
_styleableWindow.Left = Application.Current.MainWindow.Left + ( Application.Current.MainWindow.ActualWidth / 2 );
_styleableWindow.Top = Application.Current.MainWindow.Top + ( Application.Current.MainWindow.ActualHeight / 2 );
_styleableWindow.Closed += new EventHandler( OnStyleableWindowClosed );
_styleableWindow.Topmost = true;
_styleableWindow.Content = new TextBlock()
{
Text = StyleableWindowContent,
TextWrapping = TextWrapping.Wrap
};
_styleableWindow.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() )
? ( Style )this.Resources[ StyleableWindowStyleKey ]
: ( Style )this.Resources[ StyleableWindowNoStyleKey ];
_styleableWindow.Show();
}
#endif
} }
#if !OPEN_SOURCE
private void OnStyleableWindowClosed( object sender, EventArgs e )
{
_styleableWindow.Closed -= new EventHandler( OnStyleableWindowClosed );
_styleableWindow.Style = null;
_styleableWindow.DataContext = null;
_styleableWindow = null;
}
#endif
private void StandardMessageBoxButton_Click( object sender, RoutedEventArgs e ) private void StandardMessageBoxButton_Click( object sender, RoutedEventArgs e )
{ {
System.Windows.MessageBox.Show( StandardMsgBoxMessage, StandardMsgBoxTitle ); System.Windows.MessageBox.Show( StandardMsgBoxMessage, StandardMsgBoxTitle );
@ -151,14 +99,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Window.Views
_childWindow.ClearValue( ChildWindow.StyleProperty ); _childWindow.ClearValue( ChildWindow.StyleProperty );
} }
#if !OPEN_SOURCE
if( _styleableWindow != null )
{
_styleableWindow.Style = ( styled )
? ( Style )this.Resources[ StyleableWindowStyleKey ]
: ( Style )this.Resources[ StyleableWindowNoStyleKey ];
}
#endif
} }
} }

39
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/StyleableWindowView.xaml.txt

@ -28,12 +28,10 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>The "Plus" version provides a new control called StyleableWindow, which consists of a window that has all the functions of a normal window, but which can be styled in the same way as ChildWindow or MessageBox.</Run> <Run>The "Plus" version provides a new control called StyleableWindow, which consists of a window that has all the functions of a normal window, but which can be styled in the same way as ChildWindow or MessageBox.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -57,11 +55,6 @@
<Setter Property="CaptionForeground" Value="{Binding TitleForeground}" /> <Setter Property="CaptionForeground" Value="{Binding TitleForeground}" />
<Setter Property="CaptionShadowBrush" Value="{Binding TitleShadowBrush}" /> <Setter Property="CaptionShadowBrush" Value="{Binding TitleShadowBrush}" />
<Setter Property="CloseButtonStyle" Value="{Binding CloseButtonStyle}" /> <Setter Property="CloseButtonStyle" Value="{Binding CloseButtonStyle}" />
<!--##EXCLUDE_OPEN_SOURCE-->
<Setter Property="MinimizeButtonStyle" Value="{Binding MinimizeButtonStyle}" />
<Setter Property="MaximizeButtonStyle" Value="{Binding MaximizeButtonStyle}" />
<Setter Property="RestoreButtonStyle" Value="{Binding RestoreButtonStyle}" />
<!--##END-->
</Style> </Style>
<!--Style for the MessageBox--> <!--Style for the MessageBox-->
@ -73,31 +66,6 @@
<Setter Property="NoButtonStyle" Value="{StaticResource FancyButtonStyle}" /> <Setter Property="NoButtonStyle" Value="{StaticResource FancyButtonStyle}" />
</Style> </Style>
<!--##EXCLUDE_OPEN_SOURCE-->
<!--Style for the StyleableWindow-->
<Style x:Key="styleableWindowNoStyle" TargetType="xctk:StyleableWindow" >
<Setter Property="Icon" Value="..\Resources\xceed_icon.png" />
<Setter Property="CloseButtonVisibility" Value="{Binding CloseButtonVisibility}" />
<Setter Property="WindowStyleOverride" Value="{Binding WindowStyle}" />
<Setter Property="ResizeMode" Value="{Binding ResizeMode}" />
<Setter Property="Width" Value="375" />
<Setter Property="Height" Value="150" />
</Style>
<Style x:Key="styleableWindowStyle" TargetType="xctk:StyleableWindow" BasedOn="{StaticResource styleableWindowNoStyle}">
<Setter Property="WindowBackground" Value="{Binding WindowBackground}" />
<Setter Property="WindowBorderBrush" Value="{Binding WindowBorderBrush}" />
<Setter Property="WindowInactiveBackground" Value="{Binding WindowInactiveBackground}" />
<Setter Property="WindowBorderThickness" Value="{Binding WindowBorderThickness}" />
<Setter Property="WindowOpacity" Value="{Binding WindowOpacity}" />
<Setter Property="TitleFontSize" Value="{Binding TitleFontSize}" />
<Setter Property="TitleForeground" Value="{Binding TitleForeground}" />
<Setter Property="TitleShadowBrush" Value="{Binding TitleShadowBrush}" />
<Setter Property="CloseButtonStyle" Value="{Binding CloseButtonStyle}" />
<Setter Property="MinimizeButtonStyle" Value="{Binding MinimizeButtonStyle}" />
<Setter Property="MaximizeButtonStyle" Value="{Binding MaximizeButtonStyle}" />
<Setter Property="RestoreButtonStyle" Value="{Binding RestoreButtonStyle}" />
</Style>
<!--##END-->
</ResourceDictionary> </ResourceDictionary>
</local:DemoView.Resources> </local:DemoView.Resources>
@ -166,7 +134,6 @@
<GroupBox Header="Styleable Window" DockPanel.Dock="Top" Margin="5" HorizontalAlignment="Stretch" > <GroupBox Header="Styleable Window" DockPanel.Dock="Top" Margin="5" HorizontalAlignment="Stretch" >
<Button Width="160" Height="30" Margin="10" HorizontalAlignment="Center" <Button Width="160" Height="30" Margin="10" HorizontalAlignment="Center"
Content="Show" Click="OnStyleableWindow_Click" > Content="Show" Click="OnStyleableWindow_Click" >
<!--##INCLUDE_OPEN_SOURCE
<Button.ContentTemplate> <Button.ContentTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@ -178,7 +145,6 @@
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</Button.ContentTemplate> </Button.ContentTemplate>
##END-->
</Button> </Button>
</GroupBox> </GroupBox>
<GroupBox Header="ChildWindow" Margin="5"> <GroupBox Header="ChildWindow" Margin="5">
@ -192,11 +158,6 @@
WindowState="Open" WindowState="Open"
CloseButtonVisibility="{Binding CloseButtonVisibility}" CloseButtonVisibility="{Binding CloseButtonVisibility}"
WindowStyle="{Binding WindowStyle}" > WindowStyle="{Binding WindowStyle}" >
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:ChildWindow.ResizeMode>
<Binding Path="ResizeMode"/>
</xctk:ChildWindow.ResizeMode>
<!--##END-->
<TextBlock> <TextBlock>
This is the content of the child window. This is the content of the child window.
</TextBlock> </TextBlock>

466
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.cs.txt

@ -24,9 +24,7 @@ using Xceed.Wpf.Toolkit;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.IO; using System.IO;
using System.Diagnostics; using System.Diagnostics;
#if OPEN_SOURCE
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
{ {
@ -37,9 +35,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
{ {
#region Members #region Members
#if !OPEN_SOURCE
private DependencyObject _textBlockIdentifier;
#endif
#endregion #endregion
@ -52,7 +47,6 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
private void OnLayoutComboSelectionChanged( object sender, RoutedEventArgs e ) private void OnLayoutComboSelectionChanged( object sender, RoutedEventArgs e )
{ {
#if OPEN_SOURCE
ComboBox comboBox = sender as ComboBox; ComboBox comboBox = sender as ComboBox;
bool isPlusPanel = (comboBox.SelectedIndex >= 2); bool isPlusPanel = (comboBox.SelectedIndex >= 2);
@ -130,523 +124,63 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Panels.Views
if( _openSourceScreenShotDesc != null ) if( _openSourceScreenShotDesc != null )
_openSourceScreenShotDesc.Text = desc; _openSourceScreenShotDesc.Text = desc;
} }
#endif
} }
private void OnSwitchPanelLayoutChanged( object sender, RoutedEventArgs e ) private void OnSwitchPanelLayoutChanged( object sender, RoutedEventArgs e )
{ {
#if !OPEN_SOURCE
SwitchPanel switchPanel = sender as SwitchPanel;
if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.Canvas )
{
InitCanvasPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.DockPanel )
{
InitDockPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.Grid )
{
InitGridPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.StackedStackPanel )
{
InitStackedStackPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.RelativeCanvas )
{
InitRelativeCanvasPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.RadialCanvas )
{
InitRadialCanvasPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.CameraPanel )
{
InitCameraPanel( switchPanel );
}
else if( switchPanel.ActiveLayout is Xceed.Wpf.Toolkit.Panels.AnimatedTimelinePanel )
{
InitAnimatedTimelinePanel( switchPanel );
}
#endif
} }
#if !OPEN_SOURCE
private void OnCanvasMoveItemComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnCanvas( _textBlockIdentifier, coordinate.X, coordinate.Y );
}
private void OnDockComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null) && (combo.SelectedItem is Dock) )
SetItemPositionOnDockPanel( _textBlockIdentifier, (Dock)combo.SelectedItem );
}
private void OnGridComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnGrid( _textBlockIdentifier, (int)coordinate.X, (int)coordinate.Y );
}
private void OnStackedStackComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is int ) )
SetItemPositionOnStackedStackPanel( _textBlockIdentifier, (int)combo.SelectedItem );
}
private void OnStackedStackPanelStackLengthChanged( object sender, EventArgs e )
{
DoubleUpDown doubleUpDown = sender as DoubleUpDown;
if( doubleUpDown.Value.HasValue )
{
_stackedStackPanel.DefaultStackLength = double.IsNaN( doubleUpDown.Value.Value )
? StackLength.Auto
: new StackLength( doubleUpDown.Value.Value );
}
}
private void OnRelativeLeftTopComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnRelativeCanvas( _textBlockIdentifier, coordinate.X, coordinate.Y, null, null, null );
}
private void OnRelativeWidthHeightComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
SetItemPositionOnRelativeCanvas( _textBlockIdentifier, null, null, coordinate.X, coordinate.Y, null );
}
private void OnRelativePinPointComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
Point pinPoint = new Point( coordinate.X, coordinate.Y );
SetItemPositionOnRelativeCanvas( _textBlockIdentifier, null, null, null, null, pinPoint );
}
private void OnRadialCanvasCenterComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
_radialCanvas.Center = new Point( coordinate.X, coordinate.Y );
}
private void OnRadialCanvasAngleComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is int ) )
{
if( _textBlockIdentifier != null )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetAngle( _textBlockIdentifier, ( int )combo.SelectedItem );
}
}
private void OnRadialCanvasRadiusComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is int ) )
{
if( _textBlockIdentifier != null )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetRadius( _textBlockIdentifier, ( int )combo.SelectedItem );
}
}
private void OnRadialCanvasPinPointComboBoxChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo == null ) || !( combo.SelectedItem is Coordinates ) )
{
throw new InvalidDataException( "ComboBox should contain a coordinate." );
}
Coordinates coordinate = combo.SelectedItem as Coordinates;
Point pinPoint = new Point( coordinate.X, coordinate.Y );
SetItemPositionOnRadialCanvas( _textBlockIdentifier, null, null, pinPoint );
}
private void OnAnimatedTimelineUnitTimeSpanChanged( object sender, EventArgs e )
{
IntegerUpDown integerUpDown = sender as IntegerUpDown;
if( integerUpDown.Value.HasValue )
{
_animatedTimeLinePanel.UnitTimeSpan = (integerUpDown.Value.Value == 0)
? System.TimeSpan.Zero
: new System.TimeSpan( integerUpDown.Value.Value, 0, 0, 0 );
}
}
private void OnAnimatedTimelineDatesChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox combo = sender as ComboBox;
if( ( combo != null ) && ( combo.SelectedItem is string ) )
{
string selectionContent = ( string )combo.SelectedItem;
string[] dateContent = selectionContent.Split( new string[]{ "to" }, StringSplitOptions.RemoveEmptyEntries );
if( dateContent.Length != 2 )
throw new InvalidDataException( "ComboBox should contain 2 date strings." );
if( ( _textBlockIdentifier != null ) && ( _textBlockIdentifier is TextBlock ) )
{
TextBlock textBlock = _textBlockIdentifier as TextBlock;
ResetItemContent( textBlock );
AddToItemContent( textBlock, dateContent[ 0 ], dateContent[ 1 ] );
}
SetItemPositionOnAnimatedTimelinePanel( _textBlockIdentifier, System.DateTime.Parse( dateContent[ 0 ] ), System.DateTime.Parse( dateContent[ 1 ] ) );
}
}
private void OnAnimatedTimelinePanelDeactivated( object sender, RoutedEventArgs e )
{
AnimationPanel animationPanel = sender as AnimationPanel;
if( animationPanel != null )
{
ResetItemContent( "_item1" );
ResetItemContent( "_item2" );
ResetItemContent( "_item3" );
ResetItemContent( "_item4" );
ResetItemContent( "_item5" );
ResetItemContent( "_item6" );
ResetItemContent( "_item7" );
ResetItemContent( "_item8" );
}
}
#endif //!OPEN_SOURCE
#endregion #endregion
#region Methods (Private) #region Methods (Private)
#if !OPEN_SOURCE
private void InitCanvasPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item8" ) as DependencyObject;
SetItemPositionOnCanvas( switchPanel, "_item1", 0, 200 );
SetItemPositionOnCanvas( switchPanel, "_item2", 150, 0 );
SetItemPositionOnCanvas( switchPanel, "_item3", 180, 180 );
SetItemPositionOnCanvas( switchPanel, "_item4", 12, 50 );
SetItemPositionOnCanvas( switchPanel, "_item5", 400, 30 );
SetItemPositionOnCanvas( switchPanel, "_item6", 500, 200 );
SetItemPositionOnCanvas( switchPanel, "_item7", 260, 50 );
SetItemPositionOnCanvas( switchPanel, "_item8", 600, 0 );
}
}
private void InitDockPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item2" ) as DependencyObject;
}
private void InitGridPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item4" ) as DependencyObject;
SetItemPositionOnGrid( switchPanel, "_item1", 1, 2 );
SetItemPositionOnGrid( switchPanel, "_item2", 3, 0 );
SetItemPositionOnGrid( switchPanel, "_item3", 2, 1 );
SetItemPositionOnGrid( switchPanel, "_item4", 3, 2 );
SetItemPositionOnGrid( switchPanel, "_item5", 3, 1 );
SetItemPositionOnGrid( switchPanel, "_item6", 2, 0 );
SetItemPositionOnGrid( switchPanel, "_item7", 0, 0 );
SetItemPositionOnGrid( switchPanel, "_item8", 1, 1 );
}
}
private void InitStackedStackPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item5" ) as DependencyObject;
SetItemPositionOnStackedStackPanel( switchPanel, "_item1", 1 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item2", 3 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item3", 2 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item4", 3 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item5", 2 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item6", 2 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item7", 0 );
SetItemPositionOnStackedStackPanel( switchPanel, "_item8", 1 );
}
}
private void InitRelativeCanvasPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item6" ) as DependencyObject;
SetItemPositionOnRelativeCanvas( switchPanel, "_item1", 0.3, 0.1 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item2", 0.55, 0 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item3", 0.6, 0.75 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item4", 0.05, 0.2 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item5", 0.45, 0.9 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item6", 0.2, 0.7 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item7", 0.5, 0.4 );
SetItemPositionOnRelativeCanvas( switchPanel, "_item8", 0.85, 0.8 );
}
}
private void InitRadialCanvasPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item7" ) as DependencyObject;
SetItemPositionOnRadialCanvas( switchPanel, "_item1", 278, 0 );
SetItemPositionOnRadialCanvas( switchPanel, "_item2", 100, 145 );
SetItemPositionOnRadialCanvas( switchPanel, "_item3", 125, 270 );
SetItemPositionOnRadialCanvas( switchPanel, "_item4", 200, 335 );
SetItemPositionOnRadialCanvas( switchPanel, "_item5", 200, 30 );
SetItemPositionOnRadialCanvas( switchPanel, "_item6", 25, 0 );
SetItemPositionOnRadialCanvas( switchPanel, "_item7", 175, 200 );
SetItemPositionOnRadialCanvas( switchPanel, "_item8", 300, 175 );
}
}
private void InitCameraPanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item3" ) as DependencyObject;
SetItemPositionOnCameraPanel( switchPanel, "_item1", 50, 100, 100 );
SetItemPositionOnCameraPanel( switchPanel, "_item2", 400, 175, 25 );
SetItemPositionOnCameraPanel( switchPanel, "_item3", 250, 300, 200 );
SetItemPositionOnCameraPanel( switchPanel, "_item4", 75, 0, 50 );
SetItemPositionOnCameraPanel( switchPanel, "_item5", 500, 150, 2 );
SetItemPositionOnCameraPanel( switchPanel, "_item6", 25, 300, 90 );
SetItemPositionOnCameraPanel( switchPanel, "_item7", 0, 200, 300 );
SetItemPositionOnCameraPanel( switchPanel, "_item8", 450, 250, 100 );
}
}
private void InitAnimatedTimelinePanel( SwitchPanel switchPanel )
{
if( ( switchPanel != null ) && ( switchPanel.ActiveLayout != null ) )
{
_textBlockIdentifier = switchPanel.ActiveLayout.FindName( "_item2" ) as DependencyObject;
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item1", new System.DateTime( 2012, 1, 1 ), new System.DateTime( 2012, 1, 1 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item2", new System.DateTime( 2012, 1, 3 ), new System.DateTime( 2012, 1, 3 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item3", new System.DateTime( 2012, 1, 1 ), new System.DateTime( 2012, 1, 4 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item4", new System.DateTime( 2012, 1, 4 ), new System.DateTime( 2012, 1, 4 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item5", new System.DateTime( 2012, 1, 1 ), new System.DateTime( 2012, 1, 1 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item6", new System.DateTime( 2012, 1, 7 ), new System.DateTime( 2012, 1, 7 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item7", new System.DateTime( 2012, 1, 5 ), new System.DateTime( 2012, 1, 7 ) );
SetItemPositionOnAnimatedTimelinePanel( switchPanel, "_item8", new System.DateTime( 2012, 1, 6 ), new System.DateTime( 2012, 1, 6 ) );
}
}
private void SetItemPositionOnCanvas( SwitchPanel switchPanel, string itemName, double left, double top )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnCanvas( ( DependencyObject )item, left, top );
}
}
private void SetItemPositionOnCanvas( DependencyObject item, double left, double top )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.Canvas.SetLeft( item, left );
Xceed.Wpf.Toolkit.Panels.Canvas.SetTop( item, top );
}
}
private void SetItemPositionOnDockPanel( DependencyObject item, Dock dock )
{
if( item != null )
Xceed.Wpf.Toolkit.Panels.DockPanel.SetDock( item, dock );
}
private void SetItemPositionOnGrid( SwitchPanel switchPanel, string itemName, int row, int column )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnGrid( ( DependencyObject )item, row, column );
}
}
private void SetItemPositionOnGrid( DependencyObject item, int row, int column )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.Grid.SetRow( item, row );
Xceed.Wpf.Toolkit.Panels.Grid.SetColumn( item, column );
}
}
private void SetItemPositionOnStackedStackPanel( SwitchPanel switchPanel, string itemName, int stacked )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnStackedStackPanel( ( DependencyObject )item, stacked );
}
}
private void SetItemPositionOnStackedStackPanel( DependencyObject item, int stacked )
{
if( item != null )
Xceed.Wpf.Toolkit.Panels.StackedStackPanel.SetStack( item, stacked );
}
private void SetItemPositionOnRelativeCanvas( SwitchPanel switchPanel, string itemName, double left, double top )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnRelativeCanvas( ( DependencyObject )item, left, top, null, null, null );
}
}
private void SetItemPositionOnRelativeCanvas( DependencyObject item, double? left, double? top, double? width, double? height, Point? pinPoint )
{
if( item != null )
{
if( left.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetLeft( item, left.Value );
if( top.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetTop( item, top.Value );
if( width.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetRelativeWidth( item, width.Value );
if( height.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetRelativeHeight( item, height.Value );
if( pinPoint.HasValue )
Xceed.Wpf.Toolkit.Panels.RelativeCanvas.SetPinPoint( item, pinPoint.Value );
}
}
private void SetItemPositionOnRadialCanvas( SwitchPanel switchPanel, string itemName, int radius, int angle )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnRadialCanvas( ( DependencyObject )item, radius, angle, null );
}
}
private void SetItemPositionOnRadialCanvas( DependencyObject item, int? radius, int? angle, Point? pinPoint )
{
if( item != null )
{
if( radius.HasValue )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetRadius( item, radius.Value );
if( angle.HasValue )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetAngle( item, angle.Value );
if( pinPoint.HasValue )
Xceed.Wpf.Toolkit.Panels.RadialCanvas.SetPinPoint( item, pinPoint.Value );
}
}
private void SetItemPositionOnCameraPanel( SwitchPanel switchPanel, string itemName, double left, double top, int depth )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
SetItemPositionOnCameraPanel( ( DependencyObject )item, left, top, depth );
}
}
private void SetItemPositionOnCameraPanel( DependencyObject item, double left, double top, int depth )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.CameraPanel.SetLeft( item, left );
Xceed.Wpf.Toolkit.Panels.CameraPanel.SetTop( item, top );
Xceed.Wpf.Toolkit.Panels.CameraPanel.SetDepth( item, depth );
}
}
private void SetItemPositionOnAnimatedTimelinePanel( SwitchPanel switchPanel, string itemName, System.DateTime date, System.DateTime dateEnd )
{
if( switchPanel != null )
{
object item = switchPanel.ActiveLayout.FindName( itemName ) as object;
AddToItemContent( item, date.ToShortDateString(), dateEnd.ToShortDateString() );
SetItemPositionOnAnimatedTimelinePanel( ( DependencyObject )item, date, dateEnd );
}
}
private void SetItemPositionOnAnimatedTimelinePanel( DependencyObject item, System.DateTime date, System.DateTime dateEnd )
{
if( item != null )
{
Xceed.Wpf.Toolkit.Panels.AnimatedTimelinePanel.SetDate( item, date );
Xceed.Wpf.Toolkit.Panels.AnimatedTimelinePanel.SetDateEnd( item, dateEnd );
}
}
private void AddToItemContent( object o, string date1, string date2 )
{
if( o is TextBlock )
{
string addedString = "\n" + date1 + "\nto " + date2;
( ( TextBlock )o ).Text += addedString;
}
}
private void ResetItemContent( object o )
{
if( o is TextBlock )
{
TextBlock textBlock = ( TextBlock )o;
//# Only keep the first line
int endIndex = textBlock.Text.IndexOf( '\n' );
if( endIndex > 0 )
textBlock.Text = textBlock.Text.Substring( 0, endIndex );
}
}
private void ResetItemContent( string itemName )
{
if( ( _switchPanel != null ) && ( _switchPanel.ActiveLayout != null ) )
{
object textBlock = _switchPanel.ActiveLayout.FindName( itemName );
ResetItemContent( textBlock );
}
}
#endif //!OPEN_SOURCE
#endregion #endregion

828
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/SwitchPanelView.xaml.txt

@ -56,7 +56,6 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<!--##INCLUDE_OPEN_SOURCE
<Style x:Key="plusSuffix" TargetType="TextBlock"> <Style x:Key="plusSuffix" TargetType="TextBlock">
<Setter Property="Margin" Value="5,0,0,0"/> <Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="Text" Value="Plus Only"/> <Setter Property="Text" Value="Plus Only"/>
@ -70,7 +69,6 @@
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
##END-->
<Style x:Key="plusItem" TargetType="ComboBoxItem" > <Style x:Key="plusItem" TargetType="ComboBoxItem" >
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
@ -79,9 +77,7 @@
<DataTemplate> <DataTemplate>
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" Text="{Binding}" /> <TextBlock DockPanel.Dock="Left" Text="{Binding}" />
<!--##INCLUDE_OPEN_SOURCE
<TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" /> <TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
##END-->
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
</Setter.Value> </Setter.Value>
@ -104,80 +100,18 @@
<s:String x:Key="animatedTimelinePanelDescription">Defines an area where items are positioned on a timeline.</s:String> <s:String x:Key="animatedTimelinePanelDescription">Defines an area where items are positioned on a timeline.</s:String>
<conv:ComboBoxToVisibilityConverter x:Key="comboBoxToVisibilityConverter" /> <conv:ComboBoxToVisibilityConverter x:Key="comboBoxToVisibilityConverter" />
<!--##EXCLUDE_OPEN_SOURCE-->
<ObjectDataProvider x:Key="dockCombo" MethodName="GetValues" ObjectType="{x:Type s:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="Dock" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<x:Array x:Key="canvasMovePositionCombo" x:Type="view:Coordinates">
<view:Coordinates X="600" Y="0" />
<view:Coordinates X="300" Y="200" />
</x:Array>
<x:Array x:Key="gridCombo" x:Type="view:Coordinates">
<view:Coordinates X="3" Y="2" />
<view:Coordinates X="1" Y="0" />
<view:Coordinates X="0" Y="1" />
</x:Array>
<x:Array x:Key="stakedStackPanelCombo" x:Type="s:Int32">
<s:Int32>2</s:Int32>
<s:Int32>0</s:Int32>
</x:Array>
<x:Array x:Key="relativeLeftTopCombo" x:Type="view:Coordinates">
<view:Coordinates X="0.2" Y="0.7" />
<view:Coordinates X="0.85" Y="0.25" />
</x:Array>
<x:Array x:Key="relativeWidthHeightCombo" x:Type="view:Coordinates">
<view:Coordinates X="{x:Static s:Double.NaN}" Y="{x:Static s:Double.NaN}" />
<view:Coordinates X="0.1" Y="0.5" />
<view:Coordinates X="0.5" Y="0.1" />
</x:Array>
<x:Array x:Key="relativePinPointCombo" x:Type="view:Coordinates">
<view:Coordinates X="0.5" Y="0.5" />
<view:Coordinates X="0" Y="1" />
<view:Coordinates X="1" Y="0" />
</x:Array>
<x:Array x:Key="radialCanvasCenterCombo" x:Type="view:Coordinates">
<view:Coordinates X="0.5" Y="0.5" />
<view:Coordinates X="0.75" Y="0.25" />
<view:Coordinates X="0.2" Y="0.8" />
</x:Array>
<x:Array x:Key="radialCanvasAngleCombo" x:Type="s:Int32">
<s:Int32>45</s:Int32>
<s:Int32>145</s:Int32>
<s:Int32>200</s:Int32>
<s:Int32>300</s:Int32>
</x:Array>
<x:Array x:Key="radialCanvasRadiusCombo" x:Type="s:Int32">
<s:Int32>0</s:Int32>
<s:Int32>50</s:Int32>
<s:Int32>175</s:Int32>
<s:Int32>250</s:Int32>
</x:Array>
<x:Array x:Key="animatedTimelinePanelDatesCombo" x:Type="s:String">
<s:String>1/3/2012 to 1/3/2012</s:String>
<s:String>1/3/2012 to 1/5/2012</s:String>
<s:String>1/5/2012 to 1/5/2012</s:String>
</x:Array>
<ObjectDataProvider x:Key="overlapBehaviorCombo" MethodName="GetValues" ObjectType="{x:Type s:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="panels:OverlapBehaviorKind" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<xctk:InverseBoolConverter x:Key="inverseBoolConverter" />
<!--##END-->
</local:DemoView.Resources> </local:DemoView.Resources>
<Grid> <Grid>
@ -228,32 +162,6 @@
<xctk:SwitchPanel.Layouts> <xctk:SwitchPanel.Layouts>
<xctk:WrapPanel x:Name="_wrapPanel" ItemWidth="100" ItemHeight="100"/> <xctk:WrapPanel x:Name="_wrapPanel" ItemWidth="100" ItemHeight="100"/>
<xctk:RandomPanel x:Name="_randomPanel" /> <xctk:RandomPanel x:Name="_randomPanel" />
<!--##EXCLUDE_OPEN_SOURCE-->
<xctk:Canvas />
<xctk:Carousel x:Name="_carouselPanel" Tilt="70" MaximumRadius="290" MaximumAngularSeparation="45" />
<xctk:DockPanel />
<xctk:Grid x:Name="_grid" ShowGridLines="True">
<xctk:Grid.ColumnDefinitions>
<xctk:ColumnDefinition />
<xctk:ColumnDefinition />
<xctk:ColumnDefinition />
</xctk:Grid.ColumnDefinitions>
<xctk:Grid.RowDefinitions>
<xctk:RowDefinition />
<xctk:RowDefinition />
<xctk:RowDefinition />
<xctk:RowDefinition />
</xctk:Grid.RowDefinitions>
</xctk:Grid>
<xctk:StackPanel x:Name="_stackPanel" Orientation="Horizontal"/>
<xctk:StackedStackPanel x:Name="_stackedStackPanel"/>
<xctk:AutoStretchStackPanel x:Name="_autoStretchStackPanel" />
<xctk:RelativeCanvas />
<xctk:RadialCanvas x:Name="_radialCanvas"/>
<xctk:CameraPanel x:Name="_cameraPanel" CameraX="130" CameraY="140" CameraZ="310"/>
<xctk:PerspectivePanel x:Name="_perspectivePanel" AnchorX="250" AnchorY="50" ShiftX="150" ShiftY="70" AngleOfTwist="-10" DecayConstant="0.2"/>
<xctk:AnimatedTimelinePanel x:Name="_animatedTimeLinePanel" OverlapBehavior="Stretch" BeginDate="1/01/12" EndDate="1/08/12" SwitchLayoutDeactivated="OnAnimatedTimelinePanelDeactivated"/>
<!--##END-->
</xctk:SwitchPanel.Layouts> </xctk:SwitchPanel.Layouts>
<TextBlock x:Name="_item1" Text="Item #1" Style="{StaticResource panelElement}"/> <TextBlock x:Name="_item1" Text="Item #1" Style="{StaticResource panelElement}"/>
<TextBlock x:Name="_item2" Text="Item #2" Style="{StaticResource panelElement}"/> <TextBlock x:Name="_item2" Text="Item #2" Style="{StaticResource panelElement}"/>
@ -265,7 +173,6 @@
<TextBlock x:Name="_item8" Text="Item #8" Style="{StaticResource panelElement}"/> <TextBlock x:Name="_item8" Text="Item #8" Style="{StaticResource panelElement}"/>
</xctk:SwitchPanel> </xctk:SwitchPanel>
<!--##INCLUDE_OPEN_SOURCE
<Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="250" Visibility="Collapsed" /> <Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="250" Visibility="Collapsed" />
<TextBlock x:Name="_openSourceScreenShotDesc" Grid.Row="3" TextWrapping="Wrap" Visibility="Collapsed" /> <TextBlock x:Name="_openSourceScreenShotDesc" Grid.Row="3" TextWrapping="Wrap" Visibility="Collapsed" />
<StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="4" Orientation="Horizontal" Visibility="Collapsed"> <StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="4" Orientation="Horizontal" Visibility="Collapsed">
@ -276,7 +183,6 @@
</Hyperlink> </Hyperlink>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
##END-->
<GroupBox Header="WrapPanel Toolbox" <GroupBox Header="WrapPanel Toolbox"
Background="White" Background="White"
@ -422,755 +328,41 @@
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>
<!--##EXCLUDE_OPEN_SOURCE-->
<GroupBox Header="CanvasPanel Toolbox"
Background="White"
Grid.Row="3"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=2}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource canvasPanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use ComboBox to change the coordinates of item #8."
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Move Item #8 to (X,Y):" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource canvasMovePositionCombo}}"
SelectedIndex="0"
SelectionChanged="OnCanvasMoveItemComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="Carousel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=3}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource carouselDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--First Column-->
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_carouselPanel}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Text="Are Children Scaled:" VerticalAlignment="Center"/>
<CheckBox Grid.Row="1"
Grid.Column="1"
IsChecked="{Binding AreChildrenScaled, ElementName=_carouselPanel}"
ClickMode="Press"
VerticalAlignment="Center"
Margin="5"/>
<TextBlock Grid.Row="2" Text="Distant Child Scale:" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="2"
Value="{Binding DistantChildScale, ElementName=_carouselPanel}"
Minimum="-2"
Maximum="2"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="3" Text="Tilt:" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="3"
Minimum="-180"
Maximum="180"
Value="{Binding Tilt, ElementName=_carouselPanel}"
VerticalAlignment="Center"
Margin="5" />
<!--Second Column-->
<TextBlock Grid.Column="2" Text="Maximum Angular Separation:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Value="{Binding MaximumAngularSeparation, ElementName=_carouselPanel}"
Minimum="0"
Maximum="45"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="Maximum Radius:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="1"
Value="{Binding MaximumRadius, ElementName=_carouselPanel}"
Minimum="-290"
Maximum="290"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="2" Grid.Column="2" Text="Angular Extent:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="2"
Value="{Binding AngularExtent, ElementName=_carouselPanel}"
Minimum="0"
Maximum="360"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="3" Grid.Column="2" Text="Angular Offset:" VerticalAlignment="Center" Margin="25,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="3"
Minimum="0"
Maximum="360"
Value="{Binding AngularOffset, ElementName=_carouselPanel}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="DockPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=4}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource dockPanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use ComboBox to dock item #2."
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Dock Item #2 to:" VerticalAlignment="Center" Margin="5"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource dockCombo}}"
SelectedIndex="0"
SelectionChanged="OnDockComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="Grid Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=5}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource gridDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use the ComboBox to change the row and column of item #4."
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Show Grid Lines:" VerticalAlignment="Center"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding ShowGridLines, ElementName=_grid}"
Margin="5" />
<TextBlock Grid.Row="1" Text="Move Item #4 to:" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource gridCombo}}"
SelectedIndex="0"
SelectionChanged="OnGridComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="StackPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=6}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource stackPanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_stackPanel}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="StackedStackPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=7}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource stackedStackPanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use the ComboBox to move Item #5 from stack to stack."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_stackedStackPanel}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Text="Move Item #5 to Stack: " VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource stakedStackPanelCombo}}"
SelectedIndex="0"
SelectionChanged="OnStackedStackComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="2" />
<TextBlock Grid.Column="2" Text="Default Stack Length:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<xctk:DoubleUpDown Grid.Column="3"
Value="NaN"
ValueChanged="OnStackedStackPanelStackLengthChanged"
AllowInputSpecialValues="NaN"
Minimum="0"
Maximum="250"
Width="100"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="AutoStretchStackPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=8}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource autoStretchStackPanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_autoStretchStackPanel}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Gap Ratio:" Grid.Row="1" VerticalAlignment="Center"/>
<xctk:DoubleUpDown Grid.Row="1"
Grid.Column="1"
Value="{Binding GapRatio, ElementName=_autoStretchStackPanel}"
AllowInputSpecialValues="None"
Increment="0.5"
Minimum="0"
Maximum="5"
Style="{StaticResource controlInError}"
Width="100"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Is Children Reversed:" Grid.Column="2" VerticalAlignment="Center" Margin="25,0,0,0"/>
<CheckBox Grid.Column="3"
IsChecked="{Binding IsChildOrderReversed, ElementName=_autoStretchStackPanel}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="RelativeCanvas Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=9}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource relativeCanvasDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Click on ComboBoxes to modify left, top, width, height, and pinPoint of item #6 relative to the panel."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Move Item #6 with Relative (Left,Top):" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource relativeLeftTopCombo}}"
SelectedIndex="0"
SelectionChanged="OnRelativeLeftTopComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Use Item #6 with Relative (Width,Height):" Grid.Row="1" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource relativeWidthHeightCombo}}"
SelectedIndex="0"
SelectionChanged="OnRelativeWidthHeightComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Change Item #6 pinPoint (X,Y):" Grid.Column="2" VerticalAlignment="Center" Margin="20,0,0,0"/>
<ComboBox Grid.Column="3"
ItemsSource="{Binding Source={StaticResource relativePinPointCombo}}"
SelectedIndex="0"
SelectionChanged="OnRelativePinPointComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="RadialCanvas Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=10}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource radialCanvasDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Use the ComboBoxes to modify the angle, radius, and pinPoint of Item #7."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Is Auto Arrange:" VerticalAlignment="Center"/>
<CheckBox x:Name="_autoArrangeCheckBox"
Grid.Column="1"
IsChecked="{Binding IsAutoArrange, ElementName=_radialCanvas}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Row="1" Text="Center (X,Y):" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource radialCanvasCenterCombo}}"
SelectedIndex="0"
SelectionChanged="OnRadialCanvasCenterComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Text="Angle for item #7:" VerticalAlignment="Center" Margin="20,0,0,0" IsEnabled="{Binding IsEnabled, ElementName=_radialAngleComboBox}" Style="{StaticResource DisableGrayText}"/>
<ComboBox x:Name="_radialAngleComboBox"
Grid.Column="3"
ItemsSource="{Binding Source={StaticResource radialCanvasAngleCombo}}"
SelectedIndex="2"
SelectionChanged="OnRadialCanvasAngleComboBoxChanged"
IsEnabled="{Binding IsChecked, ElementName=_autoArrangeCheckBox, Converter={StaticResource inverseBoolConverter}}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="1" Text="Radius for item #7:" VerticalAlignment="Center" Margin="20,0,0,0" IsEnabled="{Binding IsEnabled, ElementName=_radialRadiusComboBox}" Style="{StaticResource DisableGrayText}"/>
<ComboBox x:Name="_radialRadiusComboBox"
Grid.Column="3"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource radialCanvasRadiusCombo}}"
SelectedIndex="2"
SelectionChanged="OnRadialCanvasRadiusComboBoxChanged"
IsEnabled="{Binding IsChecked, ElementName=_autoArrangeCheckBox, Converter={StaticResource inverseBoolConverter}}"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="2" Text="PinPoint for item #7:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<ComboBox Grid.Column="3"
Grid.Row="2"
ItemsSource="{Binding Source={StaticResource relativePinPointCombo}}"
SelectedIndex="0"
SelectionChanged="OnRadialCanvasPinPointComboBoxChanged"
Width="100"
Height="22"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="CameraPanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=11}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource cameraPanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="150"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Camera X:" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Value="{Binding CameraX, ElementName=_cameraPanel}"
Minimum="0"
Maximum="400"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Camera Y:" Grid.Row="1" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="1"
Value="{Binding CameraY, ElementName=_cameraPanel}"
Minimum="0"
Maximum="300"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Camera Z:" Grid.Row="2" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="2"
Value="{Binding CameraZ, ElementName=_cameraPanel}"
Minimum="0"
Maximum="500"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Z Scale Factor:" Grid.Row="3" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="3"
Value="{Binding ZScaleFactor, ElementName=_cameraPanel}"
Minimum="1"
Maximum="400"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Text="Position X for item #3:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<Slider Grid.Column="3"
Value="{Binding (xctk:CameraPanel.Left), ElementName=_item3}"
Minimum="0"
Maximum="400"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="1" Text="Position Y for item #3:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="1"
Value="{Binding (xctk:CameraPanel.Top), ElementName=_item3}"
Minimum="0"
Maximum="300"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Grid.Column="2" Grid.Row="2" Text="Position Z for item #3:" VerticalAlignment="Center" Margin="20,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="2"
Value="{Binding (xctk:CameraPanel.Depth), ElementName=_item3}"
Minimum="0"
Maximum="300"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="PerspectivePanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=12}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource perspectivePanelDescription}"
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<!--First Colummn -->
<TextBlock Text="Active Child Index:" VerticalAlignment="Center"/>
<xctk:IntegerUpDown Grid.Column="1"
Value="{Binding ActiveChildIndex, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="7"
Style="{StaticResource controlInError}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Anchor X:" Grid.Row="1" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="1"
Value="{Binding AnchorX, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="500"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Anchor Y:" Grid.Row="2" VerticalAlignment="Center"/>
<Slider Grid.Column="1"
Grid.Row="2"
Value="{Binding AnchorY, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="200"
VerticalAlignment="Center"
Margin="5" />
<!--Second Column -->
<TextBlock Text="Angle of Twist:" Grid.Column="2" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="3"
Value="{Binding AngleOfTwist, ElementName=_perspectivePanel}"
Minimum="-50"
Maximum="50"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Shift X:" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="1"
Value="{Binding ShiftX, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="350"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Shift Y:" Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="3"
Grid.Row="2"
Value="{Binding ShiftY, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="200"
VerticalAlignment="Center"
Margin="5" />
<!--Third Column-->
<TextBlock Text="Decay Constant:" Grid.Column="4" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="5"
Value="{Binding DecayConstant, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="1.5"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Scale Factor X:" Grid.Row="1" Grid.Column="4" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="5"
Grid.Row="1"
Value="{Binding ScaleFactorX, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="1.25"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Scale Factor Y:" Grid.Row="2" Grid.Column="4" VerticalAlignment="Center" Margin="15,0,0,0"/>
<Slider Grid.Column="5"
Grid.Row="2"
Value="{Binding ScaleFactorY, ElementName=_perspectivePanel}"
Minimum="0"
Maximum="1.25"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="AnimatedTimeLinePanel Toolbox"
Grid.Row="3"
Background="White"
Visibility="{Binding SelectedIndex, ElementName=layoutCombo, Converter={StaticResource comboBoxToVisibilityConverter}, ConverterParameter=13}"
Margin="10" >
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{StaticResource animatedTimelinePanelDescription}"
Margin="10,0" />
<TextBlock TextWrapping="Wrap"
Text="Change the position of Item #2 with the ComboBox."
Margin="10,0" />
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--First Colummn -->
<TextBlock Text="Orientation:" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding Source={StaticResource orientationCombo}}"
SelectedItem="{Binding Orientation, ElementName=_animatedTimeLinePanel}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Begin Date:" Grid.Row="1" VerticalAlignment="Center"/>
<DatePicker Grid.Column="1"
Grid.Row="1"
SelectedDate="{Binding BeginDate, ElementName=_animatedTimeLinePanel}"
DisplayDateStart="1/01/12"
DisplayDateEnd="1/07/12"
SelectedDateFormat="Short"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="End Date:" Grid.Row="2" VerticalAlignment="Center"/>
<DatePicker Grid.Column="1"
Grid.Row="2"
SelectedDate="{Binding EndDate, ElementName=_animatedTimeLinePanel}"
DisplayDateStart="1/01/12"
DisplayDateEnd="1/07/12"
SelectedDateFormat="Short"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Overlap Behavior:" Grid.Row="3" VerticalAlignment="Center"/>
<ComboBox Grid.Column="1"
Grid.Row="3"
ItemsSource="{Binding Source={StaticResource overlapBehaviorCombo}}"
SelectedItem="{Binding OverlapBehavior, ElementName=_animatedTimeLinePanel}"
VerticalAlignment="Center"
Margin="5" />
<!--Second Colummn -->
<TextBlock Text="Keep Original Order For Overlap:" Grid.Column="2" VerticalAlignment="Center" Margin="25,0,0,0"/>
<CheckBox Grid.Column="3"
IsChecked="{Binding KeepOriginalOrderForOverlap, ElementName=_animatedTimeLinePanel}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Unit Size:" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" Margin="25,0,0,0" IsEnabled="{Binding Value, ElementName=_unitTimeSpan}" Style="{StaticResource DisableGrayText}"/>
<xctk:DoubleUpDown Grid.Column="3"
Grid.Row="1"
Value="{Binding UnitSize, ElementName=_animatedTimeLinePanel}"
AllowInputSpecialValues="NaN"
Minimum="0"
Maximum="200"
IsEnabled="{Binding Value, ElementName=_unitTimeSpan}"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Unit Time Span (Days):" Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" Margin="25,0,0,0"/>
<xctk:IntegerUpDown x:Name="_unitTimeSpan"
Grid.Column="3"
Grid.Row="2"
Value="0"
ValueChanged="OnAnimatedTimelineUnitTimeSpanChanged"
Minimum="0"
Maximum="7"
VerticalAlignment="Center"
Margin="5" />
<TextBlock Text="Change Item #2 Dates:" Grid.Column="2" Grid.Row="3" VerticalAlignment="Center" Margin="25,0,0,0"/>
<ComboBox Grid.Column="3"
Grid.Row="3"
ItemsSource="{StaticResource animatedTimelinePanelDatesCombo}"
SelectedIndex="0"
SelectionChanged="OnAnimatedTimelineDatesChanged"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</StackPanel>
</GroupBox>
<!--##END-->
</Grid> </Grid>
</Grid> </Grid>
</local:DemoView> </local:DemoView>

139
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.cs.txt

@ -27,12 +27,6 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.IO; using System.IO;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes.Metro;
using System.Diagnostics;
using Xceed.Wpf.Themes.Office2007;
using Xceed.Wpf.Themes.Windows10;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{ {
@ -41,13 +35,8 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingAvalonDockView : DemoView public partial class ThemingAvalonDockView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
#endregion
#endif
#region constructors #region constructors
@ -65,18 +54,10 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{ {
AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem; AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem;
#if OPEN_SOURCE
if( comboBoxItem != null ) if( comboBoxItem != null )
{ {
this.SetOpenSourceImage( comboBoxItem ); this.SetOpenSourceImage( comboBoxItem );
} }
#else
this.SetInternalControlsTheme( comboBoxItem );
if( _accentColorPanel != null )
{
_accentColorPanel.Visibility = Visibility.Hidden;
}
#endif
} }
private void AvalonDockControlsThemes_Initialized( object sender, EventArgs e ) private void AvalonDockControlsThemes_Initialized( object sender, EventArgs e )
@ -87,68 +68,24 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
private void MetroComboBoxItem_Selected( object sender, RoutedEventArgs e ) private void MetroComboBoxItem_Selected( object sender, RoutedEventArgs e )
{ {
AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem; AvalonDockComboBoxItem comboBoxItem = sender as AvalonDockComboBoxItem;
#if OPEN_SOURCE
if( comboBoxItem != null ) if( comboBoxItem != null )
{ {
this.SetOpenSourceImage( comboBoxItem ); this.SetOpenSourceImage( comboBoxItem );
} }
#else
this.SetInternalControlsTheme( comboBoxItem );
if( comboBoxItem != null )
{
comboBoxItem.Tag = this.GetAvalonDockMetroTheme( ( comboBoxItem.ThemeEnum == AvalonDockThemesEnum.MetroDark )
? new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroDarkThemeResourceDictionary() as MetroThemeResourceDictionaryBase
: new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroLightThemeResourceDictionary() as MetroThemeResourceDictionaryBase );
}
#endif
} }
#if !OPEN_SOURCE
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
AvalonDockComboBoxItem comboBoxItem = _themeCombo.SelectedItem as AvalonDockComboBoxItem;
if( comboBoxItem != null )
{
this.SetInternalControlsTheme( comboBoxItem );
if( comboBoxItem.ThemeEnum == AvalonDockThemesEnum.MetroDark )
{
metroDarkComboBoxItem.Tag = this.GetAvalonDockMetroTheme( new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroDarkThemeResourceDictionary() );
}
else if( comboBoxItem.ThemeEnum == AvalonDockThemesEnum.MetroLight )
{
metroLightComboBoxItem.Tag = this.GetAvalonDockMetroTheme( new Xceed.Wpf.AvalonDock.Themes.MetroAccent.AvalonDockMetroLightThemeResourceDictionary() );
}
}
}
private Xceed.Wpf.AvalonDock.Themes.MetroAccentTheme GetAvalonDockMetroTheme( MetroThemeResourceDictionaryBase metroThemeResourceDictionary )
{
if( _accentColorPanel != null )
{
_accentColorPanel.Visibility = Visibility.Visible;
}
metroThemeResourceDictionary.AccentBrush = _accentBrush;
return new Xceed.Wpf.AvalonDock.Themes.MetroAccentTheme( metroThemeResourceDictionary );
}
#endif
#endregion #endregion
#region private Methods #region private Methods
#if OPEN_SOURCE
private void SetOpenSourceImage( AvalonDockComboBoxItem comboBoxItem ) private void SetOpenSourceImage( AvalonDockComboBoxItem comboBoxItem )
{ {
@ -204,86 +141,10 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
} }
} }
#else
private void SetInternalControlsTheme( AvalonDockComboBoxItem comboBoxItem )
{
if( ( comboBoxItem == null ) || ( SampleBorder == null ) )
return;
SampleBorder.Resources.MergedDictionaries.Clear();
if( comboBoxItem != null )
{
switch( comboBoxItem.ThemeEnum )
{
case AvalonDockThemesEnum.Generic:
case AvalonDockThemesEnum.Aero:
case AvalonDockThemesEnum.VS2010:
case AvalonDockThemesEnum.Metro:
break;
case AvalonDockThemesEnum.Office2007Black:
Office2007BlackResourceDictionary office2007Black = new Xceed.Wpf.Themes.Office2007.Office2007BlackResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
office2007Black.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( office2007Black );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlackResourceDictionary() );
break;
case AvalonDockThemesEnum.Office2007Blue:
Office2007BlueResourceDictionary office2007Blue = new Xceed.Wpf.Themes.Office2007.Office2007BlueResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
office2007Blue.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( office2007Blue );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlueResourceDictionary() );
break;
case AvalonDockThemesEnum.Office2007Silver:
Office2007SilverResourceDictionary office2007Silver = new Xceed.Wpf.Themes.Office2007.Office2007SilverResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
office2007Silver.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( office2007Silver );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007SilverResourceDictionary() );
break;
case AvalonDockThemesEnum.Windows10:
Windows10ResourceDictionary windows10 = new Xceed.Wpf.Themes.Windows10.Windows10ResourceDictionary();
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
windows10.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( windows10 );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Windows10.Windows10ResourceDictionary() );
break;
case AvalonDockThemesEnum.MetroDark:
MetroDarkThemeResourceDictionary darkTheme = new Xceed.Wpf.Themes.Metro.MetroDarkThemeResourceDictionary( _accentBrush );
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
darkTheme.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( darkTheme );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroDarkThemeResourceDictionary( _accentBrush ) );
break;
case AvalonDockThemesEnum.MetroLight:
MetroLightThemeResourceDictionary lightTheme = new Xceed.Wpf.Themes.Metro.MetroLightThemeResourceDictionary( _accentBrush );
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
lightTheme.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( lightTheme );
SampleBorder.Resources.MergedDictionaries.Add( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroLightThemeResourceDictionary( _accentBrush ) );
break;
default:
Debug.Assert( false, "Unknown theme" );
break;
}
}
}
#endif
#endregion #endregion
} }

359
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt

@ -27,14 +27,12 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>Changes the themes of the AvalonDock controls. Available themes are System, Aero, VS2010, Metro, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run> <Run>Changes the themes of the AvalonDock controls. Available themes are System, Aero, VS2010, Metro, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>Some features of this sample are only available in the "Plus" version.</Run> <Run>Some features of this sample are only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
@ -44,131 +42,8 @@
<ResourceDictionary Source="../ItemTemplates/Common.xaml" /> <ResourceDictionary Source="../ItemTemplates/Common.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<!--##EXCLUDE_OPEN_SOURCE-->
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate"
TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Style x:Key="plusSuffix" TargetType="TextBlock"> <Style x:Key="plusSuffix" TargetType="TextBlock">
<Setter Property="Margin" Value="5,0,0,0"/> <Setter Property="Margin" Value="5,0,0,0"/>
<Setter Property="Text" Value="Plus Only"/> <Setter Property="Text" Value="Plus Only"/>
@ -182,7 +57,6 @@
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
##END-->
<Style x:Key="plusItem" <Style x:Key="plusItem"
TargetType="ComboBoxItem"> TargetType="ComboBoxItem">
@ -194,9 +68,7 @@
<DockPanel> <DockPanel>
<TextBlock DockPanel.Dock="Left" <TextBlock DockPanel.Dock="Left"
Text="{Binding}" /> Text="{Binding}" />
<!--##INCLUDE_OPEN_SOURCE
<TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" /> <TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
##END-->
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
</Setter.Value> </Setter.Value>
@ -215,9 +87,7 @@
Text="{Binding}" /> Text="{Binding}" />
<TextBlock TextAlignment="Right" <TextBlock TextAlignment="Right"
Style="{StaticResource newSuffix}" /> Style="{StaticResource newSuffix}" />
<!--##INCLUDE_OPEN_SOURCE
<TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" /> <TextBlock TextAlignment="Right" Style="{StaticResource plusSuffix}" />
##END-->
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
</Setter.Value> </Setter.Value>
@ -231,9 +101,7 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<!--##INCLUDE_OPEN_SOURCE
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
##END-->
</Grid.RowDefinitions> </Grid.RowDefinitions>
<GroupBox Header="Features" <GroupBox Header="Features"
@ -282,41 +150,21 @@
Content="Office2007 Black" Content="Office2007 Black"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Black}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Black}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007BlackTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Office2007 Blue" Content="Office2007 Blue"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Blue}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Blue}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007BlueTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Office2007 Silver" Content="Office2007 Silver"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Office2007Silver}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Office2007SilverTheme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem Style="{StaticResource plusItem}" <view:AvalonDockComboBoxItem Style="{StaticResource plusItem}"
Content="Windows 10" Content="Windows 10"
Selected="DefaultComboBoxItem_Selected" Selected="DefaultComboBoxItem_Selected"
ThemeEnum="{x:Static view:AvalonDockThemesEnum.Windows10}"> ThemeEnum="{x:Static view:AvalonDockThemesEnum.Windows10}">
<!--##EXCLUDE_OPEN_SOURCE-->
<view:AvalonDockComboBoxItem.Tag>
<xcad:Windows10Theme />
</view:AvalonDockComboBoxItem.Tag>
<!--##END-->
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
<view:AvalonDockComboBoxItem x:Name="metroDarkComboBoxItem" <view:AvalonDockComboBoxItem x:Name="metroDarkComboBoxItem"
Style="{StaticResource plusItem}" Style="{StaticResource plusItem}"
@ -334,213 +182,8 @@
</view:AvalonDockComboBoxItem> </view:AvalonDockComboBoxItem>
</ComboBox> </ComboBox>
</StackPanel> </StackPanel>
<!--##EXCLUDE_OPEN_SOURCE-->
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1"
Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1"
Orientation="Horizontal"
Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}" />
</StackPanel>
</StackPanel>
</StackPanel>
<!--##END-->
</Grid> </Grid>
</GroupBox> </GroupBox>
@ -663,7 +306,6 @@
</xcad:DockingManager> </xcad:DockingManager>
</Border> </Border>
<!--##INCLUDE_OPEN_SOURCE
<Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="395" Visibility="Collapsed" /> <Image x:Name="_openSourceScreenShot" Grid.Row="2" Height="395" Visibility="Collapsed" />
<StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="3" Orientation="Horizontal" Visibility="Collapsed"> <StackPanel x:Name="_openSourceTextHyperlink" Grid.Row="3" Orientation="Horizontal" Visibility="Collapsed">
<TextBlock Text="This theme is only available in the &quot;Plus&quot; version. "/> <TextBlock Text="This theme is only available in the &quot;Plus&quot; version. "/>
@ -673,6 +315,5 @@
</Hyperlink> </Hyperlink>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
##END-->
</Grid> </Grid>
</local:DemoView> </local:DemoView>

150
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.cs.txt

@ -20,11 +20,6 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using Xceed.Wpf.Toolkit; using Xceed.Wpf.Toolkit;
#if !OPEN_SOURCE
using Xceed.Wpf.Toolkit.Themes;
using Xceed.Wpf.Themes.Metro;
using Xceed.Wpf.Themes;
#endif
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System; using System;
using System.Data; using System.Data;
@ -40,194 +35,49 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingCoreWPFView : DemoView public partial class ThemingCoreWPFView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
public static string DefaultSearchString = "type in your search";
private Storyboard _progressStoryboard = null;
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
private Brush whiteBrush = new SolidColorBrush(Colors.White);
private Brush blackBrush = new SolidColorBrush(Colors.Black);
#endregion
#region Properties
public ObservableCollection<Xceed.Wpf.Samples.SampleData.Product> Products
{
get
{
return Xceed.Wpf.Samples.SampleData.SampleDataProvider.GetProducts();
}
}
#endregion
#endif
#region Constructors #region Constructors
public ThemingCoreWPFView() public ThemingCoreWPFView()
{ {
#if !OPEN_SOURCE
this.Initialized += new EventHandler( WPFControlsThemes_Initialized );
DataContext = this;
#endif
InitializeComponent(); InitializeComponent();
} }
#endregion #endregion
#if !OPEN_SOURCE
#region EventHandlers
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
if( themeComboBox.SelectedItem == null )
return;
if( themeComboBox.SelectedItem.Equals( metroDarkComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroDarkThemeResourceDictionary() );
}
else if( themeComboBox.SelectedItem.Equals( metroLightComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroLightThemeResourceDictionary() );
}
}
#endregion
#region Methods (Private)
private void WPFControlsThemes_Initialized( object sender, EventArgs e )
{
themeComboBox.SelectedIndex = 0;
}
private void SystemComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( null, null, null, null, null, SystemColors.WindowBrush );
}
private void Office2007BlueComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Office2007.Office2007BlueResourceDictionary(), null, null, null, null,
Xceed.Wpf.Themes.Office2007.Office2007BlueResources.ApplicationBackgroundBrush );
}
private void Office2007SilverComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Office2007.Office2007SilverResourceDictionary(), null, null, null, null,
Xceed.Wpf.Themes.Office2007.Office2007SilverResources.ApplicationBackgroundBrush );
}
private void Office2007BlackComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Office2007.Office2007BlackResourceDictionary(),
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationLightBackgroundBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.BorderBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationLightBackgroundBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationLightBackgroundBrush,
Xceed.Wpf.Themes.Office2007.Office2007BlackResources.ApplicationBackgroundBrush );
}
private void Windows10ComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
_accentColorPanel.Visibility = Visibility.Hidden;
ChangeTheme( new Xceed.Wpf.Themes.Windows10.Windows10ResourceDictionary(), null, null, null, null,
Xceed.Wpf.Themes.Windows10.Windows10Resources.ApplicationBackgroundBrush );
}
private void MetroDarkComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroDarkThemeResourceDictionary() );
}
private void MetroLightComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Themes.Metro.MetroLightThemeResourceDictionary() );
}
private void ChangeTheme( Xceed.Wpf.Themes.ThemeResourceDictionary theme, Brush groupBoxBackgroundBrush, Brush groupBoxBorderBrush,
Brush treeViewBackgroundBrush, Brush treeViewBorderBrush, Brush sampleBackgroundBrush )
{
SampleBorder.Resources.MergedDictionaries.Clear();
if( theme != null )
{
//# The licenser will throw on the second call to this if we set a empty key
//# line if we set an empty key.
//# See Licenser.LicenseKey {set;}, "Detect that license was set too soon".
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
theme.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
SampleBorder.Resources.MergedDictionaries.Add( theme );
}
groupBoxBorder.Background = groupBoxBackgroundBrush == null ? Brushes.Transparent : groupBoxBackgroundBrush;
groupBoxBorder.BorderBrush = groupBoxBorderBrush == null ? Brushes.Transparent : groupBoxBorderBrush;
listItemTreeViewBorder.Background = treeViewBackgroundBrush == null ? Brushes.Transparent : treeViewBackgroundBrush;
listItemTreeViewBorder.BorderBrush = treeViewBorderBrush == null ? Brushes.Transparent : treeViewBorderBrush;
SampleBorder.Background = sampleBackgroundBrush;
}
private void ChangeMetroTheme( MetroThemeResourceDictionaryBase metroThemeResourceDictionary )
{
_accentColorPanel.Visibility = Visibility.Visible;
if( metroThemeResourceDictionary != null )
{
metroThemeResourceDictionary.AccentBrush = _accentBrush;
this.ChangeTheme( metroThemeResourceDictionary, null, null, null, null
, ( metroThemeResourceDictionary.GetType() == typeof( MetroDarkThemeResourceDictionary ) ) ? blackBrush : whiteBrush );
}
}
private void animatedProgressToggleButton_Checked( object sender, RoutedEventArgs e )
{
_progressStoryboard = rootLayout.Resources[ "animatedProgressBarStoryboard" ] as Storyboard;
_progressStoryboard.Begin();
}
private void animatedProgressToggleButton_Unchecked( object sender, RoutedEventArgs e )
{
if( _progressStoryboard != null )
_progressStoryboard.Stop();
}
private void TextBox_PreviewGotKeyboardFocus( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e )
{
System.Windows.Controls.TextBox textBox = sender as System.Windows.Controls.TextBox;
if( textBox != null && textBox.Text == ThemingCoreWPFView.DefaultSearchString )
textBox.Text = string.Empty;
}
private void TextBox_PreviewLostKeyboardFocus( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e )
{
System.Windows.Controls.TextBox textBox = sender as System.Windows.Controls.TextBox;
if( textBox != null && string.IsNullOrEmpty( textBox.Text ) )
textBox.Text = ThemingCoreWPFView.DefaultSearchString;
}
#endregion
#endif
} }
} }

1016
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt

File diff suppressed because it is too large

87
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.cs.txt

@ -20,11 +20,6 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using Xceed.Wpf.Toolkit; using Xceed.Wpf.Toolkit;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes;
using Xceed.Wpf.DataGrid.Themes.Metro;
using Xceed.Wpf.DataGrid.Themes;
#endif
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System; using System;
using Xceed.Wpf.Samples.SampleData; using Xceed.Wpf.Samples.SampleData;
@ -41,103 +36,21 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingDataGridView : DemoView public partial class ThemingDataGridView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
#endregion
#endif
public ThemingDataGridView() public ThemingDataGridView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
if( themeComboBox.SelectedItem.Equals( metroDarkComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroDarkThemeResourceDictionary() );
}
else if( themeComboBox.SelectedItem.Equals( metroLightComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroLightThemeResourceDictionary() );
}
}
private void ThemeComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = sender as ComboBox;
if( (comboBox != null) && (_dataGrid != null) )
{
switch( comboBox.SelectedIndex )
{
case 1:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Office2007BlueTheme() );
break;
case 2:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Office2007BlackTheme() );
break;
case 3:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Office2007SilverTheme() );
break;
case 4:
this.ChangeTheme( new Xceed.Wpf.DataGrid.Themes.Windows10Theme() );
break;
case 5:
//# TODODOC
// Using a new instance of Brush to prevent the bug of AccentBrush in MetroTheme :
// if using the same instance of AccentBrush, ThemeKey won't make the difference
// between MetroLight and MetroDark and new Theme won't be applied (see case 156588).
_accentBrush = _accentBrush.Clone();
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroDarkThemeResourceDictionary() );
break;
case 6:
_accentBrush = _accentBrush.Clone();
this.ChangeMetroTheme( new Xceed.Wpf.DataGrid.Themes.Metro.MetroLightThemeResourceDictionary() );
break;
default:
this.ChangeTheme( null );
break;
}
}
}
private void ChangeTheme( Theme dataGridTheme )
{
_accentColorPanel.Visibility = Visibility.Hidden;
_dataGrid.View.Theme = dataGridTheme;
}
private void ChangeMetroTheme( DataGridMetroThemeResourceDictionaryBase metroDataGridThemeResourceDictionary )
{
_accentColorPanel.Visibility = Visibility.Visible;
if( metroDataGridThemeResourceDictionary != null )
{
if( !string.IsNullOrEmpty( Xceed.Wpf.Toolkit.Licenser.LicenseKey ) )
{
metroDataGridThemeResourceDictionary.LicenseKey = Xceed.Wpf.Toolkit.Licenser.LicenseKey;
}
metroDataGridThemeResourceDictionary.AccentBrush = _accentBrush;
_dataGrid.View.Theme = new Xceed.Wpf.DataGrid.Themes.Metro.MetroTheme( metroDataGridThemeResourceDictionary );
}
}
#endif
} }
} }

553
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt

@ -27,529 +27,52 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the datagrid control. Available themes are System, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.DataGrid.Themes.Office2007.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use these themes.</Run> <Run>Changes the themes of the datagrid control. Available themes are System, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.DataGrid.Themes.Office2007.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ItemTemplates/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<xcdg:ImageConverter x:Key="imageConverter" />
<!-- Converter used to return a BitmapImage from a Country name -->
<conv:FlagPathConverter x:Key="flagPathConverter" />
<!-- DataTemplate to display an Employee object -->
<DataTemplate x:Key="employeeDataTemplate">
<Grid MaxHeight="30"
VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Margin="0, 0, 5, 0"
Source="{Binding Photo, Converter={StaticResource imageConverter}, NotifyOnValidationError=False, ValidatesOnDataErrors=False}" />
<StackPanel Grid.Column="1"
Orientation="Horizontal"
VerticalAlignment="Center">
<TextBlock Text="{Binding FirstName, NotifyOnValidationError=False, ValidatesOnDataErrors=False}" />
<TextBlock Text=" " />
<TextBlock Text="{Binding LastName, NotifyOnValidationError=False, ValidatesOnDataErrors=False}" />
</StackPanel>
</Grid>
</DataTemplate>
<!-- DataTemplate to display the $ in Freight column -->
<DataTemplate x:Key="freightDataTemplate">
<TextBlock Text="{Binding StringFormat=\{0:C\}}"
VerticalAlignment="Center" />
</DataTemplate>
<!-- DataTemplate to display a Country -->
<DataTemplate x:Key="countryDataTemplate">
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
Margin="5,0,0,0">
<!--The flagPathConverter resource changes the value of a
group (e.g., "Canada") to an image. -->
<Image MaxHeight="15"
Margin="0, 0, 5, 0"
Source="{Binding Converter={StaticResource flagPathConverter}}" />
<TextBlock Text="{Binding}"
TextTrimming="WordEllipsis"
VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
<xcdg:DataGridCollectionViewSource x:Key="cvsOrders"
Source="{Binding}">
<xcdg:DataGridCollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="ShipCountry" />
<PropertyGroupDescription PropertyName="ShipCity" />
</xcdg:DataGridCollectionViewSource.GroupDescriptions>
</xcdg:DataGridCollectionViewSource>
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate"
TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="themeComboBox" Width="150" Height="25" SelectedIndex="0" SelectionChanged="ThemeComboBoxSelectionChanged">
<ComboBoxItem Content="System" />
<ComboBoxItem Content="Office 2007 Blue" />
<ComboBoxItem Content="Office 2007 Black" />
<ComboBoxItem Content="Office 2007 Silver" />
<ComboBoxItem>
<ComboBoxItem.Content>
<DockPanel>
<TextBlock DockPanel.Dock="Left"
Text="Windows 10" />
</DockPanel>
</ComboBoxItem.Content>
</ComboBoxItem>
<ComboBoxItem x:Name="metroDarkComboBoxItem" Content="Metro Dark" />
<ComboBoxItem x:Name="metroLightComboBoxItem" Content="Metro Light" />
</ComboBox>
</StackPanel>
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1" Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color"/>
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color" />
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Margin="10" HorizontalAlignment="Left" Text="Usage:" Style="{StaticResource Header}"/>
<Border Grid.Row="2" x:Name="myBorder">
<xcdg:DataGridControl x:Name="_dataGrid"
ReadOnly="False"
ItemsSource="{Binding Source={StaticResource cvsOrders}}">
<xcdg:DataGridControl.View>
<xcdg:TableflowView />
</xcdg:DataGridControl.View>
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="OrderID"
Title="Order"
Width="100"
IsMainColumn="True">
</xcdg:Column>
<xcdg:Column FieldName="Employee"
Title="Employee"
Width="160"
CellContentTemplate="{StaticResource employeeDataTemplate}"
GroupValueTemplate="{StaticResource employeeDataTemplate}"/>
<xcdg:Column FieldName="Customer.CompanyName"
Title="Customer"
Width="185"/>
<xcdg:Column FieldName="OrderDate"
Title="Order Date"
Width="120" />
<xcdg:Column FieldName="Shipper.CompanyName"
Title="Ship Via" />
<xcdg:Column FieldName="Freight"
Width="100"
CellContentTemplate="{StaticResource freightDataTemplate}"
GroupValueTemplate="{StaticResource freightDataTemplate}"/>
<xcdg:Column FieldName="ShipCity"
Title="City"
Width="80" />
<xcdg:Column FieldName="ShipCountry"
Title="Country"
CellContentTemplate="{StaticResource countryDataTemplate}"
GroupValueTemplate="{StaticResource countryDataTemplate}"/>
<xcdg:Column FieldName="ShipAddress"
Title="Address"
Width="200" />
<xcdg:Column FieldName="ShipPostalCode"
Title="Postal Code"
Width="120" />
<xcdg:Column FieldName="RequiredDate"
Title="Required Date"
Width="140" />
<xcdg:Column FieldName="ShippedDate"
Title="Shipped Date"
Width="140" />
<xcdg:Column FieldName="ShipName"
Visible="False" />
<xcdg:Column FieldName="ShipRegion"
Visible="False" />
<xcdg:Column FieldName="EmployeeID"
Visible="False" />
<xcdg:Column FieldName="CustomerID"
Visible="False" />
<xcdg:Column FieldName="Customer"
Visible="False" />
<xcdg:Column FieldName="ShipVia"
Visible="False" />
<xcdg:Column FieldName="Shipper"
Visible="False" />
</xcdg:DataGridControl.Columns>
</xcdg:DataGridControl>
</Border>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\DataGridControls.png" Width="700" Height="500"/> <Image Source="..\OpenSourceImages\DataGridControls.png" Width="700" Height="500"/>
##END-->
</local:DemoView> </local:DemoView>

97
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt

@ -16,12 +16,6 @@
using System.Diagnostics; using System.Diagnostics;
using System.Windows; using System.Windows;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes;
using Xceed.Wpf.Toolkit.Themes.Office2007;
using Xceed.Wpf.Toolkit.Themes.Metro;
using Xceed.Wpf.Themes.Metro;
#endif
using System; using System;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
@ -35,122 +29,31 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
/// </summary> /// </summary>
public partial class ThemingExtendedToolkitView : DemoView public partial class ThemingExtendedToolkitView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
private Brush whiteBrush = new SolidColorBrush( Colors.White );
private Brush blackBrush = new SolidColorBrush( Colors.Black );
#endregion
#endif
public ThemingExtendedToolkitView() public ThemingExtendedToolkitView()
{ {
#if !OPEN_SOURCE
this.Initialized += new EventHandler( ToolkitControlsThemes_Initialized );
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
if( themeComboBox.SelectedItem == null )
return;
if( themeComboBox.SelectedItem.Equals( metroDarkComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroDarkThemeResourceDictionary()
, blackBrush );
}
else if( themeComboBox.SelectedItem.Equals( metroLightComboBoxItem ) )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroLightThemeResourceDictionary()
, whiteBrush );
}
}
private void ToolkitControlsThemes_Initialized( object sender,EventArgs e )
{
themeComboBox.SelectedIndex = 0;
}
private void SystemComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( null );
}
private void Office2007BlueComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlueResourceDictionary() );
}
private void Office2007SilverComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007SilverResourceDictionary() );
}
private void Office2007BlackComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Office2007.Office2007BlackResourceDictionary() );
}
private void Windows10ComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeTheme( new Xceed.Wpf.Toolkit.Themes.Windows10.Windows10ResourceDictionary() );
}
private void MetroDarkComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroDarkThemeResourceDictionary()
, blackBrush );
}
private void MetroLightComboBoxItem_Selected( object sender, RoutedEventArgs e )
{
this.ChangeMetroTheme( new Xceed.Wpf.Toolkit.Themes.Metro.ToolkitMetroLightThemeResourceDictionary()
, whiteBrush );
}
private void ChangeTheme( ThemeResourceDictionary toolkitTheme)
{
_accentColorPanel.Visibility = Visibility.Hidden;
SampleBorder.Resources.MergedDictionaries.Clear();
if( toolkitTheme != null )
{
SampleBorder.Resources.MergedDictionaries.Add( toolkitTheme );
}
SampleBorder.Background = SystemColors.WindowBrush;
TextElement.SetForeground( SampleBorder, blackBrush );
}
private void ChangeMetroTheme( MetroThemeResourceDictionaryBase metroToolkitThemeResourceDictionary
, Brush sampleBrush)
{
_accentColorPanel.Visibility = Visibility.Visible;
if( metroToolkitThemeResourceDictionary != null )
{
metroToolkitThemeResourceDictionary.AccentBrush = _accentBrush;
SampleBorder.Resources.MergedDictionaries.Clear();
SampleBorder.Resources.MergedDictionaries.Add( metroToolkitThemeResourceDictionary );
}
SampleBorder.Background = sampleBrush;
TextElement.SetForeground( SampleBorder, ( sampleBrush == blackBrush ) ? whiteBrush : blackBrush );
}
#endif
} }
} }

519
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt

@ -25,507 +25,42 @@
<local:DemoView.Description> <local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe"> <Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the Toolkit for WPF controls. Available themes are System, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.Toolkit.Themes.Office2007.dll, Xceed.Wpf.Toolkit.Themes.Windows10.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assemblies are necessary to use the themes.</Run> <Run>Changes the themes of the Toolkit for WPF controls. Available themes are System, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.Toolkit.Themes.Office2007.dll, Xceed.Wpf.Toolkit.Themes.Windows10.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assemblies are necessary to use the themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ItemTemplates/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<x:Array Type="sys:String" x:Key="checkList" >
<sys:String>Blue</sys:String>
<sys:String>Red</sys:String>
<sys:String>Yellow</sys:String>
<sys:String>Green</sys:String>
<sys:String>White</sys:String>
</x:Array>
<Style x:Key="TextBlockStyle"
TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="2" />
<!--Foreground Property is set in code-behind-->
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="450" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid Margin="5" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="themeComboBox" Width="150" Height="25">
<ComboBoxItem Selected="SystemComboBoxItem_Selected"
Content="System" />
<ComboBoxItem Selected="Office2007BlueComboBoxItem_Selected"
Content="Office 2007 Blue" />
<ComboBoxItem Selected="Office2007BlackComboBoxItem_Selected"
Content="Office 2007 Black" />
<ComboBoxItem Selected="Office2007SilverComboBoxItem_Selected"
Content="Office 2007 Silver" />
<ComboBoxItem Selected="Windows10ComboBoxItem_Selected">
<ComboBoxItem.Content>
<DockPanel>
<TextBlock DockPanel.Dock="Left"
Text="Windows 10" />
</DockPanel>
</ComboBoxItem.Content>
</ComboBoxItem>
<ComboBoxItem x:Name="metroDarkComboBoxItem"
Selected="MetroDarkComboBoxItem_Selected"
Content="Metro Dark" />
<ComboBoxItem x:Name="metroLightComboBoxItem"
Selected="MetroLightComboBoxItem_Selected"
Content="Metro Light" />
</ComboBox>
</StackPanel>
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1" Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color" />
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color"/>
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Text="Usage:" Style="{StaticResource Header}" Margin="10" HorizontalAlignment="Left"/>
<Border x:Name="SampleBorder"
Grid.Row="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderThickness="2"
BorderBrush="Black">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="IntegerUpDown:" Style="{StaticResource TextBlockStyle}"/>
<xctk:IntegerUpDown x:Name="_integerUpDown" Value="22" Grid.Column="1" Margin="5"/>
<TextBlock Text="CalculatorUpDown:" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
<xctk:CalculatorUpDown Grid.Row="1" Grid.Column="1" Value="8" Margin="5"/>
<TextBlock Text="DateTimePicker:" Grid.Row="2" Style="{StaticResource TextBlockStyle}"/>
<xctk:DateTimePicker Grid.Row="2" Grid.Column="1" Format="ShortDate" Value="2012/11/16" Margin="5"/>
<TextBlock Text="CheckListBox:" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
<xctk:CheckListBox Grid.Row="3" Grid.Column="1" ItemsSource="{StaticResource checkList}" SelectedItem="Red" Margin="5"/>
<TextBlock Text="DropDownButton:" Grid.Row="4" Style="{StaticResource TextBlockStyle}"/>
<xctk:DropDownButton Grid.Row="4" Grid.Column="1" Content="Show WatermarkTextBox" Margin="5">
<xctk:DropDownButton.DropDownContent>
<StackPanel>
<xctk:WatermarkTextBox Watermark="Enter text here" Width="150"/>
<xctk:WatermarkTextBox Watermark="Enter text here" Width="150"/>
<xctk:WatermarkTextBox Watermark="Enter text here" Width="150"/>
</StackPanel>
</xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>
<TextBlock Text="ColorPicker:" Grid.Row="5" Style="{StaticResource TextBlockStyle}"/>
<xctk:ColorPicker Grid.Row="5" Grid.Column="1" SelectedColor="Blue" DisplayColorAndName="True" Margin="5"/>
<TextBlock Text="MultiLineTextEditor:" Grid.Row="6" Style="{StaticResource TextBlockStyle}"/>
<xctk:MultiLineTextEditor Grid.Row="6" Grid.Column="1" Content="MultiLine" Text="This is a multi-line text editor." Margin="5" />
<TextBlock Text="MaskedTextBox:" Grid.Row="7" Style="{StaticResource TextBlockStyle}"/>
<xctk:MaskedTextBox Grid.Row="7" Grid.Column="1" Mask="(000) 000-0000" Text="5256963" Margin="5" />
<TextBlock Text="ToggleSwitch:" Grid.Row="8" Style="{StaticResource TextBlockStyle}"/>
<xctk:ToggleSwitch Grid.Row="8" Grid.Column="1" Margin="5" Height="20"/>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="PropertyGrid:" Style="{StaticResource TextBlockStyle}"/>
<xctk:PropertyGrid Grid.Row="1" Margin="5" SelectedObject="{Binding ElementName=_integerUpDown}" ShowAdvancedOptions="True" AutoGenerateProperties="False" >
<xctk:PropertyGrid.PropertyDefinitions>
<xctk:PropertyDefinition TargetProperties="Background" />
<xctk:PropertyDefinition TargetProperties="BorderBrush" />
<xctk:PropertyDefinition TargetProperties="BorderThickness" />
<xctk:PropertyDefinition TargetProperties="FontFamily" />
<xctk:PropertyDefinition TargetProperties="FontSize" />
<xctk:PropertyDefinition TargetProperties="FontStretch" />
<xctk:PropertyDefinition TargetProperties="FontStyle" />
<xctk:PropertyDefinition TargetProperties="FontWeight" />
<xctk:PropertyDefinition TargetProperties="Foreground" />
<xctk:PropertyDefinition TargetProperties="IsTabStop" />
<xctk:PropertyDefinition TargetProperties="Content" />
<xctk:PropertyDefinition TargetProperties="HorizontalContentAlignment" />
<xctk:PropertyDefinition TargetProperties="VerticalContentAlignment" />
<xctk:PropertyDefinition TargetProperties="Visibility" />
<xctk:PropertyDefinition TargetProperties="Width" />
<xctk:PropertyDefinition TargetProperties="Height" />
</xctk:PropertyGrid.PropertyDefinitions>
</xctk:PropertyGrid>
</Grid>
</Grid>
</Border>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ExtendedWPFToolkitControls.png" Width="700" Height="500"/> <Image Source="..\OpenSourceImages\ExtendedWPFToolkitControls.png" Width="700" Height="500"/>
##END-->
</local:DemoView> </local:DemoView>

144
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.cs.txt

@ -20,14 +20,6 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using Xceed.Wpf.Toolkit; using Xceed.Wpf.Toolkit;
#if !OPEN_SOURCE
using Xceed.Wpf.ListBox.Themes.Windows10;
using Xceed.Wpf.ListBox.Themes.Office2007;
using Xceed.Wpf.ListBox.Themes.LiveExplorer;
using Xceed.Wpf.ListBox.Themes.Metro;
using Xceed.Wpf.ListBox.Themes.WMP11;
using Xceed.Wpf.ListBox;
#endif
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System; using System;
using Xceed.Wpf.Samples.SampleData; using Xceed.Wpf.Samples.SampleData;
@ -38,177 +30,41 @@ using System.Windows.Threading;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views
{ {
#if !OPEN_SOURCE
public enum ThemesEnum
{
System,
Office2007Blue,
Office2007Black,
Office2007Silver,
Windows10,
LiveExplorer,
MetroDark,
MetroLight,
MediaPlayer
}
#endif
/// <summary> /// <summary>
/// Interaction logic for ThemingListBoxView.xaml /// Interaction logic for ThemingListBoxView.xaml
/// </summary> /// </summary>
public partial class ThemingListBoxView : DemoView public partial class ThemingListBoxView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private Brush _accentBrush = new SolidColorBrush( System.Windows.Media.Color.FromRgb( 255, 152, 29 ) );
private ThemesEnum _selectedTheme = ThemesEnum.System;
private DispatcherTimer _dispatcherTimer;
#endregion
#endif
#region Initialization #region Initialization
public ThemingListBoxView() public ThemingListBoxView()
{ {
#if !OPEN_SOURCE
this.DataContext = SampleDataProvider.GetOrders();
#endif
InitializeComponent(); InitializeComponent();
#if !OPEN_SOURCE
//Add the default GroupDescriptions to the ListBox's GroupDescriptions collection.
_listBox.GroupDescriptions.Add( this.Resources[ "shipCountryGroupDescription" ] as GroupDescription );
_listBox.GroupDescriptions.Add( this.Resources[ "shipCityGroupDescription" ] as GroupDescription );
#endif
} }
#endregion #endregion
#if !OPEN_SOURCE
#region EventHandlers
private void ThemeComboBoxSelectionChanged( object sender, SelectionChangedEventArgs e )
{
ComboBox comboBox = sender as ComboBox;
if( ( comboBox != null ) && ( _listBox != null ) )
{
_selectedTheme = ( ThemesEnum )((ComboBoxItem)comboBox.SelectedItem).Tag;
// Use a DispatcherTimer to update the Theme on the ListBox
// to avoid changing Theme very often.
if( _dispatcherTimer == null )
{
_dispatcherTimer = new DispatcherTimer();
_dispatcherTimer.Tick += new EventHandler( this.DispatcherTimer_Tick );
_dispatcherTimer.Interval = System.TimeSpan.FromMilliseconds( 250d );
}
_dispatcherTimer.Start();
}
}
private void RadioButton_Checked( object sender, RoutedEventArgs e )
{
RadioButton button = sender as RadioButton;
if( button == null )
return;
_accentBrush = button.Background;
if( _accentBrush == null )
return;
// Use a DispatcherTimer to update the Theme on the ListBox
// to avoid changing Theme very often.
if( _dispatcherTimer == null )
{
_dispatcherTimer = new DispatcherTimer();
_dispatcherTimer.Tick += new EventHandler( this.DispatcherTimer_Tick );
_dispatcherTimer.Interval = System.TimeSpan.FromMilliseconds( 250d );
}
_dispatcherTimer.Start();
}
private void DispatcherTimer_Tick( object sender, EventArgs e )
{
DispatcherTimer timer = sender as DispatcherTimer;
// Make sure the timer is still active.
if( timer == null || !timer.IsEnabled )
return;
timer.Stop();
this.ChangeTheme();
}
#endregion
#endif
#if !OPEN_SOURCE
private void ChangeTheme()
{
_listBox.Resources.MergedDictionaries.Clear();
ThemeResourceDictionary themeResourceDictionary;
switch( _selectedTheme )
{
case ThemesEnum.Office2007Blue:
themeResourceDictionary = new Office2007BlueThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.Office2007Black:
themeResourceDictionary = new Office2007BlackThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.Office2007Silver:
themeResourceDictionary = new Office2007SilverThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.Windows10:
themeResourceDictionary = new Windows10ThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.LiveExplorer:
themeResourceDictionary = new LiveExplorerThemeResourceDictionary();
this.InitTheme();
break;
case ThemesEnum.MetroDark:
_accentColorPanel.Visibility = Visibility.Visible;
MetroThemeResourceDictionaryBase metroDarkThemeResourceDictionary = new MetroDarkThemeResourceDictionary();
metroDarkThemeResourceDictionary.AccentBrush = _accentBrush;
themeResourceDictionary = metroDarkThemeResourceDictionary;
break;
case ThemesEnum.MetroLight:
_accentColorPanel.Visibility = Visibility.Visible;
MetroThemeResourceDictionaryBase metroLightThemeResourceDictionary = new MetroLightThemeResourceDictionary();
metroLightThemeResourceDictionary.AccentBrush = _accentBrush;
themeResourceDictionary = metroLightThemeResourceDictionary;
break;
case ThemesEnum.MediaPlayer:
themeResourceDictionary = new WMP11ThemeResourceDictionary();
this.InitTheme();
break;
default:
_accentColorPanel.Visibility = Visibility.Hidden;
themeResourceDictionary = null;
break;
}
if( themeResourceDictionary != null )
{
_listBox.Resources.MergedDictionaries.Add( themeResourceDictionary );
}
}
private void InitTheme()
{
_accentColorPanel.Visibility = Visibility.Hidden;
_listBox.ItemTemplate = Resources[ "orderListBoxItemTemplate" ] as DataTemplate;
}
#endif
} }
} }

366
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt

@ -30,395 +30,29 @@
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, Office2007, LiveExplorer, MediaPlayer, Windows10 and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run> <Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, Office2007, LiveExplorer, MediaPlayer, Windows10 and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
<LineBreak /> <LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ItemTemplates/ItemTemplates.xaml" />
<ResourceDictionary Source="../ItemTemplates/Common.xaml" />
</ResourceDictionary.MergedDictionaries>
<PropertyGroupDescription x:Key="shipCountryGroupDescription"
PropertyName="ShipCountry" />
<PropertyGroupDescription x:Key="shipCityGroupDescription"
PropertyName="ShipCity" />
<Style x:Key="MetroSampleRadioButtonTemplate" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features" Grid.Row="0" Margin="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
<ComboBox x:Name="themeComboBox" Width="150" Height="25"
SelectedIndex="0"
VerticalAlignment="Center"
SelectionChanged="ThemeComboBoxSelectionChanged">
<ComboBoxItem Content="System"
Tag="{x:Static view:ThemesEnum.System}"/>
<ComboBoxItem Content="Office 2007 Blue"
Tag="{x:Static view:ThemesEnum.Office2007Blue}"/>
<ComboBoxItem Content="Office 2007 Black"
Tag="{x:Static view:ThemesEnum.Office2007Black}"/>
<ComboBoxItem Content="Office 2007 Silver"
Tag="{x:Static view:ThemesEnum.Office2007Silver}"/>
<ComboBoxItem Tag="{x:Static view:ThemesEnum.Windows10}">
<ComboBoxItem.Content>
<DockPanel>
<TextBlock DockPanel.Dock="Left"
Text="Windows 10" />
</DockPanel>
</ComboBoxItem.Content>
</ComboBoxItem>
<ComboBoxItem Content="Live Explorer"
Tag="{x:Static view:ThemesEnum.LiveExplorer}"/>
<ComboBoxItem Content="Metro Dark"
Tag="{x:Static view:ThemesEnum.MetroDark}"/>
<ComboBoxItem Content="Metro Light"
Tag="{x:Static view:ThemesEnum.MetroLight}"/>
<ComboBoxItem Content="Media Player"
Tag="{x:Static view:ThemesEnum.MediaPlayer}"/>
</ComboBox>
</StackPanel>
<StackPanel x:Name="_accentColorPanel"
Grid.Column="1" Margin="10,0,0,0"
Orientation="Horizontal"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Visibility="Hidden">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel>
<TextBlock Text="Accent Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Background="#FFF4B300"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Gold"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF78BA00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF2673EC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Blue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAE113D"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="MediumVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF632F00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Brown"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFB01E00"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFC1004F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="PaleVioletRed"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF7200AC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkViolet"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF4617B4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkSlateBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF006AC1"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="RoyalBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF008287"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Teal"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF199900"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Green"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00C13F"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Lime"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
<RadioButton Background="#FFFF981D"
Margin="0,0,2,0"
IsChecked="True"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSalmon"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF2E12"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Red"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF1D77"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepPink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFAA40FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Purple"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF1FAEFF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DeepSkyBlue"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF56C5FF"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkTurquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00D8CC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Turquoise"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF91D100"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="YellowGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFE1B700"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="DarkYellow"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF76BC"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Pink"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FF00A4A4"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="LightSeaGreen"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Background="#FFFF7D23"
Margin="0,0,2,0"
Checked="RadioButton_Checked"
GroupName="themeRadioGroup"
Tag="Orange"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</Grid>
<StackPanel Margin="10,0,0,0">
<TextBlock Text="Custom Color"
FontFamily="Segoe UI"
FontSize="13"
Foreground="#414141" />
<StackPanel Orientation="Horizontal">
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush1}"
GroupName="themeRadioGroup"
Tag="Custom1"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush2}"
GroupName="themeRadioGroup"
Tag="Custom2"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
<RadioButton Margin="0,0,2,0"
Checked="RadioButton_Checked"
Background="{StaticResource customAccentBrush3}"
GroupName="themeRadioGroup"
Tag="Custom3"
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<TextBlock Grid.Row="1" Margin="10" HorizontalAlignment="Left" Text="Usage:" Style="{StaticResource Header}"/>
<Border Grid.Row="2" x:Name="myBorder">
<xclb:ListBox x:Name="_listBox"
ItemsSource="{Binding}"
ItemTemplate="{StaticResource orderListBoxItemTemplate}"
ToolPaneVisibility="Visible">
<xclb:SearchTextBox.FilteredFieldNames>
<xclb:FieldNameList>
<sys:String>ShipCountry</sys:String>
</xclb:FieldNameList>
</xclb:SearchTextBox.FilteredFieldNames>
<xclb:DataNavigationControl.DataNavigationConfiguration>
<xclb:AlphabeticalDataNavigationConfiguration />
</xclb:DataNavigationControl.DataNavigationConfiguration>
</xclb:ListBox>
</Border>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ListBoxControls.png" Width="700" Height="500"/> <Image Source="..\OpenSourceImages\ListBoxControls.png" Width="700" Height="500"/>
##END-->
</local:DemoView> </local:DemoView>

523
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ToggleSwitchView.xaml.txt

@ -27,7 +27,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>The ToggleSwitch control is a fully customizable on/off switch that can be used to enhance the UI experience.</Run> <Run>The ToggleSwitch control is a fully customizable on/off switch that can be used to enhance the UI experience.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -35,504 +34,34 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<local:DemoView.Resources>
<conv:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter" />
<conv:ThicknessToDoubleConverter x:Key="ThicknessToDoubleConverter" />
<conv:CornerRadiusToDoubleConverter x:Key="CornerRadiusToDoubleConverter" />
<localConv:ZeroToBoolConverter x:Key="ZeroToBoolConverter" />
<LinearGradientBrush x:Key="customAccentBrush1"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF0086c6"
Offset="0" />
<GradientStop Color="#FF66ccff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.94" />
<GradientStop Color="#FFddf4ff"
Offset="0.97" />
<GradientStop Color="#FFddf4ff"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush2"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFff0099"
Offset="0" />
<GradientStop Color="#FF993366"
Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="customAccentBrush3"
EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FF9DE214"
Offset="0" />
<GradientStop Color="#FF9DE214"
Offset="0.2" />
<GradientStop Color="#FF95CA2A"
Offset="0.2" />
<GradientStop Color="#FF339933"
Offset="1" />
</LinearGradientBrush>
<Style x:Key="MetroSampleRadioButtonTemplate"
TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
<VisualTransition From="Normal"
GeneratedDuration="0"
To="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.45"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0"
To="0.35"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="rectangle" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0"
To=".2"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="content" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.2" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0"
To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="CheckIcon" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="content"
Width="20"
Height="20"
Fill="{TemplateBinding Background}" />
<Path x:Name="CheckIcon"
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
Fill="White"
FlowDirection="LeftToRight"
Opacity="0"
Stretch="Fill"
UseLayoutRounding="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Width="12"
Height="12"
Margin="0,0,1,1" />
<Rectangle x:Name="rectangle"
Fill="White"
Opacity="0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ThumbStyle1"
TargetType="{x:Type Thumb}">
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Grid>
<Border x:Name="border"
Width="{TemplateBinding ActualWidth}"
Height="{TemplateBinding ActualHeight}"
HorizontalAlignment="Center"
BorderBrush="Orange"
BorderThickness="2"
Background="Black" />
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource TemplatedParent}}"
Value="True">
<Setter Property="Background"
Value="Green"
TargetName="border" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ThumbStyle2"
TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Grid>
<Image Source="..\Resources\PencilTool16.png"
Stretch="None" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Margin="5">
<GroupBox.Resources>
<Style TargetType="TextBlock"
BasedOn="{StaticResource DisableGrayText}">
<Setter Property="Width"
Value="125" />
<Setter Property="Margin"
Value="0,5,0,5" />
</Style>
<Style x:Key="SubHeader"
TargetType="TextBlock">
<Setter Property="Margin"
Value="0,10,0,0" />
<Setter Property="Foreground"
Value="Orange" />
<Setter Property="TextElement.FontWeight"
Value="Bold" />
</Style>
</GroupBox.Resources>
<Grid>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<!-- General Section -->
<StackPanel Grid.Column="0"
Margin="5,0,0,0">
<StackPanel>
<TextBlock Text="Section: General"
Style="{StaticResource SubHeader}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="IsChecked:" />
<CheckBox Width="80"
Margin="0,5,0,0"
IsChecked="{Binding IsChecked, ElementName=_toggleSwitch}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="IsCheckedLeft:" />
<CheckBox Width="80"
Margin="0,5,0,0"
IsChecked="{Binding IsCheckedLeft, ElementName=_toggleSwitch}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Width:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="50.0"
Maximum="300.0"
Increment="1.0"
Value="{Binding Width, ElementName=_toggleSwitch}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Height:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="20.0"
Maximum="100.0"
Increment="0.1"
FormatString="N1"
Value="{Binding Height, ElementName=_toggleSwitch}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Corner Radius:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="0.0"
Maximum="25.0"
Value="{Binding CornerRadius, ElementName=_toggleSwitch, Converter={StaticResource CornerRadiusToDoubleConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Outer Margin:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="0.0"
Maximum="5.0"
Value="{Binding OuterMargin, ElementName=_toggleSwitch, Converter={StaticResource ThicknessToDoubleConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Inner Margin:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="0.0"
Maximum="5.0"
Value="{Binding InnerMargin, ElementName=_toggleSwitch, Converter={StaticResource ThicknessToDoubleConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Border Thickness:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="0.0"
Maximum="3.0"
Value="{Binding BorderThickness, ElementName=_toggleSwitch, Converter={StaticResource ThicknessToDoubleConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Border Brush:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding BorderBrush, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
</StackPanel>
<!-- Checked/Unchecked Sections -->
<StackPanel Grid.Column="1"
Margin="5,0,0,0">
<StackPanel>
<TextBlock Text="Section: Checked"
Style="{StaticResource SubHeader}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Content:" />
<TextBox Width="80"
Margin="0,5,0,0"
Text="{Binding CheckedContent, ElementName=_toggleSwitch, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="ToolTip:" />
<TextBox Width="80"
Margin="0,5,0,0"
Text="{Binding CheckedToolTip, ElementName=_toggleSwitch, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Foreground:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding CheckedForeground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Background:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding CheckedBackground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel>
<TextBlock Text="Section: Unchecked"
Style="{StaticResource SubHeader}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Content:" />
<TextBox Width="80"
Margin="0,5,0,0"
Text="{Binding UncheckedContent, ElementName=_toggleSwitch, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="ToolTip:" />
<TextBox Width="80"
Margin="0,5,0,0"
Text="{Binding UncheckedToolTip, ElementName=_toggleSwitch, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Foreground:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding UncheckedForeground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Background:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding UncheckedBackground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
</StackPanel>
<!-- Thumb -->
<StackPanel Grid.Column="2"
Margin="5,0,0,0">
<StackPanel>
<TextBlock Text="Section: Thumb"
Style="{StaticResource SubHeader}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Width:" />
<xctk:DoubleUpDown Width="80"
Minimum="20"
Maximum="40"
Margin="0,5,0,0"
Value="{Binding ThumbWidth, ElementName=_toggleSwitch}"
ToolTip="Gets/Sets the Width of the Thumb." />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Height:" />
<xctk:DoubleUpDown Width="80"
Minimum="10"
Maximum="50"
Margin="0,5,0,0"
Value="{Binding ThumbHeight, ElementName=_toggleSwitch}"
ToolTip="Gets/Sets the Height of the Thumb." />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Elasticity:" />
<xctk:DoubleUpDown Width="80"
Minimum="10"
Maximum="90"
Margin="0,5,0,0"
Value="{Binding ThumbElasticity, ElementName=_toggleSwitch}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Right Content:" />
<TextBox Width="80"
Margin="0,5,0,0"
Text="{Binding ThumbRightContent, ElementName=_toggleSwitch, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Left Content:" />
<TextBox Width="80"
Margin="0,5,0,0"
Text="{Binding ThumbLeftContent, ElementName=_toggleSwitch, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Border Thickness:" />
<xctk:DoubleUpDown Width="80"
Margin="0,5,0,0"
Minimum="0.0"
Maximum="3.0"
Value="{Binding ThumbBorderThickness, ElementName=_toggleSwitch, Converter={StaticResource ThicknessToDoubleConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Border Brush:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding ThumbBorderBrush, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Foreground:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding ThumbForeground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Background:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding ThumbBackground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Hover Background:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding ThumbHoverBackground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal"
IsEnabled="{Binding SelectedIndex, ElementName=thumbStyleComboBox, Converter={StaticResource ZeroToBoolConverter}}">
<TextBlock Text="Pressed Background:" />
<xctk:ColorPicker Width="80"
Margin="0,5,0,0"
SelectedColor="{Binding ThumbPressedBackground, ElementName=_toggleSwitch, Converter={StaticResource SolidColorBrushToColorConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Style:" />
<ComboBox x:Name="thumbStyleComboBox"
Width="80"
SelectedValue="{Binding ThumbStyle, ElementName=_toggleSwitch}"
SelectedValuePath="Tag"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="0,5,0,0">
<ComboBoxItem Content="Default"
Tag="{x:Null}" />
<ComboBoxItem Content="Style 1"
Tag="{StaticResource ThumbStyle1}" />
<ComboBoxItem Content="Style 2"
Tag="{StaticResource ThumbStyle2}" />
</ComboBox>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
</GroupBox>
<StackPanel x:Name="_samplePanel"
Grid.Row="1"
Margin="10">
<TextBlock Text="Usage:"
Margin="10"
Style="{StaticResource Header}" />
<xctk:ToggleSwitch x:Name="_toggleSwitch"
Margin="10"
CheckedContent="ON"
UncheckedContent="OFF"
Width="80"
Height="25"
ThumbHeight="25"
ThumbWidth="24"
HorizontalAlignment="Center" />
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\ToggleSwitch.png" Width="200" Height="160"/> <Image Source="..\OpenSourceImages\ToggleSwitch.png" Width="200" Height="160"/>
##END-->
</local:DemoView> </local:DemoView>

89
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TokenizedTextBoxView.xaml.cs.txt

@ -30,13 +30,6 @@ using System.Windows.Shapes;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
#if !OPEN_SOURCE
using Xceed.Wpf.Themes;
using Xceed.Wpf.Toolkit.Themes.Office2007;
using Xceed.Wpf.Toolkit.Themes.Metro;
using Xceed.Wpf.Themes.Metro;
using Xceed.Wpf.Samples.SampleData;
#endif
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.TokenizedTextBox.Views namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.TokenizedTextBox.Views
@ -46,107 +39,25 @@ namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.TokenizedTextBox.Views
/// </summary> /// </summary>
public partial class TokenizedTextBoxView : DemoView public partial class TokenizedTextBoxView : DemoView
{ {
#if !OPEN_SOURCE
#region Members
private static ObservableCollection<Record> m_Records;
#endregion
#endif
public TokenizedTextBoxView() public TokenizedTextBoxView()
{ {
#if !OPEN_SOURCE
InitDataSource();
DataContext = this;
#endif
InitializeComponent(); InitializeComponent();
} }
#if !OPEN_SOURCE
void InitDataSource()
{
NorthwindCollections northwind = new NorthwindCollections();
m_Records = new ObservableCollection<Record>();
foreach( var employee in northwind.Employees )
{
m_Records.Add( new Record( employee.FirstName, employee.LastName ) );
}
}
public static ObservableCollection<Record> EmployeeList
{
get
{
return m_Records;
}
}
private void OnDeleteToken( object sender, RoutedEventArgs e )
{
object item = ( ( FrameworkElement )e.OriginalSource ).DataContext;
this.customTokenizedTextBox.SelectedItems.Remove( item );
}
#endif
} }
#if !OPEN_SOURCE
public class Record : INotifyPropertyChanged
{
public Record()
{
}
public Record( string pFirstName, string pLastName )
{
FirstName = pFirstName;
LastName = pLastName;
}
private string m_firstName;
public string FirstName
{
get
{
return m_firstName;
}
set
{
m_firstName = value;
OnPropertyChanged( "FirstName" );
}
}
private string m_lastName;
public string LastName
{
get
{
return m_lastName;
}
set
{
m_lastName = value;
OnPropertyChanged( "LastName" );
}
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged( string name )
{
PropertyChangedEventHandler handler = PropertyChanged;
if( handler != null )
{
handler( this, new PropertyChangedEventArgs( name ) );
}
}
#endregion
}
#endif
} }

321
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TokenizedTextBoxView.xaml.txt

@ -26,7 +26,6 @@
<Paragraph FontSize="14" <Paragraph FontSize="14"
FontFamily="Segoe"> FontFamily="Segoe">
<Run>The TokenizedTextBox lets you display a series of values as tokens. If an ItemsSource is specified, an AutoComplete popup will appear with a filtered list of valid values during edit.</Run> <Run>The TokenizedTextBox lets you display a series of values as tokens. If an ItemsSource is specified, an AutoComplete popup will appear with a filtered list of valid values during edit.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak /> <LineBreak />
<LineBreak /> <LineBreak />
<Run>This feature is only available in the "Plus" version.</Run> <Run>This feature is only available in the "Plus" version.</Run>
@ -34,294 +33,42 @@
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate"> <Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF. Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink> </Hyperlink>
##END-->
</Paragraph> </Paragraph>
</local:DemoView.Description> </local:DemoView.Description>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Margin="5">
<GroupBox.Resources>
<Style TargetType="TextBlock">
<Setter Property="Width" Value="150" />
<Setter Property="Margin" Value="0,5,0,5" />
</Style>
<Style x:Key="SubHeader" TargetType="TextBlock">
<Setter Property="Margin" Value="0,10,0,0" />
<Setter Property="Foreground" Value="Orange" />
<Setter Property="TextElement.FontWeight" Value="Bold" />
</Style>
</GroupBox.Resources>
<Grid Margin="5,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="6*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Is Valid:" />
<TextBlock Width="80"
Margin="0,5,0,0"
ToolTip="False if there is some invalid values or text segments within the TokenizedTextBox that are&#x0a;not yet resolved to a valid item and added to the TokenizedTextBox.SelectedItems collection.&#x0a;&#x0a;In this sample this value is linked to the Default TokenizedTextBox only."
Text="{Binding IsValid, ElementName=defaultTokenizedTextBox}">
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Allow Invalid Values:" />
<CheckBox x:Name="chkAllowInvalidValues"
Width="80"
Margin="0,5,0,0"
IsChecked="{Binding AllowInvalidValues, ElementName=defaultTokenizedTextBox}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Allow Duplicate Values:" />
<CheckBox x:Name="chkAllowDuplicateValues"
Width="80"
Margin="0,5,0,0"
IsChecked="{Binding AllowDuplicateValues, ElementName=defaultTokenizedTextBox}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Token Delimiter:" />
<TextBox Width="15"
Margin="0,5,0,0"
MaxLength="1"
Text="{Binding TokenDelimiter, ElementName=defaultTokenizedTextBox, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</StackPanel>
<StackPanel x:Name="panel1"
Grid.Column="1">
<StackPanel Orientation="Horizontal">
<TextBlock Text="TokenDisplayMemberPath:" />
<TextBox x:Name="txtValueMemberPath"
Width="200"
Margin="0,5,0,0"
IsEnabled="False"
Text="{Binding TokenDisplayMemberPath, ElementName=defaultTokenizedTextBox}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="DisplayMemberPath:" />
<TextBox x:Name="txtDisplayMemberPath"
Width="200"
Margin="0,5,0,0"
IsEnabled="False"
Text="{Binding DisplayMemberPath, ElementName=defaultTokenizedTextBox}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="SearchMemberPaths:" />
<TextBox x:Name="txtSearchMemberPath"
Width="200"
Margin="0,5,0,0"
IsEnabled="False"
Text="{Binding SearchMemberPaths, ElementName=defaultTokenizedTextBox}" />
</StackPanel>
</StackPanel>
<StackPanel x:Name="panel2"
Grid.Column="1"
Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<TextBlock Text="ValueMemberPath:" />
<TextBox x:Name="txtHiddenValueMemberPath"
Width="200"
Margin="0,5,0,0"
IsEnabled="False"
Text="" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="DisplayMemberPath:" />
<TextBox x:Name="txtHiddenDisplayMemberPath"
Width="200"
Margin="0,5,0,0"
IsEnabled="False"
Text="" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="SearchMemberPaths:" />
<TextBox x:Name="txtHiddenSearchMemberPath"
Width="200"
Margin="0,5,0,0"
IsEnabled="False"
Text="" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1"
Grid.ColumnSpan="2">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Text:" />
<TextBox x:Name="txtValue"
Width="477"
Margin="0,5,0,0"
Text="{Binding Text, ElementName=defaultTokenizedTextBox}" />
</StackPanel>
</StackPanel>
<DockPanel Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch">
<TextBlock Text="SelectedItems:"
DockPanel.Dock="Left" />
<Border BorderBrush="Gray"
BorderThickness="1"
Margin="5,5,0,0"
Height="60"
Width="477"
SnapsToDevicePixels="True">
<ScrollViewer>
<ItemsControl ItemsSource="{Binding SelectedItems, ElementName=defaultTokenizedTextBox}"
HorizontalAlignment="Stretch">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1"
BorderBrush="Gray"
SnapsToDevicePixels="True"
Margin="3">
<StackPanel Orientation="Horizontal"
Margin="3">
<TextBlock Text="{Binding FirstName, FallbackValue=(String}"
Margin="0,0,5,0" />
<TextBlock Text="{Binding LastName, FallbackValue=Value)}" />
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</DockPanel>
</Grid>
</GroupBox>
<StackPanel x:Name="_samplePanel"
Grid.Row="1"
Margin="10">
<TextBlock Text="Default:"
Margin="10"
Style="{StaticResource Header}" />
<xctk:TokenizedTextBox x:Name="defaultTokenizedTextBox"
Margin="10"
Width="500"
HorizontalAlignment="Left"
AllowInvalidValues="False"
TokenDelimiter=";"
TokenDisplayMemberPath="FirstName"
DisplayMemberPath="LastName"
SearchMemberPaths="FirstName,LastName"
ItemsSource="{Binding Path=EmployeeList}" />
<TextBlock Text="Customized:"
Margin="10"
Style="{StaticResource Header}" />
<xctk:TokenizedTextBox x:Name="customTokenizedTextBox"
Margin="10"
Width="500"
HorizontalAlignment="Left"
TokenDisplayMemberPath="{Binding TokenDisplayMemberPath, ElementName=defaultTokenizedTextBox}"
AllowDuplicateValues="{Binding AllowDuplicateValues, ElementName=defaultTokenizedTextBox}"
TokenDelimiter="{Binding TokenDelimiter, ElementName=defaultTokenizedTextBox}"
SearchMemberPaths="{Binding SearchMemberPaths, ElementName=defaultTokenizedTextBox}"
ItemsSource="{Binding Path=EmployeeList}">
<xctk:TokenizedTextBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal"
ToolTip="This item's Italic font style was set using the ItemTemplate property">
<TextBlock Text="{Binding FirstName}" FontStyle="Italic"/>
<TextBlock Text="{Binding LastName}" FontStyle="Italic"
Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
</xctk:TokenizedTextBox.ItemTemplate>
<xctk:TokenizedTextBox.TokenItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal"
ToolTip="This item's Bold font style was set using the TokenItemTemplate property">
<TextBlock Text="{Binding FirstName}"
FontWeight="Bold" />
<TextBlock Text="{Binding LastName}"
FontWeight="Bold"
Margin="5,0,0,0" />
</StackPanel>
</DataTemplate>
</xctk:TokenizedTextBox.TokenItemTemplate>
<xctk:TokenizedTextBox.TokenItemContainerStyle>
<Style TargetType="{x:Type xctk:TokenItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xctk:TokenItem}">
<DockPanel>
<Button DockPanel.Dock="Right"
Margin="2,0,0,0"
Padding="0"
BorderThickness="1"
BorderBrush="Gray"
KeyboardNavigation.IsTabStop="False"
Click="OnDeleteToken"
ToolTip="This button was added using the TokenItemContainerStyle property">
<Grid>
<Path Stroke="Red"
StrokeThickness="2"
Data="M 1,1 L 10,10" />
<Path Stroke="Red"
StrokeThickness="2"
Data="M 1,10 L 10,1" />
</Grid>
</Button>
<ContentPresenter />
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</xctk:TokenizedTextBox.TokenItemContainerStyle>
</xctk:TokenizedTextBox>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\TokenizedTextBox.png" Width="600" Height="400"/> <Image Source="..\OpenSourceImages\TokenizedTextBox.png" Width="600" Height="400"/>
##END-->
</local:DemoView> </local:DemoView>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save