Browse Source

finished the base architecture for the sample application. You will be able to view both the XAML and the C# code in tabs while running the sample application. Now I just need to start adding some samples.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
5567f5637e
  1. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Samples.Modules.BusyIndicator.csproj
  2. 19
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml
  3. 16
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml.cs
  4. 10
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/NavigationView.xaml
  5. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Samples.Modules.Button.csproj
  6. 10
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/ButtonSpinnerView.xaml
  7. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/ButtonSpinnerView.xaml.cs
  8. 40
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml
  9. 115
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml.cs
  10. 5
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/NavigationView.xaml
  11. 11
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/NavigationView.xaml.cs
  12. 10
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/SplitButtonView.xaml
  13. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/SplitButtonView.xaml.cs
  14. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Samples.Modules.Calculator.csproj
  15. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorUpDownView.xaml
  16. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorUpDownView.xaml.cs
  17. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorView.xaml
  18. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorView.xaml.cs
  19. 23
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/HomeView.xaml
  20. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/HomeView.xaml.cs
  21. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/NavigationView.xaml
  22. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Samples.Modules.ChildWindow.csproj
  23. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Views/HomeView.xaml
  24. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Views/HomeView.xaml.cs
  25. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Views/NavigationView.xaml
  26. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Samples.Modules.Color.csproj
  27. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Views/HomeView.xaml
  28. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Views/HomeView.xaml.cs
  29. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Views/NavigationView.xaml
  30. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Samples.Modules.DateTime.csproj
  31. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Views/HomeView.xaml
  32. 19
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Views/HomeView.xaml.cs
  33. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Views/NavigationView.xaml
  34. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Samples.Modules.Numeric.csproj
  35. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Views/HomeView.xaml
  36. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Views/HomeView.xaml.cs
  37. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Views/NavigationView.xaml
  38. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Samples.Modules.PropertyGrid.csproj
  39. 33
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Views/HomeView.xaml
  40. 126
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Views/HomeView.xaml.cs
  41. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Views/NavigationView.xaml
  42. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Samples.Modules.Text.csproj
  43. 14
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml
  44. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml.cs
  45. 8
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/NavigationView.xaml
  46. 3
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Samples.Modules.Wizard.csproj
  47. 25
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml
  48. 17
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml.cs
  49. 4
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/NavigationView.xaml
  50. 3
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Commands/TreeViewCommandBehavior.cs
  51. 118
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Controls/DemoView.cs
  52. 43
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Converters/CSharpColorConverter.cs
  53. 121
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Converters/XamlColorConverter.cs
  54. 391
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Core/CodeFormatting/CSharpFormat.cs
  55. 351
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Core/CodeFormatting/XamlFormat.cs
  56. 13
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Samples.Infrastructure.csproj
  57. 154
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Themes/Generic.xaml
  58. 17
      ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/ViewModelBase.cs
  59. 8
      ExtendedWPFToolkitSolution/Src/Samples/Samples/App.xaml
  60. BIN
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Images/Background.jpg
  61. BIN
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Images/Background.png
  62. 231
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Resources/TreeViewStyles.xaml
  63. 6
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Samples.csproj
  64. 92
      ExtendedWPFToolkitSolution/Src/Samples/Samples/Shell.xaml
  65. 4
      ExtendedWPFToolkitSolution/Src/Samples/Samples/ShellViewModel.cs

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Samples.Modules.BusyIndicator.csproj

@ -106,7 +106,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

19
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml

@ -1,17 +1,14 @@
<UserControl x:Class="Samples.Modules.BusyIndicator.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.BusyIndicator.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="BusyIndicator">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="BusyIndicator Title" />
<TextBlock Grid.Row="1" Margin="10" Text="BusyIndicator makes it easy to let the user know when an application is busy. Simply wrap the relevant content in an instance of the BusyIndicator control and toggle its IsBusy property to True during any long-running process.
" TextWrapping="Wrap" />
<TextBlock Grid.Row="1" Margin="10" Text="BusyIndicator makes it easy to let the user know when an application is busy. Simply wrap the relevant content in an instance of the BusyIndicator control and toggle its IsBusy property to True during any long-running process."
TextWrapping="Wrap" />
</Grid>
</UserControl>
</infControls:DemoView>

16
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/HomeView.xaml.cs

@ -1,16 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.BusyIndicator
@ -18,7 +7,8 @@ namespace Samples.Modules.BusyIndicator
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive=false)]
public partial class HomeView : DemoView
{
public HomeView()
{

10
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.BusyIndicator/Views/NavigationView.xaml

@ -1,8 +1,12 @@
<TreeViewItem x:Class="Samples.Modules.BusyIndicator.NavigationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Samples.Modules.BusyIndicator"
xmlns:views="clr-namespace:Samples.Modules.BusyIndicator"
Header="BusyIndicator"
Tag="{x:Type local:HomeView}">
Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Samples.Modules.Button.csproj

@ -127,7 +127,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

10
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/ButtonSpinnerView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.Button.Views.ButtonSpinnerView"
<infControls:DemoView x:Class="Samples.Modules.Button.Views.ButtonSpinnerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="ButtonSpinner">
<Grid>
<TextBlock Text="ButtonSpinner View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/ButtonSpinnerView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Button.Views
{
/// <summary>
/// Interaction logic for ButtonSpinnerView.xaml
/// </summary>
public partial class ButtonSpinnerView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class ButtonSpinnerView : DemoView
{
public ButtonSpinnerView()
{

40
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml

@ -1,35 +1,9 @@
<UserControl x:Class="Samples.Modules.Button.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Button.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="Button Controls">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--<extToolkit:DropDownButton Content="Click Me" Margin="15" Command="{Binding MyCommand}" CommandParameter="{Binding ClickCount}" >
<extToolkit:DropDownButton.DropDownContent>
<extToolkit:ColorCanvas />
</extToolkit:DropDownButton.DropDownContent>
</extToolkit:DropDownButton>
<extToolkit:SplitButton Content="Click Me" Margin="15" Grid.Row="1" Command="{Binding MyCommand}" CommandParameter="{Binding ClickCount}" >
<extToolkit:SplitButton.DropDownContent>
<extToolkit:ColorCanvas />
</extToolkit:SplitButton.DropDownContent>
</extToolkit:SplitButton>-->
<!--<TextBlock Text="Button Module Title" />
<TextBlock Grid.Row="1" Margin="10"
Text="Button module text"
TextWrapping="Wrap" />-->
</Grid>
</UserControl>
</infControls:DemoView>

115
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/HomeView.xaml.cs

@ -1,125 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Button.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{
InitializeComponent();
DataContext = new MyViewModel();
}
}
public class Item
{
public bool IsChecked { get; set; }
public string Name { get; set; }
public Item()
{
}
}
public class MyViewModel : INotifyPropertyChanged
{
public ICommand MyCommand { get; private set; }
private int _clickCount;
public int ClickCount
{
get { return _clickCount; }
set
{
_clickCount = value;
OnPropertyChanged("ClickCount");
}
}
private ObservableCollection<Item> _items;
public ObservableCollection<Item> Items
{
get { return _items; }
set
{
_items = value;
OnPropertyChanged("Items");
}
}
public MyViewModel()
{
MyCommand = new CustomCommand(Execute, CanExecute);
Items = new ObservableCollection<Item>();
for (int i = 0; i < 10; i++)
{
Items.Add(new Item() { IsChecked = i % 2 == 0, Name = String.Format("Item {0}", i) });
}
}
private void Execute(object param)
{
ClickCount++;
//MessageBox.Show(String.Format("Executed {0}", param));
}
private bool CanExecute(object param)
{
return Convert.ToInt32(param) != 5;
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public class CustomCommand : ICommand
{
Action<object> _execute;
Func<object, bool> _canExecute;
public CustomCommand(Action<object> execute, Func<object, bool> canExecute)
{
_execute = execute;
_canExecute = canExecute;
}
public bool CanExecute(object parameter)
{
return _canExecute.Invoke(parameter);
}
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public void Execute(object parameter)
{
_execute(parameter);
}
}
}

5
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/NavigationView.xaml

@ -3,8 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="clr-namespace:Samples.Modules.Button.Views"
Header="Button Controls" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
<TreeViewItem Header="ButtonSpinner" Tag="{x:Type views:ButtonSpinnerView}"/>
<TreeViewItem Header="DropDownButton" />
<TreeViewItem Header="SplitButton" Tag="{x:Type views:SplitButtonView}"/>
</TreeViewItem>

11
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/NavigationView.xaml.cs

@ -1,16 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Samples.Modules.Button.Views
{

10
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/SplitButtonView.xaml

@ -1,7 +1,9 @@
<UserControl x:Class="Samples.Modules.Button.Views.SplitButtonView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<infControls:DemoView x:Class="Samples.Modules.Button.Views.SplitButtonView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="SplitButton">
<Grid>
<TextBlock Text="SplitButton View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Button/Views/SplitButtonView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Button.Views
{
/// <summary>
/// Interaction logic for SplitButtonView.xaml
/// </summary>
public partial class SplitButtonView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class SplitButtonView : DemoView
{
public SplitButtonView()
{

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Samples.Modules.Calculator.csproj

@ -128,7 +128,8 @@
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorUpDownView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.Calculator.Views.CalculatorUpDownView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Calculator.Views.CalculatorUpDownView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="CalculatorUpDown">
<Grid>
<TextBlock Text="CalculatorUpDown view" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorUpDownView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Calculator.Views
{
/// <summary>
/// Interaction logic for CalculatorUpDownView.xaml
/// </summary>
public partial class CalculatorUpDownView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class CalculatorUpDownView : DemoView
{
public CalculatorUpDownView()
{

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.Calculator.Views.CalculatorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Calculator.Views.CalculatorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="Calculator">
<Grid>
<TextBlock Text="Calculator view" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/CalculatorView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Calculator.Views
{
/// <summary>
/// Interaction logic for CalculatorView.xaml
/// </summary>
public partial class CalculatorView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class CalculatorView : DemoView
{
public CalculatorView()
{

23
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/HomeView.xaml

@ -1,18 +1,9 @@
<UserControl x:Class="Samples.Modules.Calculator.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Calculator.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="Calulator Controls">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Calculator Module Title" />
<TextBlock Grid.Row="1" Margin="10"
Text="Clculator module text"
TextWrapping="Wrap" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/HomeView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Calculator.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Caclulator/Views/NavigationView.xaml

@ -4,6 +4,10 @@
xmlns:views="clr-namespace:Samples.Modules.Calculator.Views"
Header="Calculator Controls" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
<TreeViewItem Header="Calculator" Tag="{x:Type views:CalculatorView}"/>
<TreeViewItem Header="CalculatorUpDown" Tag="{x:Type views:CalculatorUpDownView}"/>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Samples.Modules.ChildWindow.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Views/HomeView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.ChildWindow.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.ChildWindow.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="ChildWindow">
<Grid>
<TextBlock Text="ChildWindow View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Views/HomeView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.ChildWindow.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.ChildWindow/Views/NavigationView.xaml

@ -4,4 +4,8 @@
xmlns:views="clr-namespace:Samples.Modules.ChildWindow.Views"
Header="ChildWindow" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Samples.Modules.Color.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Views/HomeView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.Color.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Color.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="Color Controls">
<Grid>
<TextBlock Text="Color View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Views/HomeView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Color.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Color/Views/NavigationView.xaml

@ -4,4 +4,8 @@
xmlns:views="clr-namespace:Samples.Modules.Color.Views"
Header="Color" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Samples.Modules.DateTime.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Views/HomeView.xaml

@ -1,8 +1,10 @@
<UserControl x:Class="Samples.Modules.DateTime.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended">
<infControls:DemoView x:Class="Samples.Modules.DateTime.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="DateTime Controls">
<Grid>
<extToolkit:DateTimePicker Format="Custom" FormatString="HH:mm:ss" />
<TextBlock Text="DateTime controls" />
</Grid>
</UserControl>
</infControls:DemoView>

19
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Views/HomeView.xaml.cs

@ -1,25 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Threading;
using System.Globalization;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.DateTime.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.DateTime/Views/NavigationView.xaml

@ -4,4 +4,8 @@
xmlns:views="clr-namespace:Samples.Modules.DateTime.Views"
Header="DateTime" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Samples.Modules.Numeric.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Views/HomeView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.Numeric.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Numeric.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="Numeric Controls">
<Grid>
<TextBlock Text="Numeric View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Views/HomeView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Numeric.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Numeric/Views/NavigationView.xaml

@ -4,4 +4,8 @@
xmlns:views="clr-namespace:Samples.Modules.Numeric.Views"
Header="Numeric" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Samples.Modules.PropertyGrid.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

33
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Views/HomeView.xaml

@ -1,28 +1,9 @@
<UserControl x:Class="Samples.Modules.PropertyGrid.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended">
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="PropertyGrid" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--<Button x:Name="_button" Content="Property Grid" Margin="20" HorizontalAlignment="Center" VerticalAlignment="Center" />-->
<ListBox x:Name="_listBox" Margin="20" MinWidth="150">
</ListBox>
<!--<extToolkit:PropertyGrid Grid.Column="1" Name="propertyGrid1" SelectedObject="{Binding ElementName=_button}" />-->
<extToolkit:PropertyGrid Grid.Column="1" Name="propertyGrid1" SelectedObject="{Binding ElementName=_listBox, Path=SelectedItem}" />
<!--<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<extToolkit:PrimitiveTypeCollectionEditor x:Name="_editor" Width="150" Content="(Collection)" />
<Button Click="Button_Click">
<Path Stroke="Black" SnapsToDevicePixels="true" StrokeThickness="1" Data="F0 M 0,0 L 6,6 M 0,3 L 3,6 " />
</Button>
</StackPanel>-->
<TextBlock Text="PropertyGrid View" />
</Grid>
</UserControl>
</infControls:DemoView>

126
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Views/HomeView.xaml.cs

@ -1,136 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.PropertyGrid.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{
InitializeComponent();
_listBox.Items.Add(new Data() { Name = "Item One" });
_listBox.Items.Add(new Data() { Name = "Item Two" });
//_editor.ItemsSourceType = typeof(List<double>);
//_editor.ItemType = typeof(double);
//_editor.ItemsSource = new List<String>() { "A", "B", "C" };
//_editor.ItemsSource = new List<double>() { 1.0, 2.0, 3.0 };
}
//private void Button_Click(object sender, RoutedEventArgs e)
//{
// MessageBox.Show(_editor.ItemsSource.Count.ToString());
//}
}
public class Data
{
private List<Person> _pages = new List<Person>();
public List<Person> Pages
{
get { return _pages; }
set
{
_pages = value;
}
}
private List<int> _valueTypes = new List<int>() { 1, 2, 3 };
public List<int> ValueTypes
{
get { return _valueTypes; }
set
{
_valueTypes = value;
}
}
private string _name;
public string Name
{
get { return _name; }
set
{
_name = value;
}
}
private bool? _isLate;
public bool? IsLate
{
get { return _isLate; }
set
{
_isLate = value;
}
}
private DateTime? _datOfBirth;
public DateTime? DatOfBirth
{
get { return _datOfBirth; }
set
{
_datOfBirth = value;
}
}
private Color _color;
public Color Color
{
get { return _color; }
set
{
_color = value;
}
}
public Data()
{
Pages.Add(new Person() { FirstName = "One" });
Pages.Add(new Person() { FirstName = "Two" });
}
}
public class Person
{
private string _firstName;
public string FirstName
{
get { return _firstName; }
set
{
_firstName = value;
}
}
private string _lastName;
public string LastName
{
get { return _lastName; }
set
{
_lastName = value;
}
}
public Person()
{
}
}
}

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.PropertyGrid/Views/NavigationView.xaml

@ -4,4 +4,8 @@
xmlns:views="clr-namespace:Samples.Modules.PropertyGrid.Views"
Header="PropertyGrid" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Samples.Modules.Text.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

14
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml

@ -1,11 +1,9 @@
<UserControl x:Class="Samples.Modules.Text.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<infControls:DemoView x:Class="Samples.Modules.Text.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
Title="Text Controls">
<Grid>
<TextBlock Text="Text View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/HomeView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Text.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

8
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Text/Views/NavigationView.xaml

@ -4,4 +4,12 @@
xmlns:views="clr-namespace:Samples.Modules.Text.Views"
Header="Text" Tag="{x:Type views:HomeView}">
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
<TreeViewItem Header="MaskedTextBox" />
<TreeViewItem Header="MultiLineTextEditor" />
<TreeViewItem Header="RichTextBox" />
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Samples.Modules.Wizard.csproj

@ -113,7 +113,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y</PostBuildEvent>
<PostBuildEvent>xcopy "$(TargetDir)*.*" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\" /Y
xcopy "$(ProjectDir)Views" "$(SolutionDir)Src\Samples\Samples\bin\$(ConfigurationName)\Samples\$(ProjectName)\" /s /Y /I</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

25
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml

@ -1,23 +1,10 @@
<UserControl x:Class="Samples.Modules.Wizard.Views.HomeView"
<infControls:DemoView x:Class="Samples.Modules.Wizard.Views.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended">
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
Title="Wizard">
<Grid>
<extToolkit:Wizard >
<extToolkit:WizardPage x:Name="page1" Title="Page 1 Title"
Description="Page 1 Description" >
<Label Content="Page 1 content" />
</extToolkit:WizardPage>
<extToolkit:WizardPage x:Name="page2" Title="Page 2 Title"
Description="Page 2 Description"
NextPage="{Binding ElementName=page3}"
PreviousPage="{Binding ElementName=page1}" >
<Label Content="Page 2 content" />
</extToolkit:WizardPage>
<extToolkit:WizardPage x:Name="page3" Title="Page 3 Title"
Description="Page 3 Description" CanFinish="True">
<Label Content="Page 3 content" />
</extToolkit:WizardPage>
</extToolkit:Wizard>
<TextBlock Text="Wizard View" />
</Grid>
</UserControl>
</infControls:DemoView>

17
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml.cs

@ -1,23 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Samples.Infrastructure.Controls;
using Microsoft.Practices.Prism.Regions;
namespace Samples.Modules.Wizard.Views
{
/// <summary>
/// Interaction logic for HomeView.xaml
/// </summary>
public partial class HomeView : UserControl
[RegionMemberLifetime(KeepAlive = false)]
public partial class HomeView : DemoView
{
public HomeView()
{

4
ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/NavigationView.xaml

@ -4,4 +4,8 @@
xmlns:views="clr-namespace:Samples.Modules.Wizard.Views"
Header="Wizard" Tag="{x:Type views:HomeView}" >
<TreeViewItem.Resources>
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" />
</TreeViewItem.Resources>
</TreeViewItem>

3
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Commands/TreeViewCommandBehavior.cs

@ -18,7 +18,8 @@ namespace Samples.Infrastructure.Commands
//This treeview command is specfic to the navigation region,
//so I always want to pass the tag of the selected treeviewitem
//because it will conatin the Type of view to navigate to.
CommandParameter = ((e.NewValue as FrameworkElement).Tag as Type).FullName;
var type = (e.NewValue as FrameworkElement).Tag as Type;
CommandParameter = type != null ? type.FullName : null;
ExecuteCommand();
}
}

118
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Controls/DemoView.cs

@ -0,0 +1,118 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.IO;
namespace Samples.Infrastructure.Controls
{
public class DemoView : ContentControl
{
#region Members
readonly string _applicationPath = String.Empty;
const string _samplesFolderName = "Samples";
#endregion //Members
#region Properties
public static readonly DependencyProperty CSharpTextProperty = DependencyProperty.Register("CSharpText", typeof(string), typeof(DemoView), new UIPropertyMetadata(null));
public string CSharpText
{
get { return (string)GetValue(CSharpTextProperty); }
set { SetValue(CSharpTextProperty, value); }
}
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(DemoView), new UIPropertyMetadata(null));
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty XamlTextProperty = DependencyProperty.Register("XamlText", typeof(string), typeof(DemoView), new UIPropertyMetadata(null));
public string XamlText
{
get { return (string)GetValue(XamlTextProperty); }
set { SetValue(XamlTextProperty, value); }
}
#endregion //Properties
#region Constructors
static DemoView()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DemoView), new FrameworkPropertyMetadata(typeof(DemoView)));
}
public DemoView()
{
_applicationPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
#endregion //Constructors
#region Base Class Overrides
protected override void OnContentChanged(object oldContent, object newContent)
{
base.OnContentChanged(oldContent, newContent);
//the parent of the content will be the View
ResolveContentCode((newContent as FrameworkElement).Parent);
}
#endregion //Base Class Overrides
#region Methods
private void ResolveContentCode(object newContent)
{
//get the type of the content loaded in the ContentRegion
var type = newContent.GetType();
//grab only the name of the content which will correspond to the name of the file to load
var viewName = type.FullName.Substring(type.FullName.LastIndexOf(".") + 1);
//get the module name
var moduleName = type.Module.Name.Replace(".dll", String.Empty);
SetText(viewName, moduleName);
}
private void SetText(string viewName, string moduleName)
{
SetCSharpText(viewName, moduleName);
SetXamlText(viewName, moduleName);
}
private void SetCSharpText(string viewName, string moduleName)
{
//now we need to append the file extension
string fileName = String.Format("{0}.xaml", viewName);
string filePath = GetFilePath(moduleName, fileName);
XamlText = ReadFileText(filePath);
}
private void SetXamlText(string viewName, string moduleName)
{
//now we need to append the file extension
string fileName = String.Format("{0}.xaml.cs", viewName);
string filePath = GetFilePath(moduleName, fileName);
CSharpText = ReadFileText(filePath);
}
private string GetFilePath(string moduleName, string fileName)
{
return Path.Combine(_applicationPath, _samplesFolderName, moduleName, fileName);
}
private static string ReadFileText(string filePath)
{
string text = String.Empty;
if (File.Exists(filePath))
text = File.ReadAllText(filePath);
return text;
}
#endregion //Methods
}
}

43
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Converters/CSharpColorConverter.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Samples.Infrastructure.Core.CodeFormatting;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
namespace Samples.Infrastructure.Converters
{
public class CSharpColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
return value;
String val = (String)value;
CSharpFormat cSharpFormat = new CSharpFormat();
FlowDocument doc = new FlowDocument();
Paragraph p = new Paragraph();
p = cSharpFormat.FormatCode(val);
doc.Blocks.Add(p);
RichTextBox rtb = new RichTextBox();
rtb.IsReadOnly = true;
rtb.Document = doc;
rtb.Document.PageWidth = 2500.0;
rtb.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
rtb.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
rtb.FontFamily = new FontFamily("Courier New");
return rtb;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

121
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Converters/XamlColorConverter.cs

@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Documents;
using System.Windows.Controls;
using Samples.Infrastructure.Core.CodeFormatting;
namespace Samples.Infrastructure.Converters
{
public class XamlColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
return value;
string xaml = value as string;
FlowDocument doc = new FlowDocument();
ColorizeXAML(xaml, doc);
RichTextBox rtb = new RichTextBox();
rtb.IsReadOnly = true;
rtb.Document = doc;
rtb.Document.PageWidth = 2500.0;
rtb.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
rtb.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
rtb.FontFamily = new FontFamily("Courier New");
return rtb;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
#region SyntaxColoring
#region ColorizeXAML
public void ColorizeXAML(string xamlText, FlowDocument targetDoc)
{
XmlTokenizer tokenizer = new XmlTokenizer();
XmlTokenizerMode mode = XmlTokenizerMode.OutsideElement;
List<XmlToken> tokens = tokenizer.Tokenize(xamlText, ref mode);
List<string> tokenTexts = new List<string>(tokens.Count);
List<Color> colors = new List<Color>(tokens.Count);
int position = 0;
foreach (XmlToken token in tokens)
{
string tokenText = xamlText.Substring(position, token.Length);
tokenTexts.Add(tokenText);
Color color = ColorForToken(token, tokenText);
colors.Add(color);
position += token.Length;
}
Paragraph p = new Paragraph();
// Loop through tokens
for (int i = 0; i < tokenTexts.Count; i++)
{
Run r = new Run(tokenTexts[i]);
r.Foreground = new SolidColorBrush(colors[i]);
p.Inlines.Add(r);
}
targetDoc.Blocks.Add(p);
}
#endregion //ColorizeXAML
static Color ColorForToken(XmlToken token, string tokenText)
{
Color color = Color.FromRgb(0, 0, 0);
switch (token.Kind)
{
case XmlTokenKind.Open:
case XmlTokenKind.OpenClose:
case XmlTokenKind.Close:
case XmlTokenKind.SelfClose:
case XmlTokenKind.CommentBegin:
case XmlTokenKind.CommentEnd:
case XmlTokenKind.CDataBegin:
case XmlTokenKind.CDataEnd:
case XmlTokenKind.Equals:
case XmlTokenKind.OpenProcessingInstruction:
case XmlTokenKind.CloseProcessingInstruction:
case XmlTokenKind.AttributeValue:
color = Color.FromRgb(0, 0, 255);
// color = "blue";
break;
case XmlTokenKind.ElementName:
color = Color.FromRgb(163, 21, 21);
// color = "brown";
break;
case XmlTokenKind.TextContent:
// color = "black";
break;
case XmlTokenKind.AttributeName:
case XmlTokenKind.Entity:
color = Color.FromRgb(255, 0, 0);
// color = "red";
break;
case XmlTokenKind.CommentText:
color = Color.FromRgb(0, 128, 0);
// color = "green";
break;
}
if (token.Kind == XmlTokenKind.ElementWhitespace
|| (token.Kind == XmlTokenKind.TextContent && tokenText.Trim() == ""))
{
// color = null;
}
return color;
}
#endregion SyntaxColoring
}
}

391
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Core/CodeFormatting/CSharpFormat.cs

@ -0,0 +1,391 @@
#region Copyright © 2001-2003 Jean-Claude Manoli [jc@manoli.net]
/*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the author(s) be held liable for any damages arising from
* the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Documents;
using System.Windows.Media;
namespace Samples.Infrastructure.Core.CodeFormatting
{
public class CSharpFormat : CLikeFormat
{
/// <summary>
/// The list of C# keywords.
/// </summary>
protected override string Keywords
{
get
{
return "abstract as base bool break byte case catch char "
+ "checked class const continue decimal default delegate do double else "
+ "enum event explicit extern false finally fixed float for foreach goto "
+ "if implicit in int interface internal is lock long namespace new null "
+ "object operator out override partial params private protected public readonly "
+ "ref return sbyte sealed short sizeof stackalloc static string struct "
+ "switch this throw true try typeof uint ulong unchecked unsafe ushort "
+ "using value virtual void volatile where while yield";
}
}
/// <summary>
/// The list of C# preprocessors.
/// </summary>
protected override string Preprocessors
{
get
{
return "#if #else #elif #endif #define #undef #warning "
+ "#error #line #region #endregion #pragma";
}
}
}
/// <summary>
/// Provides a base class for formatting languages similar to C.
/// </summary>
public abstract class CLikeFormat : CodeFormat
{
/// <summary>
/// Regular expression string to match single line and multi-line
/// comments (// and /* */).
/// </summary>
protected override string CommentRegEx
{
get { return @"/\*.*?\*/|//.*?(?=\r|\n)"; }
}
/// <summary>
/// Regular expression string to match string and character literals.
/// </summary>
protected override string StringRegEx
{
get { return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'"; }
}
}
/// <summary>
/// Provides a base class for formatting most programming languages.
/// </summary>
public abstract class CodeFormat : SourceFormat
{
/// <summary>
/// Must be overridden to provide a list of keywords defined in
/// each language.
/// </summary>
/// <remarks>
/// Keywords must be separated with spaces.
/// </remarks>
protected abstract string Keywords
{
get;
}
/// <summary>
/// Can be overridden to provide a list of preprocessors defined in
/// each language.
/// </summary>
/// <remarks>
/// Preprocessors must be separated with spaces.
/// </remarks>
protected virtual string Preprocessors
{
get { return ""; }
}
/// <summary>
/// Must be overridden to provide a regular expression string
/// to match strings literals.
/// </summary>
protected abstract string StringRegEx
{
get;
}
/// <summary>
/// Must be overridden to provide a regular expression string
/// to match comments.
/// </summary>
protected abstract string CommentRegEx
{
get;
}
/// <summary>
/// Determines if the language is case sensitive.
/// </summary>
/// <value><b>true</b> if the language is case sensitive, <b>false</b>
/// otherwise. The default is true.</value>
/// <remarks>
/// A case-insensitive language formatter must override this
/// property to return false.
/// </remarks>
public virtual bool CaseSensitive
{
get { return true; }
}
/// <summary/>
protected CodeFormat()
{
//generate the keyword and preprocessor regexes from the keyword lists
Regex r;
r = new Regex(@"\w+|-\w+|#\w+|@@\w+|#(?:\\(?:s|w)(?:\*|\+)?\w+)+|@\\w\*+");
string regKeyword = r.Replace(Keywords, @"(?<=^|\W)$0(?=\W)");
string regPreproc = r.Replace(Preprocessors, @"(?<=^|\s)$0(?=\s|$)");
r = new Regex(@" +");
regKeyword = r.Replace(regKeyword, @"|");
regPreproc = r.Replace(regPreproc, @"|");
if (regPreproc.Length == 0)
{
regPreproc = "(?!.*)_{37}(?<!.*)"; //use something quite impossible...
}
//build a master regex with capturing groups
StringBuilder regAll = new StringBuilder();
regAll.Append("(");
regAll.Append(CommentRegEx);
regAll.Append(")|(");
regAll.Append(StringRegEx);
if (regPreproc.Length > 0)
{
regAll.Append(")|(");
regAll.Append(regPreproc);
}
regAll.Append(")|(");
regAll.Append(regKeyword);
regAll.Append(")");
RegexOptions caseInsensitive = CaseSensitive ? 0 : RegexOptions.IgnoreCase;
CodeRegex = new Regex(regAll.ToString(), RegexOptions.Singleline | caseInsensitive);
CodeParagraphGlobal = new List<Run>();
}
/// <summary>
/// Called to evaluate the HTML fragment corresponding to each
/// matching token in the code.
/// </summary>
/// <param name="match">The <see cref="Match"/> resulting from a
/// single regular expression match.</param>
/// <returns>A string containing the HTML code fragment.</returns>
protected override string MatchEval(Match match) //protected override
{
if (match.Groups[1].Success) //comment
{
StringReader reader = new StringReader(match.ToString());
string line;
StringBuilder sb = new StringBuilder();
while ((line = reader.ReadLine()) != null)
{
Run r = new Run(line);
r.Foreground = new SolidColorBrush(Color.FromRgb(0, 128, 0));
CodeParagraphGlobal.Add(r);
}
return "::::::";
}
else if (match.Groups[2].Success) //string literal
{
Run r = new Run(match.ToString());
r.Foreground = new SolidColorBrush(Color.FromRgb(0, 96, 128));
CodeParagraphGlobal.Add(r);
return "::::::";
}
else if (match.Groups[3].Success) //preprocessor keyword
{
Run r = new Run(match.ToString());
r.Foreground = new SolidColorBrush(Color.FromRgb(204, 102, 51));
CodeParagraphGlobal.Add(r);
return "::::::";
}
else if (match.Groups[4].Success) //keyword
{
Run r = new Run(match.ToString());
r.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 255));
CodeParagraphGlobal.Add(r);
return "::::::";
}
else
{
return "";
}
}
}
/// <summary>
/// Provides a base implementation for all code formatters.
/// </summary>
/// <remarks>
/// <para>
/// To display the formatted code on your web site, the web page must
/// refer to a stylesheet that defines the formatting for the different
/// CSS classes generated by CSharpFormat:
/// .csharpcode, pre, .rem, .kwrd, .str, .op, .preproc, .alt, .lnum.
/// </para>
/// <para>
/// Note that if you have multi-line comments in your source code
/// (like /* ... */), the "line numbers" or "alternate line background"
/// options will generate code that is not strictly HTML 4.01 compliant.
/// The code will still look good with IE5+ or Mozilla 0.8+.
/// </para>
/// </remarks>
public abstract class SourceFormat
{
/// <summary/>
protected SourceFormat()
{
_tabSpaces = 4;
_lineNumbers = false;
_alternate = false;
_embedStyleSheet = false;
}
private byte _tabSpaces;
/// <summary>
/// Gets or sets the tabs width.
/// </summary>
/// <value>The number of space characters to substitute for tab
/// characters. The default is <b>4</b>, unless overridden is a
/// derived class.</value>
public byte TabSpaces
{
get { return _tabSpaces; }
set { _tabSpaces = value; }
}
private bool _lineNumbers;
/// <summary>
/// Enables or disables line numbers in output.
/// </summary>
/// <value>When <b>true</b>, line numbers are generated.
/// The default is <b>false</b>.</value>
public bool LineNumbers
{
get { return _lineNumbers; }
set { _lineNumbers = value; }
}
private bool _alternate;
/// <summary>
/// Enables or disables alternating line background.
/// </summary>
/// <value>When <b>true</b>, lines background is alternated.
/// The default is <b>false</b>.</value>
public bool Alternate
{
get { return _alternate; }
set { _alternate = value; }
}
private bool _embedStyleSheet;
/// <summary>
/// Enables or disables the embedded CSS style sheet.
/// </summary>
/// <value>When <b>true</b>, the CSS &lt;style&gt; element is included
/// in the HTML output. The default is <b>false</b>.</value>
public bool EmbedStyleSheet
{
get { return _embedStyleSheet; }
set { _embedStyleSheet = value; }
}
/// <summary>
/// Transforms a source code string to HTML 4.01.
/// </summary>
/// <returns>A string containing the HTML formatted code.</returns>
public Paragraph FormatCode(string source)
{
return FormatCode(source, _lineNumbers, _alternate, _embedStyleSheet, false);
}
private Regex codeRegex;
/// <summary>
/// The regular expression used to capture language tokens.
/// </summary>
protected Regex CodeRegex
{
get { return codeRegex; }
set { codeRegex = value; }
}
private List<Run> codeParagraphGlobal;
/// <summary>
/// This is a List of Run's that can be added later to the string of code
/// </summary>
protected List<Run> CodeParagraphGlobal
{
get { return codeParagraphGlobal; }
set { codeParagraphGlobal = value; }
}
/// <summary>
/// Called to evaluate the HTML fragment corresponding to each
/// matching token in the code.
/// </summary>
/// <param name="match">The <see cref="Match"/> resulting from a
/// single regular expression match.</param>
/// <returns>A string containing the HTML code fragment.</returns>
protected abstract string MatchEval(Match match); //protected abstract
//does the formatting job
private Paragraph FormatCode(string source, bool lineNumbers,
bool alternate, bool embedStyleSheet, bool subCode)
{
Paragraph codeParagraph = new Paragraph();
//replace special characters
StringBuilder sb = new StringBuilder(source);
//color the code
source = codeRegex.Replace(sb.ToString(), new MatchEvaluator(this.MatchEval));
//codeRegex.Replace(
string[] characters = { "::::::" };
string[] split = source.Split(characters, new StringSplitOptions());
int currentChunk = 0;
foreach (string code in split)
{
currentChunk++;
Run r = new Run(code);
codeParagraph.Inlines.Add(r);
if ((currentChunk - 1) < codeParagraphGlobal.Count)
{
codeParagraph.Inlines.Add(codeParagraphGlobal[currentChunk - 1]);
}
}
return codeParagraph;
}
}
}

351
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Core/CodeFormatting/XamlFormat.cs

@ -0,0 +1,351 @@
//Author: Nick Kramer [MSFT]
//Source: http://blogs.msdn.com/b/nickkramer/archive/2006/09/22/766934.aspx
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Samples.Infrastructure.Core.CodeFormatting
{
// XML tokenizer, tokens are designed to match Visual Studio syntax highlighting
class XmlTokenizer
{
private string input;
private int position = 0;
private XmlTokenizerMode mode = XmlTokenizerMode.OutsideElement;
public static List<XmlToken> Tokenize(string input)
{
XmlTokenizerMode mode = XmlTokenizerMode.OutsideElement;
XmlTokenizer tokenizer = new XmlTokenizer();
return tokenizer.Tokenize(input, ref mode);
}
public List<XmlToken> Tokenize(string input, ref XmlTokenizerMode _mode)
{
this.input = input;
this.mode = _mode;
this.position = 0;
List<XmlToken> result = Tokenize();
_mode = this.mode;
return result;
}
private List<XmlToken> Tokenize()
{
List<XmlToken> list = new List<XmlToken>();
XmlToken token;
do
{
int previousPosition = position;
token = NextToken();
string tokenText = input.Substring(previousPosition, token.Length);
list.Add(token);
}
while (token.Kind != XmlTokenKind.EOF);
List<string> strings = TokensToStrings(list, input);
return list;
}
private List<string> TokensToStrings(List<XmlToken> list, string input)
{
List<string> output = new List<string>();
int position = 0;
foreach (XmlToken token in list)
{
output.Add(input.Substring(position, token.Length));
position += token.Length;
}
return output;
}
// debugging function
public string RemainingText
{
get
{
return input.Substring(position);
}
}
private XmlToken NextToken()
{
if (position >= input.Length)
return new XmlToken(XmlTokenKind.EOF, 0);
XmlToken token;
switch (mode)
{
case XmlTokenizerMode.AfterAttributeEquals:
token = TokenizeAttributeValue();
break;
case XmlTokenizerMode.AfterAttributeName:
token = TokenizeSimple("=", XmlTokenKind.Equals, XmlTokenizerMode.AfterAttributeEquals);
break;
case XmlTokenizerMode.AfterOpen:
token = TokenizeName(XmlTokenKind.ElementName, XmlTokenizerMode.InsideElement);
break;
case XmlTokenizerMode.InsideCData:
token = TokenizeInsideCData();
break;
case XmlTokenizerMode.InsideComment:
token = TokenizeInsideComment();
break;
case XmlTokenizerMode.InsideElement:
token = TokenizeInsideElement();
break;
case XmlTokenizerMode.InsideProcessingInstruction:
token = TokenizeInsideProcessingInstruction();
break;
case XmlTokenizerMode.OutsideElement:
token = TokenizeOutsideElement();
break;
default:
token = new XmlToken(XmlTokenKind.EOF, 0);
Debug.Fail("missing case");
break;
}
return token;
}
private bool IsNameCharacter(char character)
{
// XML rule: Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
bool result = char.IsLetterOrDigit(character) || character == '.' | character == '-' | character == '_' | character == ':';
return result;
}
private XmlToken TokenizeAttributeValue()
{
Debug.Assert(mode == XmlTokenizerMode.AfterAttributeEquals);
int closePosition = input.IndexOf(input[position], position + 1);
XmlToken token = new XmlToken(XmlTokenKind.AttributeValue, closePosition + 1 - position);
position = closePosition + 1;
mode = XmlTokenizerMode.InsideElement;
return token;
}
private XmlToken TokenizeName(XmlTokenKind kind, XmlTokenizerMode nextMode)
{
Debug.Assert(mode == XmlTokenizerMode.AfterOpen || mode == XmlTokenizerMode.InsideElement);
int i;
for (i = position; i < input.Length; i++)
if (!IsNameCharacter(input[i]))
break;
XmlToken token = new XmlToken(kind, i - position);
mode = nextMode;
position = i;
return token;
}
private XmlToken TokenizeElementWhitespace()
{
int i;
for (i = position; i < input.Length; i++)
if (!char.IsWhiteSpace(input[i]))
break;
XmlToken token = new XmlToken(XmlTokenKind.ElementWhitespace, i - position);
position = i;
return token;
}
private bool StartsWith(string text)
{
if (position + text.Length > input.Length)
return false;
else
return input.Substring(position, text.Length) == text;
}
private XmlToken TokenizeInsideElement()
{
if (char.IsWhiteSpace(input[position]))
return TokenizeElementWhitespace();
else
if (StartsWith("/>"))
return TokenizeSimple("/>", XmlTokenKind.SelfClose, XmlTokenizerMode.OutsideElement);
else
if (StartsWith(">"))
return TokenizeSimple(">", XmlTokenKind.Close, XmlTokenizerMode.OutsideElement);
else
return TokenizeName(XmlTokenKind.AttributeName, XmlTokenizerMode.AfterAttributeName);
}
private XmlToken TokenizeText()
{
Debug.Assert(input[position] != '<');
Debug.Assert(input[position] != '&');
Debug.Assert(mode == XmlTokenizerMode.OutsideElement);
int i;
for (i = position; i < input.Length; i++)
if (input[i] == '<' || input[i] == '&')
break;
XmlToken token = new XmlToken(XmlTokenKind.TextContent, i - position);
position = i;
return token;
}
private XmlToken TokenizeOutsideElement()
{
Debug.Assert(mode == XmlTokenizerMode.OutsideElement);
if (position >= input.Length)
return new XmlToken(XmlTokenKind.EOF, 0);
switch (input[position])
{
case '<':
return TokenizeOpen();
case '&':
return TokenizeEntity();
default:
return TokenizeText();
}
}
private XmlToken TokenizeSimple(string text, XmlTokenKind kind, XmlTokenizerMode nextMode)
{
XmlToken token = new XmlToken(kind, text.Length);
position += text.Length;
mode = nextMode;
return token;
}
private XmlToken TokenizeOpen()
{
Debug.Assert(input[position] == '<');
if (StartsWith("<!--"))
return TokenizeSimple("<!--", XmlTokenKind.CommentBegin, XmlTokenizerMode.InsideComment);
else
if (StartsWith("<![CDATA["))
return TokenizeSimple("<![CDATA[", XmlTokenKind.CDataBegin, XmlTokenizerMode.InsideCData);
else
if (StartsWith("<?"))
return TokenizeSimple("<?", XmlTokenKind.OpenProcessingInstruction, XmlTokenizerMode.InsideProcessingInstruction);
else
if (StartsWith("</"))
return TokenizeSimple("</", XmlTokenKind.OpenClose, XmlTokenizerMode.AfterOpen);
else
return TokenizeSimple("<", XmlTokenKind.Open, XmlTokenizerMode.AfterOpen);
}
private XmlToken TokenizeEntity()
{
Debug.Assert(mode == XmlTokenizerMode.OutsideElement);
Debug.Assert(input[position] == '&');
XmlToken token = new XmlToken(XmlTokenKind.Entity, input.IndexOf(';', position) - position);
position += token.Length;
return token;
}
private XmlToken TokenizeInsideProcessingInstruction()
{
Debug.Assert(mode == XmlTokenizerMode.InsideProcessingInstruction);
int tokenend = input.IndexOf("?>", position);
if (position == tokenend)
{
position += "?>".Length;
mode = XmlTokenizerMode.OutsideElement;
return new XmlToken(XmlTokenKind.CloseProcessingInstruction, "?>".Length);
}
else
{
XmlToken token = new XmlToken(XmlTokenKind.TextContent, tokenend - position);
position = tokenend;
return token;
}
}
private XmlToken TokenizeInsideCData()
{
Debug.Assert(mode == XmlTokenizerMode.InsideCData);
int tokenend = input.IndexOf("]]>", position);
if (position == tokenend)
{
position += "]]>".Length;
mode = XmlTokenizerMode.OutsideElement;
return new XmlToken(XmlTokenKind.CDataEnd, "]]>".Length);
}
else
{
XmlToken token = new XmlToken(XmlTokenKind.TextContent, tokenend - position);
position = tokenend;
return token;
}
}
private XmlToken TokenizeInsideComment()
{
Debug.Assert(mode == XmlTokenizerMode.InsideComment);
int tokenend = input.IndexOf("-->", position);
if (position == tokenend)
{
position += "-->".Length;
mode = XmlTokenizerMode.OutsideElement;
return new XmlToken(XmlTokenKind.CommentEnd, "-->".Length);
}
else
{
XmlToken token = new XmlToken(XmlTokenKind.CommentText, tokenend - position);
position = tokenend;
return token;
}
}
}
// Used so you can restart the tokenizer for the next line of XML
enum XmlTokenizerMode
{
InsideComment,
InsideProcessingInstruction,
AfterOpen,
AfterAttributeName,
AfterAttributeEquals,
InsideElement,
// after element name, before attribute or />
OutsideElement,
InsideCData
}
struct XmlToken
{
public XmlTokenKind Kind;
public short Length;
public XmlToken(XmlTokenKind kind, int length)
{
Kind = kind;
Length = (short)length;
}
}
/*
* this file implements a mostly correct XML tokenizer. The token boundaries
* have been chosen to match Visual Studio syntax highlighting, so a few of
* the boundaries are little weird. (Especially comments) known issues:
*
* Doesn't handle DTD's
* mediocre handling of processing instructions <? ?> -- it won't crash,
* but the token boundaries are wrong
* Doesn't enforce correct XML
* there's probably a few cases where it will die if given in valid XML
*
*
* This tokenizer has been designed to be restartable, so you can tokenize
* one line of XML at a time.
*/
enum XmlTokenKind
{
Open,
// <
Close,
//>
SelfClose,
// />
OpenClose,
// </
ElementName,
ElementWhitespace,
//whitespace between attributes
AttributeName,
Equals,
// inside attribute
AttributeValue,
// attribute value
CommentBegin,
// <!--
CommentText,
CommentEnd,
// -->
Entity,
// &gt;
OpenProcessingInstruction,
// <?
CloseProcessingInstruction,
// ?>
CDataBegin,
// <![CDATA[
CDataEnd,
// ]]>
TextContent,
//WhitespaceContent, // text content that's whitespace. Space is embedded inside
EOF,
// end of file
}
}

13
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Samples.Infrastructure.csproj

@ -63,6 +63,11 @@
<ItemGroup>
<Compile Include="Commands\TreeViewCommandBehavior.cs" />
<Compile Include="Commands\TreeViewSelected.cs" />
<Compile Include="Controls\DemoView.cs" />
<Compile Include="Converters\CSharpColorConverter.cs" />
<Compile Include="Converters\XamlColorConverter.cs" />
<Compile Include="Core\CodeFormatting\CSharpFormat.cs" />
<Compile Include="Core\CodeFormatting\XamlFormat.cs" />
<Compile Include="Extensions\UnityContainerExtensions.cs" />
<Compile Include="ModuleBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
@ -79,6 +84,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RegionNames.cs" />
<Compile Include="ViewModelBase.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -89,7 +95,12 @@
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

154
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/Themes/Generic.xaml

@ -0,0 +1,154 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Samples.Infrastructure.Controls"
xmlns:infConverters="clr-namespace:Samples.Infrastructure.Converters">
<infConverters:XamlColorConverter x:Key="XamlColorConverter" />
<infConverters:CSharpColorConverter x:Key="CSharpColorConverter" />
<LinearGradientBrush x:Key="TabBackgroundDefault" EndPoint="0.330810546875,1" StartPoint="0.330810546875,0">
<GradientStop Color="#FF100311" Offset="1"/>
<GradientStop Color="#FF666666" Offset="0"/>
</LinearGradientBrush>
<Style x:Key="TabItemStyle" TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid Width="Auto" Height="29" Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="0.565*"/>
<RowDefinition Height="0.435*"/>
</Grid.RowDefinitions>
<Border Grid.RowSpan="2" CornerRadius="0" Margin="0,0,0,1" Opacity="1" SnapsToDevicePixels="True">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF333333" Offset="0"/>
<GradientStop Color="#FF9F9F9F" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Border Background="{StaticResource TabBackgroundDefault}" CornerRadius="0" Margin="1,0,0,1" Grid.RowSpan="2" x:Name="border" SnapsToDevicePixels="True"/>
<TextBlock HorizontalAlignment="Center" Margin="15,0,15,0" VerticalAlignment="Center" Grid.RowSpan="2" FontFamily="Segoe UI" FontSize="11" FontWeight="Bold" Foreground="#4CFFFFFF" Text="{TemplateBinding Header}" TextWrapping="Wrap" x:Name="textBlock"/>
<Rectangle x:Name="rectangle" Grid.RowSpan="2" Height="1" VerticalAlignment="Top" Margin="1,1,0,0" Visibility="Collapsed" SnapsToDevicePixels="True">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.966,0.5" StartPoint="0.045,0.479">
<GradientStop Color="#FFF8EDED" Offset="0.504"/>
<GradientStop Color="#00111010" Offset="1"/>
<GradientStop Color="#00000000"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Grid.RowSpan="2" Width="1" HorizontalAlignment="Right" Margin="0,0,-1,1" SnapsToDevicePixels="True">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF2B2B2B" Offset="0"/>
<GradientStop Color="#99FFFFFF" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" TargetName="textBlock" Value="#FFF2EDF4"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="100"/>
<Setter Property="Background" TargetName="border">
<Setter.Value>
<LinearGradientBrush EndPoint="-0.003,1.107" StartPoint="0,0">
<GradientStop Color="#FF9305CF" Offset="0"/>
<GradientStop Color="Black" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" TargetName="textBlock" Value="#FFFFFFFF"/>
<Setter Property="Visibility" TargetName="rectangle" Value="Visible"/>
<Setter Property="Fill" TargetName="rectangle">
<Setter.Value>
<LinearGradientBrush EndPoint="0.966,0.5" StartPoint="0.045,0.479">
<GradientStop Color="#FFF8EDED" Offset="0.504"/>
<GradientStop Color="#00BD2FD5" Offset="1"/>
<GradientStop Color="#00BD2FD5"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Margin" TargetName="border" Value="1,0,0,0"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0,0,1,0"/>
</Style>
<Style x:Key="TabControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel Grid.Row="0" Margin="0,0,7,-1" x:Name="HeaderPanel" Background="Transparent" IsItemsHost="True" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1" HorizontalAlignment="Right"/>
<Border Grid.Row="1" x:Name="Border" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="0" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="2" SnapsToDevicePixels="True">
<ContentPresenter Margin="4" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
</Border>
<Rectangle HorizontalAlignment="Stretch" Margin="1,1,1,0" VerticalAlignment="Top" Width="Auto" Height="8" Grid.Row="1" SnapsToDevicePixels="True">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,0.861" StartPoint="0.5,0">
<GradientStop Color="#FF13011B" Offset="0.014"/>
<GradientStop Color="#FF8D05C7" Offset="0.97"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:DemoView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:DemoView}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<TabControl TabStripPlacement="Top" Style="{StaticResource TabControlStyle}" >
<TabItem Header="Sample" Style="{StaticResource TabItemStyle}">
<ContentPresenter Margin="10" />
</TabItem>
<TabItem Header="XAML" Style="{StaticResource TabItemStyle}">
<ContentPresenter x:Name="_xamlCode" Content="{Binding XamlText, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource XamlColorConverter}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ScrollViewer.CanContentScroll="True"
Margin="5,10,5,5"/>
</TabItem>
<TabItem Header="Code" Style="{StaticResource TabItemStyle}">
<ContentPresenter x:Name="_cSharpCode" Content="{Binding CSharpText, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CSharpColorConverter}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ScrollViewer.CanContentScroll="True"
Margin="5,10,5,5"/>
</TabItem>
</TabControl>
<TextBlock Opacity="1" HorizontalAlignment="Left" Margin="12,5,0,0" VerticalAlignment="Top"
TextWrapping="Wrap"
FontSize="18"
FontFamily="Segoe UI"
TextAlignment="right"
Foreground="#FFFFFFFF"
FontWeight="Bold"
Text="{TemplateBinding Title}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

17
ExtendedWPFToolkitSolution/Src/Samples/Samples.Infrastructure/ViewModelBase.cs

@ -0,0 +1,17 @@
using System;
using System.ComponentModel;
namespace Samples.Infrastructure
{
public interface IViewModel { }
public class ViewModelBase : IViewModel, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}

8
ExtendedWPFToolkitSolution/Src/Samples/Samples/App.xaml

@ -2,6 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Resources/TreeViewStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

BIN
ExtendedWPFToolkitSolution/Src/Samples/Samples/Images/Background.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

BIN
ExtendedWPFToolkitSolution/Src/Samples/Samples/Images/Background.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

231
ExtendedWPFToolkitSolution/Src/Samples/Samples/Resources/TreeViewStyles.xaml

@ -0,0 +1,231 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="HighlightFill" Color="#59FFFFFF"/>
<LinearGradientBrush x:Key="SelectedFill" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#59FFFFFF" Offset="0"/>
<GradientStop Color="#33FFFFFF" Offset="1"/>
<GradientStop Color="#19FFFFFF" Offset="0.5"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ForegroundHighlightFill" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="ForegroundFill" Color="#FFFFFFFF"/>
<LinearGradientBrush x:Key="GlyphFill" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FF959595" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ControlFill" Color="#00FFFFFF"/>
<SolidColorBrush x:Key="CommonFill" Color="#00FFFFFF"/>
<Style x:Key="TreeViewItemToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<ControlTemplate.Resources>
<Storyboard x:Key="ExpandIndicatorIsChecked">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="90"/>
</DoubleAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(FrameworkElement.Margin)">
<SplineThicknessKeyFrame KeyTime="00:00:00.2000000" Value="0,1,0,0"/>
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="ExpandIndicatorIsCheckedFalse">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="90"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(FrameworkElement.Margin)">
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="1,0,0,0"/>
<SplineThicknessKeyFrame KeyTime="00:00:00.2000000" Value="2,0,0,0"/>
</ThicknessAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.SnapsToDevicePixels)">
<DiscreteBooleanKeyFrame KeyTime="00:00:00.2000000" Value="True"/>
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<Grid Width="15" Height="13" Background="Transparent" x:Name="grid">
<Ellipse Width="12" Height="12" Fill="{TemplateBinding Background}" Stroke="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Path HorizontalAlignment="Center" VerticalAlignment="Center" Height="6" Width="6" Stretch="Fill" Opacity="1"
Data="M303,349 C303,349 303,345 303,345 303,345 309.04167,347 309.04167,347 309.04167,347 303,349 303,349 z" Fill="{TemplateBinding Foreground}" Margin="2,0,0,0" x:Name="path" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</Path.RenderTransform>
</Path>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Trigger.ExitActions>
<BeginStoryboard x:Name="ExpandIndicatorIsCheckedFalse_BeginStoryboard1" Storyboard="{StaticResource ExpandIndicatorIsCheckedFalse}"/>
</Trigger.ExitActions>
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ExpandIndicatorIsChecked}" x:Name="ExpandIndicatorIsChecked_BeginStoryboard"/>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="{StaticResource GlyphFill}"/>
<Setter Property="Background" Value="{StaticResource ControlFill}"/>
</Style>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="Background" Value="{StaticResource CommonFill}"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Padding" Value="1,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<ControlTemplate.Resources>
<Storyboard x:Key="TreeItemIsExpanded">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="MouseOver">
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Selection_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00" Value="#4CFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Selection_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00" Value="#4CFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Selection_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00" Value="#4CFFFFFF"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="MouseOut">
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selection_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#00FFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selection_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#00FFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selection_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#00FFFFFF"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="ItemSelected">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.5"/>
</DoubleAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#59FFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#0CFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#33FFFFFF"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="ItemDeselected">
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#00FFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#00FFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#00FFFFFF"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<DockPanel SnapsToDevicePixels="True">
<Grid x:Name="HeaderContainer" Background="Transparent" DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Column="0" x:Name="Selection_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="1" Opacity="1">
<Border.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#00FFFFFF" Offset="0"/>
<GradientStop Color="#00FFFFFF" Offset="1"/>
<GradientStop Color="#00FFFFFF" Offset="0.5"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Rectangle Stroke="{x:Null}" HorizontalAlignment="Stretch" Width="Auto" Grid.Column="0" Grid.RowSpan="1" Grid.ColumnSpan="2" x:Name="SelectedRect">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#00FFFFFF" Offset="0"/>
<GradientStop Color="#00FFFFFF" Offset="1"/>
<GradientStop Color="#00FFFFFF" Offset="0.533"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<ContentPresenter x:Name="PART_Header" ContentSource="Header" Width="Auto" VerticalAlignment="Center" Grid.ColumnSpan="1" Grid.Column="1" Margin="3,0,0,0"/>
<ToggleButton x:Name="Expander" Style="{StaticResource TreeViewItemToggleButton}" IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" VerticalAlignment="Center" Margin="0,3,0,3"/>
</Grid>
<ItemsPresenter x:Name="ItemsHost" HorizontalAlignment="Stretch" Height="Auto" Opacity="0" Margin="14,1,0,0"/>
</DockPanel>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=Parent.Parent, RelativeSource={RelativeSource TemplatedParent}}" Value="{x:Null}">
<Setter TargetName="ItemsHost" Property="Margin" Value="15,1,0,0" />
</DataTrigger>
<Trigger SourceName="HeaderContainer" Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource MouseOver}" x:Name="MouseOver_BeginStoryboard_HitTestArea"/>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource MouseOut}" x:Name="MouseOut_BeginStoryboard_HitTestArea"/>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsExpanded" Value="false">
<Setter Property="Visibility" Value="Collapsed" TargetName="ItemsHost"/>
</Trigger>
<Trigger Property="IsExpanded" Value="True">
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource TreeItemIsExpanded}" x:Name="TreeItemIsExpanded_BeginStoryboard"/>
</Trigger.EnterActions>
<Trigger.ExitActions>
<StopStoryboard BeginStoryboardName="TreeItemIsExpanded_BeginStoryboard"/>
</Trigger.ExitActions>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Grid.RowSpan" TargetName="Selection_Border" Value="1"/>
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter Property="Visibility" Value="Hidden" TargetName="Expander"/>
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Trigger.ExitActions>
<BeginStoryboard x:Name="ItemDeselected_BeginStoryboard1" Storyboard="{StaticResource ItemDeselected}"/>
</Trigger.ExitActions>
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource ItemSelected}" x:Name="ItemSelected_BeginStoryboard"/>
</Trigger.EnterActions>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true"/>
<Condition Property="IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource SelectedFill}"/>
<Setter Property="Foreground" Value="{StaticResource ForegroundHighlightFill}"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0,0,0,1"/>
<Setter Property="Foreground" Value="{StaticResource ForegroundFill}"/>
</Style>
</ResourceDictionary>

6
ExtendedWPFToolkitSolution/Src/Samples/Samples/Samples.csproj

@ -115,13 +115,17 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Resources\TreeViewStyles.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Shell.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Background.jpg" />
<Resource Include="Images\Background.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

92
ExtendedWPFToolkitSolution/Src/Samples/Samples/Shell.xaml

@ -1,64 +1,46 @@
<Window x:Class="Samples.Shell"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<Window x:Class="Samples.Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:inf="clr-namespace:Samples.Infrastructure;assembly=Samples.Infrastructure"
xmlns:infCommands="clr-namespace:Samples.Infrastructure.Commands;assembly=Samples.Infrastructure"
xmlns:prism="http://www.codeplex.com/CompositeWPF"
Background="Black"
Title="Extended WPF Toolkit - Samples" Height="768" Width="1024" >
<Window.Background>
<ImageBrush ImageSource="/Images/Background.jpg" />
</Window.Background>
<Window.Resources>
<!--<Style TargetType="TreeViewItem">
</Style>-->
</Window.Resources>
<Grid Margin="15" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Margin="10,0,10,10">
<TextBlock Text="Extended WPF Toolkit" Foreground="WHite" FontSize="28" FontWeight="Bold" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border CornerRadius="5" BorderBrush="#FF666666" BorderThickness="1" >
<Border.Background>
<LinearGradientBrush EndPoint="0.697,0.976" StartPoint="0.277,0.197">
<GradientStop Color="#43000000" Offset="0"/>
<GradientStop Color="#34394D" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<TreeView prism:RegionManager.RegionName="{x:Static inf:RegionNames.NavigationRegion}"
<Grid>
<Image Source="/Images/Background.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.RowSpan="2" />
<Grid Margin="15" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Margin="10,0,10,10">
<TextBlock Text="Extended WPF Toolkit" Foreground="WHite" FontSize="28" FontWeight="Bold" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border CornerRadius="5" BorderBrush="#FF666666" BorderThickness="1" >
<TreeView prism:RegionManager.RegionName="{x:Static inf:RegionNames.NavigationRegion}"
infCommands:TreeViewSelected.Command="{Binding NavigateCommand}"
BorderBrush="{x:Null}" Background="{x:Null}"
MinWidth="150" Margin="3">
<!-- TODO: Style the TreeViewItems-->
</TreeView>
</Border>
<Border Grid.Column="1" Margin="10,0,10,0" BorderBrush="Gray" BorderThickness="1" Background="White"
CornerRadius="3">
<ContentControl prism:RegionManager.RegionName="{x:Static inf:RegionNames.ContentRegion}" Margin="5" />
</Border>
BorderBrush="{x:Null}" MinWidth="200" Margin="3">
<TreeView.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#A1000000" Offset="0" />
<GradientStop Color="Black" Offset="1" />
</LinearGradientBrush>
</TreeView.Background>
</TreeView>
</Border>
<Border Grid.Column="1" Margin="10,0,10,0" BorderBrush="Gray" BorderThickness="1" Background="#2C2E3E" CornerRadius="3">
<ContentControl x:Name="MainContent" prism:RegionManager.RegionName="{x:Static inf:RegionNames.ContentRegion}" Margin="5,0,5,8" />
</Border>
</Grid>
</Grid>
</Grid>
</Window>

4
ExtendedWPFToolkitSolution/Src/Samples/Samples/ShellViewModel.cs

@ -6,11 +6,11 @@ using Samples.Infrastructure;
namespace Samples
{
public class ShellViewModel : IShellViewModel
public class ShellViewModel : ViewModelBase, IShellViewModel
{
private readonly IRegionManager _regionManager;
public ICommand NavigateCommand { get; set; }
public ICommand NavigateCommand { get; set; }
public ShellViewModel(IRegionManager regionManager)
{

Loading…
Cancel
Save