309 changed files with 31481 additions and 23497 deletions
@ -1,30 +1,47 @@ |
|||
using System; |
|||
using Samples.Infrastructure; |
|||
using Microsoft.Practices.Unity; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.BusyIndicator.NavigationItems; |
|||
using Samples.Modules.BusyIndicator.Views; |
|||
|
|||
namespace Samples.Modules.BusyIndicator |
|||
{ |
|||
public class BusyIndicatorModule : ModuleBase |
|||
public class BusyIndicatorModule : ModuleBase |
|||
{ |
|||
public BusyIndicatorModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType( typeof( BusyIndicatorView ) ); |
|||
Container.RegisterNavigationType( typeof( BusyIndicatorCustomContentView ) ); |
|||
Container.RegisterNavigationType( typeof( BusyIndicatorCustomContentTemplateView ) ); |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
public BusyIndicatorModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) |
|||
{ |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(BusyIndicatorView)); |
|||
Container.RegisterNavigationType(typeof(BusyIndicatorCustomContentView)); |
|||
Container.RegisterNavigationType(typeof(BusyIndicatorCustomContentTemplateView)); |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(BusyIndicatorNavItem)); |
|||
} |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( BusyIndicatorNavItem ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,14 +1,32 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.BusyIndicator.NavigationItems.BusyIndicatorNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.BusyIndicator.NavigationItems.BusyIndicatorNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:navItems="clr-namespace:Samples.Modules.BusyIndicator.NavigationItems" |
|||
xmlns:views="clr-namespace:Samples.Modules.BusyIndicator.Views" |
|||
Header="BusyIndicator" Tag="{x:Type views:BusyIndicatorView}"> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:BusyIndicatorNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:BusyIndicatorNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
<TreeViewItem Header="Custom Content" Tag="{x:Type views:BusyIndicatorCustomContentView}" /> |
|||
<TreeViewItem Header="Custom Content Template" Tag="{x:Type views:BusyIndicatorCustomContentTemplateView}" /> |
|||
|
|||
<TreeViewItem Header="Custom Content" Tag="{x:Type views:BusyIndicatorCustomContentView}" /> |
|||
<TreeViewItem Header="Custom Content Template" Tag="{x:Type views:BusyIndicatorCustomContentTemplateView}" /> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,16 +1,34 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Windows.Controls; |
|||
|
|||
namespace Samples.Modules.BusyIndicator.NavigationItems |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for BusyIndicatorNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class BusyIndicatorNavItem : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for BusyIndicatorNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class BusyIndicatorNavItem : TreeViewItem |
|||
{ |
|||
public BusyIndicatorNavItem() |
|||
{ |
|||
public BusyIndicatorNavItem() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,42 +1,60 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<ResourceDictionary 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"> |
|||
|
|||
<DataTemplate x:Key="SampleContent" > |
|||
<Grid Margin="10" > |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="*"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Grid.Row="0" Text="First Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="0" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter First Name" /> |
|||
|
|||
<TextBlock Grid.Row="1" Text="Last Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="1" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter Last Name" /> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Date of Birth:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DateTimeUpDown Grid.Row="2" Grid.Column="1" Format="ShortDate" Margin="2" VerticalAlignment="Center" Watermark="Enter Date of Birth" /> |
|||
|
|||
<TextBlock Grid.Row="3" Text="Salary:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown Grid.Row="3" Grid.Column="1" FormatString="C2" Margin="2" VerticalAlignment="Center" Watermark="Enter Salary" /> |
|||
|
|||
<TextBlock Grid.Row="4" Text="Favorite Color:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:ColorPicker Grid.Row="4" Grid.Column="1" Margin="2" VerticalAlignment="Center" /> |
|||
|
|||
<StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"> |
|||
<Button Width="65" Margin="2">OK</Button> |
|||
<Button Width="65" Margin="2">Cancel</Button> |
|||
</StackPanel> |
|||
</Grid> |
|||
</DataTemplate> |
|||
<DataTemplate x:Key="SampleContent"> |
|||
<Grid Margin="10"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Grid.Row="0" Text="First Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="0" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter First Name" /> |
|||
|
|||
<TextBlock Grid.Row="1" Text="Last Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="1" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter Last Name" /> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Date of Birth:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DateTimeUpDown Grid.Row="2" Grid.Column="1" Format="ShortDate" Margin="2" VerticalAlignment="Center" Watermark="Enter Date of Birth" /> |
|||
|
|||
<TextBlock Grid.Row="3" Text="Salary:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown Grid.Row="3" Grid.Column="1" FormatString="C2" Margin="2" VerticalAlignment="Center" Watermark="Enter Salary" /> |
|||
|
|||
<TextBlock Grid.Row="4" Text="Favorite Color:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:ColorPicker Grid.Row="4" Grid.Column="1" Margin="2" VerticalAlignment="Center" /> |
|||
|
|||
<StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"> |
|||
<Button Width="65" Margin="2">OK</Button> |
|||
<Button Width="65" Margin="2">Cancel</Button> |
|||
</StackPanel> |
|||
</Grid> |
|||
</DataTemplate> |
|||
|
|||
</ResourceDictionary> |
|||
@ -1,63 +1,81 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.BusyIndicator.Views.BusyIndicatorCustomContentTemplateView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.BusyIndicator.Views.BusyIndicatorCustomContentTemplateView" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="BusyIndicator"> |
|||
<infControls:DemoView.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="/Samples.Modules.Busyindicator;component/Resources/Common.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</infControls:DemoView.Resources> |
|||
|
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates how to create a custom content template by setting the BusyContentTemplate property to an instance of a custom DataTemplate. Take notice of how the default ProgressBar is being hidden by setting the PrgressBarStyle property. The default OverlayStyle is also being set to a custom style." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Grid.Row="2" Text="Custom Content Template:" Style="{StaticResource Header}" /> |
|||
<extToolkit:BusyIndicator IsBusy="True"> |
|||
<extToolkit:BusyIndicator.BusyContentTemplate> |
|||
<DataTemplate> |
|||
<StackPanel Margin="4"> |
|||
<TextBlock Text="Downloading Email" FontWeight="Bold" HorizontalAlignment="Center"/> |
|||
<StackPanel Margin="4"> |
|||
<TextBlock Text="Downloading message 4/10..."/> |
|||
<ProgressBar Value="40" Height="15"/> |
|||
</StackPanel> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<Button Grid.Column="0" Content="Pause" HorizontalAlignment="Right" Margin="0 0 2 0"/> |
|||
<Button Grid.Column="1" Content="Cancel" HorizontalAlignment="Left" Margin="2 0 0 0"/> |
|||
</Grid> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
</extToolkit:BusyIndicator.BusyContentTemplate> |
|||
<extToolkit:BusyIndicator.OverlayStyle> |
|||
<Style TargetType="Rectangle"> |
|||
<Setter Property="Fill" Value="#B1EB1D1D"/> |
|||
</Style> |
|||
</extToolkit:BusyIndicator.OverlayStyle> |
|||
<extToolkit:BusyIndicator.ProgressBarStyle> |
|||
<Style TargetType="ProgressBar"> |
|||
<Setter Property="Visibility" Value="Collapsed"/> |
|||
</Style> |
|||
</extToolkit:BusyIndicator.ProgressBarStyle> |
|||
|
|||
<ContentControl ContentTemplate="{StaticResource SampleContent}" /> |
|||
</extToolkit:BusyIndicator> |
|||
</StackPanel> |
|||
</Grid> |
|||
<infControls:DemoView.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="/Samples.Modules.Busyindicator;component/Resources/Common.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</infControls:DemoView.Resources> |
|||
|
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates how to create a custom content template by setting the BusyContentTemplate property to an instance of a custom DataTemplate. Take notice of how the default ProgressBar is being hidden by setting the PrgressBarStyle property. The default OverlayStyle is also being set to a custom style." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Grid.Row="2" Text="Custom Content Template:" Style="{StaticResource Header}" /> |
|||
<extToolkit:BusyIndicator IsBusy="True"> |
|||
<extToolkit:BusyIndicator.BusyContentTemplate> |
|||
<DataTemplate> |
|||
<StackPanel Margin="4"> |
|||
<TextBlock Text="Downloading Email" FontWeight="Bold" HorizontalAlignment="Center" /> |
|||
<StackPanel Margin="4"> |
|||
<TextBlock Text="Downloading message 4/10..." /> |
|||
<ProgressBar Value="40" Height="15" /> |
|||
</StackPanel> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<Button Grid.Column="0" Content="Pause" HorizontalAlignment="Right" Margin="0 0 2 0" /> |
|||
<Button Grid.Column="1" Content="Cancel" HorizontalAlignment="Left" Margin="2 0 0 0" /> |
|||
</Grid> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
</extToolkit:BusyIndicator.BusyContentTemplate> |
|||
<extToolkit:BusyIndicator.OverlayStyle> |
|||
<Style TargetType="Rectangle"> |
|||
<Setter Property="Fill" Value="#B1EB1D1D" /> |
|||
</Style> |
|||
</extToolkit:BusyIndicator.OverlayStyle> |
|||
<extToolkit:BusyIndicator.ProgressBarStyle> |
|||
<Style TargetType="ProgressBar"> |
|||
<Setter Property="Visibility" Value="Collapsed" /> |
|||
</Style> |
|||
</extToolkit:BusyIndicator.ProgressBarStyle> |
|||
|
|||
<ContentControl ContentTemplate="{StaticResource SampleContent}" /> |
|||
</extToolkit:BusyIndicator> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.BusyIndicator.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for BusyIndicatorCustomContentTemplateView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive=false)] |
|||
public partial class BusyIndicatorCustomContentTemplateView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for BusyIndicatorCustomContentTemplateView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class BusyIndicatorCustomContentTemplateView : DemoView |
|||
{ |
|||
public BusyIndicatorCustomContentTemplateView() |
|||
{ |
|||
public BusyIndicatorCustomContentTemplateView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,41 +1,59 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.BusyIndicator.Views.BusyIndicatorCustomContentView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.BusyIndicator.Views.BusyIndicatorCustomContentView" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="BusyIndicator"> |
|||
<infControls:DemoView.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="/Samples.Modules.Busyindicator;component/Resources/Common.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</infControls:DemoView.Resources> |
|||
|
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates how to define your own custom content. This is done by setting the BusyContent property." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Custom Content:" Style="{StaticResource Header}" /> |
|||
<extToolkit:BusyIndicator IsBusy="True"> |
|||
<extToolkit:BusyIndicator.BusyContent> |
|||
<StackPanel Orientation="Horizontal" > |
|||
<Image Source="/Samples.Modules.BusyIndicator;component/Images/CdBurning32.png" /> |
|||
<StackPanel Margin="5,0"> |
|||
<TextBlock Text="Burning CD..." VerticalAlignment="Center" /> |
|||
<TextBlock Text="Madonna - Like a Virgin" VerticalAlignment="Center" Margin="8,0" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</extToolkit:BusyIndicator.BusyContent> |
|||
<ContentControl ContentTemplate="{StaticResource SampleContent}" /> |
|||
</extToolkit:BusyIndicator> |
|||
</StackPanel> |
|||
</Grid> |
|||
<infControls:DemoView.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="/Samples.Modules.Busyindicator;component/Resources/Common.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</infControls:DemoView.Resources> |
|||
|
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates how to define your own custom content. This is done by setting the BusyContent property." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Custom Content:" Style="{StaticResource Header}" /> |
|||
<extToolkit:BusyIndicator IsBusy="True"> |
|||
<extToolkit:BusyIndicator.BusyContent> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<Image Source="/Samples.Modules.BusyIndicator;component/Images/CdBurning32.png" /> |
|||
<StackPanel Margin="5,0"> |
|||
<TextBlock Text="Burning CD..." VerticalAlignment="Center" /> |
|||
<TextBlock Text="Madonna - Like a Virgin" VerticalAlignment="Center" Margin="8,0" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</extToolkit:BusyIndicator.BusyContent> |
|||
<ContentControl ContentTemplate="{StaticResource SampleContent}" /> |
|||
</extToolkit:BusyIndicator> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.BusyIndicator.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for BusyIndicatorCustomContentView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive=false)] |
|||
public partial class BusyIndicatorCustomContentView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for BusyIndicatorCustomContentView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class BusyIndicatorCustomContentView : DemoView |
|||
{ |
|||
public BusyIndicatorCustomContentView() |
|||
{ |
|||
public BusyIndicatorCustomContentView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,32 +1,50 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Windows.Data; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.BusyIndicator.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive=false)] |
|||
public partial class BusyIndicatorView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class BusyIndicatorView : DemoView |
|||
{ |
|||
public BusyIndicatorView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
|
|||
public class IntegerToTimespanConverter : IValueConverter |
|||
{ |
|||
public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) |
|||
{ |
|||
public BusyIndicatorView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
return TimeSpan.FromMilliseconds( ( int )value ); |
|||
} |
|||
|
|||
public class IntegerToTimespanConverter : IValueConverter |
|||
public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) |
|||
{ |
|||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
|||
{ |
|||
return TimeSpan.FromMilliseconds((int)value); |
|||
} |
|||
|
|||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,30 +1,49 @@ |
|||
using System; |
|||
using Samples.Infrastructure; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.Button.Views; |
|||
using Samples.Modules.Button.NavigationItems; |
|||
using Samples.Modules.Button.Views; |
|||
|
|||
namespace Samples.Modules.Button |
|||
{ |
|||
public class ButtonModule : ModuleBase |
|||
public class ButtonModule : ModuleBase |
|||
{ |
|||
public ButtonModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( ButtonSpinnerNavItem ) ); |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( DropDownButtonNavItem ) ); |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( SplitButtonNavItem ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public ButtonModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(ButtonSpinnerNavItem)); |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(DropDownButtonNavItem)); |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(SplitButtonNavItem)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(ButtonSpinnerView)); |
|||
Container.RegisterNavigationType(typeof(DropDownButtonView)); |
|||
Container.RegisterNavigationType(typeof(SplitButtonView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( ButtonSpinnerView ) ); |
|||
Container.RegisterNavigationType( typeof( DropDownButtonView ) ); |
|||
Container.RegisterNavigationType( typeof( SplitButtonView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,12 +1,30 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Button.NavigationItems.ButtonSpinnerNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Button.NavigationItems.ButtonSpinnerNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:navItems="clr-namespace:Samples.Modules.Button.NavigationItems" |
|||
xmlns:views="clr-namespace:Samples.Modules.Button.Views" |
|||
Header="ButtonSpinner" Tag="{x:Type views:ButtonSpinnerView}" > |
|||
|
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:ButtonSpinnerNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:ButtonSpinnerNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,16 +1,33 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows.Controls; |
|||
|
|||
namespace Samples.Modules.Button.NavigationItems |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for ButtonSpinnerNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class ButtonSpinnerNavItem : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for ButtonSpinnerNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class ButtonSpinnerNavItem : TreeViewItem |
|||
{ |
|||
public ButtonSpinnerNavItem() |
|||
{ |
|||
public ButtonSpinnerNavItem() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,12 +1,30 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Button.NavigationItems.DropDownButtonNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Button.NavigationItems.DropDownButtonNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:navItems="clr-namespace:Samples.Modules.Button.NavigationItems" |
|||
xmlns:views="clr-namespace:Samples.Modules.Button.Views" |
|||
Header="DropDownButton" Tag="{x:Type views:DropDownButtonView}"> |
|||
|
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:DropDownButtonNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:DropDownButtonNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,16 +1,33 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows.Controls; |
|||
|
|||
namespace Samples.Modules.Button.NavigationItems |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for DropDownButtonNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class DropDownButtonNavItem : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for DropDownButtonNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class DropDownButtonNavItem : TreeViewItem |
|||
{ |
|||
public DropDownButtonNavItem() |
|||
{ |
|||
public DropDownButtonNavItem() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,12 +1,30 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Button.NavigationItems.SplitButtonNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Button.NavigationItems.SplitButtonNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:navItems="clr-namespace:Samples.Modules.Button.NavigationItems" |
|||
xmlns:views="clr-namespace:Samples.Modules.Button.Views" |
|||
Header="SplitButton" Tag="{x:Type views:SplitButtonView}"> |
|||
|
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:SplitButtonNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:SplitButtonNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,16 +1,33 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows.Controls; |
|||
|
|||
namespace Samples.Modules.Button.NavigationItems |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for SplitButtonNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class SplitButtonNavItem : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for SplitButtonNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class SplitButtonNavItem : TreeViewItem |
|||
{ |
|||
public SplitButtonNavItem() |
|||
{ |
|||
public SplitButtonNavItem() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,49 +1,69 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Button.Views.ButtonSpinnerView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="ButtonSpinner"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The ButtonSpinner control allows you to add button spinners to any element and then respond to the Spin event to manipulate that element. The Spin event lets the developer know which direction the buttons are spinning; SpinDirection.Increase indicates an increment, SpinDirection.Decrease indicates a decrement." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="AllowSpin:" VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_allowSpin" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="When true allows the ButtonSpinner to perform increment/decrement operations."/> |
|||
|
|||
<TextBlock Text="ShowButtonSpinner:" VerticalAlignment="Center" Grid.Row="1" /> |
|||
<CheckBox x:Name="_showButtonSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners."/> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="You can wrap any element by placing it inside the content area of the ButtonSpinner control. As an example, lets create our own simple numeric up/down control" |
|||
TextWrapping="Wrap"/> |
|||
|
|||
<extToolkit:ButtonSpinner Margin="10" Width="150" HorizontalAlignment="Left" |
|||
AllowSpin="{Binding IsChecked, ElementName=_allowSpin}" |
|||
ShowButtonSpinner="{Binding IsChecked, ElementName=_showButtonSpinner}" |
|||
Spin="ButtonSpinner_Spin" > |
|||
<TextBox Text="0" BorderThickness="0" HorizontalContentAlignment="Right" /> |
|||
</extToolkit:ButtonSpinner> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The ButtonSpinner control allows you to add button spinners to any element and then respond to the Spin event to manipulate that element. The Spin event lets the developer know which direction the buttons are spinning; SpinDirection.Increase indicates an increment, SpinDirection.Decrease indicates a decrement." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="AllowSpin:" VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_allowSpin" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="When true allows the ButtonSpinner to perform increment/decrement operations." /> |
|||
|
|||
<TextBlock Text="ShowButtonSpinner:" VerticalAlignment="Center" Grid.Row="1" /> |
|||
<CheckBox x:Name="_showButtonSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="You can wrap any element by placing it inside the content area of the ButtonSpinner control. As an example, lets create our own simple numeric up/down control" |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<extToolkit:ButtonSpinner Margin="10" |
|||
Width="150" |
|||
HorizontalAlignment="Left" |
|||
AllowSpin="{Binding IsChecked, ElementName=_allowSpin}" |
|||
ShowButtonSpinner="{Binding IsChecked, ElementName=_showButtonSpinner}" |
|||
Spin="ButtonSpinner_Spin"> |
|||
<TextBox Text="0" BorderThickness="0" HorizontalContentAlignment="Right" /> |
|||
</extToolkit:ButtonSpinner> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,40 +1,58 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Windows.Controls; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Windows.Controls; |
|||
using System.Windows.Controls; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Button.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for ButtonSpinnerView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class ButtonSpinnerView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for ButtonSpinnerView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class ButtonSpinnerView : DemoView |
|||
{ |
|||
public ButtonSpinnerView() |
|||
{ |
|||
public ButtonSpinnerView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void ButtonSpinner_Spin(object sender, Microsoft.Windows.Controls.SpinEventArgs e) |
|||
{ |
|||
ButtonSpinner spinner = (ButtonSpinner)sender; |
|||
TextBox txtBox = (TextBox)spinner.Content; |
|||
|
|||
try |
|||
{ |
|||
int value = String.IsNullOrEmpty(txtBox.Text) ? 0 : Convert.ToInt32(txtBox.Text); |
|||
if (e.Direction == Microsoft.Windows.Controls.SpinDirection.Increase) |
|||
value++; |
|||
else |
|||
value--; |
|||
txtBox.Text = value.ToString(); |
|||
} |
|||
catch |
|||
{ |
|||
txtBox.Text = "0"; |
|||
} |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void ButtonSpinner_Spin( object sender, Microsoft.Windows.Controls.SpinEventArgs e ) |
|||
{ |
|||
ButtonSpinner spinner = ( ButtonSpinner )sender; |
|||
TextBox txtBox = ( TextBox )spinner.Content; |
|||
|
|||
try |
|||
{ |
|||
int value = String.IsNullOrEmpty( txtBox.Text ) ? 0 : Convert.ToInt32( txtBox.Text ); |
|||
if( e.Direction == Microsoft.Windows.Controls.SpinDirection.Increase ) |
|||
value++; |
|||
else |
|||
value--; |
|||
txtBox.Text = value.ToString(); |
|||
} |
|||
catch |
|||
{ |
|||
txtBox.Text = "0"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,46 +1,64 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Button.Views.DropDownButtonView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.Button.Views.DropDownButtonView" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="DropDownButton" > |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The DropDownButton control is a button that when clicked displays a drop down in which you can place any custom content within." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="IsOpen: " VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_isOpen" Grid.Column="1" IsChecked="False" VerticalAlignment="Center" Margin="5" ClickMode="Press" ToolTip="Get/Sets a value indicating whether or not the drop down is open." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<extToolkit:DropDownButton x:Name="_dropDownButton" Margin="10" Width="150" HorizontalAlignment="Left" Content="Click Me" IsOpen="{Binding IsChecked, ElementName=_isOpen, Mode=TwoWay}" |
|||
Click="DropDownButton_Click"> |
|||
<extToolkit:DropDownButton.DropDownContent> |
|||
<StackPanel> |
|||
<extToolkit:ColorCanvas /> |
|||
<Button Click="Button_Click" Margin="10">OK</Button> |
|||
</StackPanel> |
|||
</extToolkit:DropDownButton.DropDownContent> |
|||
</extToolkit:DropDownButton> |
|||
</StackPanel> |
|||
</Grid> |
|||
Title="DropDownButton"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The DropDownButton control is a button that when clicked displays a drop down in which you can place any custom content within." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="IsOpen: " VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_isOpen" Grid.Column="1" IsChecked="False" VerticalAlignment="Center" Margin="5" ClickMode="Press" ToolTip="Get/Sets a value indicating whether or not the drop down is open." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<extToolkit:DropDownButton x:Name="_dropDownButton" Margin="10" Width="150" HorizontalAlignment="Left" Content="Click Me" IsOpen="{Binding IsChecked, ElementName=_isOpen, Mode=TwoWay}" |
|||
Click="DropDownButton_Click"> |
|||
<extToolkit:DropDownButton.DropDownContent> |
|||
<StackPanel> |
|||
<extToolkit:ColorCanvas /> |
|||
<Button Click="Button_Click" Margin="10">OK</Button> |
|||
</StackPanel> |
|||
</extToolkit:DropDownButton.DropDownContent> |
|||
</extToolkit:DropDownButton> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,28 +1,45 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Button.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for DropDownButtonView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class DropDownButtonView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for DropDownButtonView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class DropDownButtonView : DemoView |
|||
{ |
|||
public DropDownButtonView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void DropDownButton_Click( object sender, System.Windows.RoutedEventArgs e ) |
|||
{ |
|||
|
|||
} |
|||
|
|||
private void Button_Click( object sender, System.Windows.RoutedEventArgs e ) |
|||
{ |
|||
public DropDownButtonView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void DropDownButton_Click(object sender, System.Windows.RoutedEventArgs e) |
|||
{ |
|||
|
|||
} |
|||
|
|||
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) |
|||
{ |
|||
_dropDownButton.IsOpen = false; |
|||
} |
|||
_dropDownButton.IsOpen = false; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,47 +1,64 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Button.Views.SplitButtonView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="SplitButton"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The SplitButton control is a button that can be clicked and also provides a drop down in which you can place any custom content within." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="IsOpen: " VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_isOpen" Grid.Column="1" IsChecked="False" VerticalAlignment="Center" Margin="5" ClickMode="Press" ToolTip="Get/Sets a value indicating whether or not the drop down is open."/> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<extToolkit:SplitButton x:Name="_splitButton" Margin="10" Width="150" HorizontalAlignment="Left" Content="Click Me" IsOpen="{Binding IsChecked, ElementName=_isOpen, Mode=TwoWay}" |
|||
Click="SplitButton_Click"> |
|||
<extToolkit:SplitButton.DropDownContent> |
|||
<StackPanel> |
|||
<extToolkit:ColorCanvas /> |
|||
<Button Click="Button_Click" Margin="10">OK</Button> |
|||
</StackPanel> |
|||
</extToolkit:SplitButton.DropDownContent> |
|||
</extToolkit:SplitButton> |
|||
|
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The SplitButton control is a button that can be clicked and also provides a drop down in which you can place any custom content within." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="IsOpen: " VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_isOpen" Grid.Column="1" IsChecked="False" VerticalAlignment="Center" Margin="5" ClickMode="Press" ToolTip="Get/Sets a value indicating whether or not the drop down is open." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<extToolkit:SplitButton x:Name="_splitButton" Margin="10" Width="150" HorizontalAlignment="Left" Content="Click Me" IsOpen="{Binding IsChecked, ElementName=_isOpen, Mode=TwoWay}" |
|||
Click="SplitButton_Click"> |
|||
<extToolkit:SplitButton.DropDownContent> |
|||
<StackPanel> |
|||
<extToolkit:ColorCanvas /> |
|||
<Button Click="Button_Click" Margin="10">OK</Button> |
|||
</StackPanel> |
|||
</extToolkit:SplitButton.DropDownContent> |
|||
</extToolkit:SplitButton> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,28 +1,45 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Button.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for SplitButtonView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class SplitButtonView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for SplitButtonView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class SplitButtonView : DemoView |
|||
{ |
|||
public SplitButtonView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void SplitButton_Click( object sender, System.Windows.RoutedEventArgs e ) |
|||
{ |
|||
Microsoft.Windows.Controls.MessageBox.Show( "Thanks for clicking me!", "SplitButton Click" ); |
|||
} |
|||
|
|||
private void Button_Click( object sender, System.Windows.RoutedEventArgs e ) |
|||
{ |
|||
public SplitButtonView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private void SplitButton_Click(object sender, System.Windows.RoutedEventArgs e) |
|||
{ |
|||
Microsoft.Windows.Controls.MessageBox.Show("Thanks for clicking me!", "SplitButton Click"); |
|||
} |
|||
|
|||
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) |
|||
{ |
|||
_splitButton.IsOpen = false; |
|||
} |
|||
_splitButton.IsOpen = false; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,28 +1,47 @@ |
|||
using System; |
|||
using Samples.Infrastructure; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.Calculator.Views; |
|||
using Samples.Modules.Calculator.NavigationItems; |
|||
using Samples.Modules.Calculator.Views; |
|||
|
|||
namespace Samples.Modules.Calculator |
|||
{ |
|||
public class CalculatorModule : ModuleBase |
|||
public class CalculatorModule : ModuleBase |
|||
{ |
|||
public CalculatorModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( CalculatorNavItem ) ); |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( CalculatorUpDownNavItem ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public CalculatorModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(CalculatorNavItem)); |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(CalculatorUpDownNavItem)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(CalculatorView)); |
|||
Container.RegisterNavigationType(typeof(CalculatorUpDownView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( CalculatorView ) ); |
|||
Container.RegisterNavigationType( typeof( CalculatorUpDownView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,12 +1,30 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Calculator.NavigationItems.CalculatorNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Calculator.NavigationItems.CalculatorNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:navItems="clr-namespace:Samples.Modules.Calculator.NavigationItems" |
|||
xmlns:views="clr-namespace:Samples.Modules.Calculator.Views" |
|||
Header="Calculator" Tag="{x:Type views:CalculatorView}" > |
|||
Header="Calculator" Tag="{x:Type views:CalculatorView}"> |
|||
|
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:CalculatorNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:CalculatorNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,16 +1,33 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows.Controls; |
|||
|
|||
namespace Samples.Modules.Calculator.NavigationItems |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class CalculatorNavItem : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class CalculatorNavItem : TreeViewItem |
|||
{ |
|||
public CalculatorNavItem() |
|||
{ |
|||
public CalculatorNavItem() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,12 +1,30 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Calculator.NavigationItems.CalculatorUpDownNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Calculator.NavigationItems.CalculatorUpDownNavItem" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:navItems="clr-namespace:Samples.Modules.Calculator.NavigationItems" |
|||
xmlns:views="clr-namespace:Samples.Modules.Calculator.Views" |
|||
Header="CalculatorUpDown" Tag="{x:Type views:CalculatorUpDownView}" > |
|||
Header="CalculatorUpDown" Tag="{x:Type views:CalculatorUpDownView}"> |
|||
|
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:CalculatorUpDownNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="navItems:CalculatorUpDownNavItem" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,16 +1,33 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows.Controls; |
|||
|
|||
namespace Samples.Modules.Calculator.NavigationItems |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorUpDownNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class CalculatorUpDownNavItem : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorUpDownNavItem.xaml
|
|||
/// </summary>
|
|||
public partial class CalculatorUpDownNavItem : TreeViewItem |
|||
{ |
|||
public CalculatorUpDownNavItem() |
|||
{ |
|||
public CalculatorUpDownNavItem() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,62 +1,80 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Calculator.Views.CalculatorUpDownView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="CalculatorUpDown"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The CalculatorUpDown provides a TextBox with button spinners that allow incrementing and decrementing numeric values by using the spinner buttons, keyboard up/down arrows, or mouse wheel. It also provides a Calculator dropdown which allows you to perform mathematical calculations." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5" HorizontalAlignment="Left"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
<TextBlock Text="Precision: " VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown x:Name="_precision" Grid.Column="1" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Minimum="0" Value="2" ToolTip="Gets/Sets the maximum number of digits displayed to the right of the decimal point." /> |
|||
<TextBlock Text="FormatString:" Grid.Row="1" VerticalAlignment="Center"/> |
|||
<ComboBox x:Name="_formatString" SelectedIndex="0" Grid.Row="1" Grid.Column="1" Width="150" Margin="5"> |
|||
<ComboBoxItem Tag="C2">Currency</ComboBoxItem> |
|||
<ComboBoxItem Tag="F2">Fixed Point</ComboBoxItem> |
|||
<ComboBoxItem Tag="G">General</ComboBoxItem> |
|||
<ComboBoxItem Tag="N">Number</ComboBoxItem> |
|||
<ComboBoxItem Tag="P2">Percent</ComboBoxItem> |
|||
</ComboBox> |
|||
<TextBlock Text="Watermakr:" Grid.Row="2" VerticalAlignment="Center"/> |
|||
<TextBox x:Name="_watermark" Grid.Row="2" Grid.Column="1" Width="150" Margin="5" Text="Enter Value"/> |
|||
<TextBlock Grid.Column="2" Text="Increment" VerticalAlignment="Center" /> |
|||
<TextBlock Grid.Column="2" Grid.Row="1" Text="Minimum" VerticalAlignment="Center" /> |
|||
<TextBlock Grid.Column="2" Grid.Row="2" Text="Maximum" VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown Grid.Column="3" Name="_increment" Minimum="0" Value="1" VerticalAlignment="Center" Margin="5" Width="150" /> |
|||
<extToolkit:IntegerUpDown Grid.Column="3" Grid.Row="1" Name="_minimum" Value="-100" VerticalAlignment="Center" Margin="5" Width="150" /> |
|||
<extToolkit:IntegerUpDown Grid.Column="3" Grid.Row="2" Name="_maximum" Value="5000" VerticalAlignment="Center" Margin="5" Width="150" /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10" HorizontalAlignment="Left"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<extToolkit:CalculatorUpDown Margin="10" Width="250" |
|||
Increment="{Binding Value, ElementName=_increment}" |
|||
Maximum="{Binding Value, ElementName=_maximum}" |
|||
Minimum="{Binding Value, ElementName=_minimum}" |
|||
Precision="{Binding Value, ElementName=_precision}" |
|||
FormatString="{Binding SelectedItem.Tag, ElementName=_formatString}" |
|||
Watermark="{Binding Text, ElementName=_watermark}"/> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The CalculatorUpDown provides a TextBox with button spinners that allow incrementing and decrementing numeric values by using the spinner buttons, keyboard up/down arrows, or mouse wheel. It also provides a Calculator dropdown which allows you to perform mathematical calculations." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5" HorizontalAlignment="Left"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
<TextBlock Text="Precision: " VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown x:Name="_precision" Grid.Column="1" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Minimum="0" Value="2" ToolTip="Gets/Sets the maximum number of digits displayed to the right of the decimal point." /> |
|||
<TextBlock Text="FormatString:" Grid.Row="1" VerticalAlignment="Center" /> |
|||
<ComboBox x:Name="_formatString" SelectedIndex="0" Grid.Row="1" Grid.Column="1" Width="150" Margin="5"> |
|||
<ComboBoxItem Tag="C2">Currency</ComboBoxItem> |
|||
<ComboBoxItem Tag="F2">Fixed Point</ComboBoxItem> |
|||
<ComboBoxItem Tag="G">General</ComboBoxItem> |
|||
<ComboBoxItem Tag="N">Number</ComboBoxItem> |
|||
<ComboBoxItem Tag="P2">Percent</ComboBoxItem> |
|||
</ComboBox> |
|||
<TextBlock Text="Watermakr:" Grid.Row="2" VerticalAlignment="Center" /> |
|||
<TextBox x:Name="_watermark" Grid.Row="2" Grid.Column="1" Width="150" Margin="5" Text="Enter Value" /> |
|||
<TextBlock Grid.Column="2" Text="Increment" VerticalAlignment="Center" /> |
|||
<TextBlock Grid.Column="2" Grid.Row="1" Text="Minimum" VerticalAlignment="Center" /> |
|||
<TextBlock Grid.Column="2" Grid.Row="2" Text="Maximum" VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown Grid.Column="3" Name="_increment" Minimum="0" Value="1" VerticalAlignment="Center" Margin="5" Width="150" /> |
|||
<extToolkit:IntegerUpDown Grid.Column="3" Grid.Row="1" Name="_minimum" Value="-100" VerticalAlignment="Center" Margin="5" Width="150" /> |
|||
<extToolkit:IntegerUpDown Grid.Column="3" Grid.Row="2" Name="_maximum" Value="5000" VerticalAlignment="Center" Margin="5" Width="150" /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10" HorizontalAlignment="Left"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<extToolkit:CalculatorUpDown Margin="10" Width="250" |
|||
Increment="{Binding Value, ElementName=_increment}" |
|||
Maximum="{Binding Value, ElementName=_maximum}" |
|||
Minimum="{Binding Value, ElementName=_minimum}" |
|||
Precision="{Binding Value, ElementName=_precision}" |
|||
FormatString="{Binding SelectedItem.Tag, ElementName=_formatString}" |
|||
Watermark="{Binding Text, ElementName=_watermark}" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Calculator.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorUpDownView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class CalculatorUpDownView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorUpDownView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class CalculatorUpDownView : DemoView |
|||
{ |
|||
public CalculatorUpDownView() |
|||
{ |
|||
public CalculatorUpDownView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,39 +1,57 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Calculator.Views.CalculatorView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Calculator"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The Calculator is a control used for performing mathematical calculations." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="Precision: " VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown x:Name="_precision" Grid.Column="1" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Minimum="0" Value="2" ToolTip="Gets/Sets the maximum number of digits displayed to the right of the decimal point." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="When the Calculator has focus, you can use the keyboard to interact with the key pad. Click the Calculator to give focus." Margin="10,0"/> |
|||
<extToolkit:Calculator Margin="10" Width="250" Precision="{Binding Value, ElementName=_precision}" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The Calculator is a control used for performing mathematical calculations." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="Precision: " VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown x:Name="_precision" Grid.Column="1" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Minimum="0" Value="2" ToolTip="Gets/Sets the maximum number of digits displayed to the right of the decimal point." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="When the Calculator has focus, you can use the keyboard to interact with the key pad. Click the Calculator to give focus." Margin="10,0" /> |
|||
<extToolkit:Calculator Margin="10" Width="250" Precision="{Binding Value, ElementName=_precision}" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Calculator.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class CalculatorView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for CalculatorView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class CalculatorView : DemoView |
|||
{ |
|||
public CalculatorView() |
|||
{ |
|||
public CalculatorView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,25 +1,44 @@ |
|||
using System; |
|||
using Microsoft.Practices.Unity; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.ChildWindow.Views; |
|||
|
|||
namespace Samples.Modules.ChildWindow |
|||
{ |
|||
public class ChildWindowModule: ModuleBase |
|||
public class ChildWindowModule : ModuleBase |
|||
{ |
|||
public ChildWindowModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( NavigationView ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public ChildWindowModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(HomeView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( HomeView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,115 +1,133 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.ChildWindow.Views.HomeView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
Title="ChildWindow"> |
|||
|
|||
<infControls:DemoView.Resources> |
|||
<ObjectDataProvider x:Key="WindowStates" MethodName="GetValues" |
|||
ObjectType="{x:Type sys:Enum}" > |
|||
<ObjectDataProvider.MethodParameters> |
|||
<x:Type TypeName="extToolkit:WindowState"/> |
|||
</ObjectDataProvider.MethodParameters> |
|||
</ObjectDataProvider> |
|||
<ObjectDataProvider x:Key="WindowStartupLocations" MethodName="GetValues" |
|||
ObjectType="{x:Type sys:Enum}" > |
|||
<ObjectDataProvider.MethodParameters> |
|||
<x:Type TypeName="extToolkit:WindowStartupLocation"/> |
|||
</ObjectDataProvider.MethodParameters> |
|||
</ObjectDataProvider> |
|||
</infControls:DemoView.Resources> |
|||
|
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="ChildWindow description goes here." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="Caption:" Margin="2" VerticalAlignment="Center" /> |
|||
<TextBox Name="_txtCaption" Grid.Column="1" Margin="5" Text="ChildWindow" VerticalAlignment="Center" /> |
|||
|
|||
<TextBlock Grid.Row="1" Name="textBlock2" Text="Left:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DoubleUpDown x:Name="_txtLeft" Grid.Column="1" Grid.Row="1" Value="0" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
<TextBlock Grid.Row="2" Name="textBlock3" Text="Top:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DoubleUpDown x:Name="_txtTop" Grid.Column="1" Grid.Row="2" Value="0" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
|
|||
<TextBlock Text="IsModal:" VerticalAlignment="Center" Margin="2" Grid.Column="2" /> |
|||
<CheckBox x:Name="_chkIsModal" Grid.Column="3" VerticalAlignment="Center" Margin="5" IsChecked="True" /> |
|||
|
|||
<TextBlock Grid.Row="1" Text="WindowState:" VerticalAlignment="Center" Margin="2" Grid.Column="2" /> |
|||
<ComboBox Grid.Column="3" Grid.Row="1" Name="_cboWindowState" ItemsSource="{Binding Source={StaticResource WindowStates}}" SelectedIndex="1" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
<TextBlock Grid.Row="2" Text="WindowStartupLocation:" VerticalAlignment="Center" Margin="2" Grid.Column="2" /> |
|||
<ComboBox Grid.Column="3" Grid.Row="2" Name="_cboWindowStartupLocations" ItemsSource="{Binding Source={StaticResource WindowStartupLocations}}" SelectedIndex="0" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
<infControls:DemoView.Resources> |
|||
<ObjectDataProvider x:Key="WindowStates" MethodName="GetValues" |
|||
ObjectType="{x:Type sys:Enum}"> |
|||
<ObjectDataProvider.MethodParameters> |
|||
<x:Type TypeName="extToolkit:WindowState" /> |
|||
</ObjectDataProvider.MethodParameters> |
|||
</ObjectDataProvider> |
|||
<ObjectDataProvider x:Key="WindowStartupLocations" MethodName="GetValues" |
|||
ObjectType="{x:Type sys:Enum}"> |
|||
<ObjectDataProvider.MethodParameters> |
|||
<x:Type TypeName="extToolkit:WindowStartupLocation" /> |
|||
</ObjectDataProvider.MethodParameters> |
|||
</ObjectDataProvider> |
|||
</infControls:DemoView.Resources> |
|||
|
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="ChildWindow description goes here." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="Caption:" Margin="2" VerticalAlignment="Center" /> |
|||
<TextBox Name="_txtCaption" Grid.Column="1" Margin="5" Text="ChildWindow" VerticalAlignment="Center" /> |
|||
|
|||
<TextBlock Grid.Row="1" Name="textBlock2" Text="Left:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DoubleUpDown x:Name="_txtLeft" Grid.Column="1" Grid.Row="1" Value="0" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
<TextBlock Grid.Row="2" Name="textBlock3" Text="Top:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DoubleUpDown x:Name="_txtTop" Grid.Column="1" Grid.Row="2" Value="0" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
|
|||
<TextBlock Text="IsModal:" VerticalAlignment="Center" Margin="2" Grid.Column="2" /> |
|||
<CheckBox x:Name="_chkIsModal" Grid.Column="3" VerticalAlignment="Center" Margin="5" IsChecked="True" /> |
|||
|
|||
<TextBlock Grid.Row="1" Text="WindowState:" VerticalAlignment="Center" Margin="2" Grid.Column="2" /> |
|||
<ComboBox Grid.Column="3" Grid.Row="1" Name="_cboWindowState" ItemsSource="{Binding Source={StaticResource WindowStates}}" SelectedIndex="1" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
<TextBlock Grid.Row="2" Text="WindowStartupLocation:" VerticalAlignment="Center" Margin="2" Grid.Column="2" /> |
|||
<ComboBox Grid.Column="3" Grid.Row="2" Name="_cboWindowStartupLocations" ItemsSource="{Binding Source={StaticResource WindowStartupLocations}}" SelectedIndex="0" VerticalAlignment="Center" Margin="5" /> |
|||
|
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<Grid Grid.Row="2" Margin="10"> |
|||
<extToolkit:ChildWindow Width="350" |
|||
Caption="{Binding Text, ElementName=_txtCaption}" |
|||
IsModal="{Binding IsChecked, ElementName=_chkIsModal}" |
|||
Left="{Binding Value, ElementName=_txtLeft, Mode=TwoWay}" |
|||
Top="{Binding Value, ElementName=_txtTop, Mode=TwoWay}" |
|||
WindowStartupLocation="{Binding SelectedItem, ElementName=_cboWindowStartupLocations}" |
|||
WindowState="{Binding SelectedItem, ElementName=_cboWindowState}"> |
|||
<Grid Margin="10" > |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Grid.Row="0" Text="First Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="0" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter First Name" /> |
|||
|
|||
<TextBlock Grid.Row="1" Text="Last Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="1" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter Last Name" /> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Date of Birth:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DateTimeUpDown Grid.Row="2" Grid.Column="1" Format="ShortDate" Margin="2" VerticalAlignment="Center" Watermark="Enter Date of Birth" /> |
|||
|
|||
<TextBlock Grid.Row="3" Text="Salary:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown Grid.Row="3" Grid.Column="1" FormatString="C2" Margin="2" VerticalAlignment="Center" Watermark="Enter Salary" /> |
|||
|
|||
<TextBlock Grid.Row="4" Text="Favorite Color:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:ColorPicker Grid.Row="4" Grid.Column="1" Margin="2" VerticalAlignment="Center" /> |
|||
|
|||
<StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"> |
|||
<Button Width="65" Margin="2">OK</Button> |
|||
<Button Width="65" Margin="2">Cancel</Button> |
|||
</StackPanel> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<Grid Grid.Row="2" Margin="10"> |
|||
<extToolkit:ChildWindow Width="350" |
|||
Caption="{Binding Text, ElementName=_txtCaption}" |
|||
IsModal="{Binding IsChecked, ElementName=_chkIsModal}" |
|||
Left="{Binding Value, ElementName=_txtLeft, Mode=TwoWay}" |
|||
Top="{Binding Value, ElementName=_txtTop, Mode=TwoWay}" |
|||
WindowStartupLocation="{Binding SelectedItem, ElementName=_cboWindowStartupLocations}" |
|||
WindowState="{Binding SelectedItem, ElementName=_cboWindowState}"> |
|||
<Grid Margin="10" > |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
<RowDefinition Height="Auto"/> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto"/> |
|||
<ColumnDefinition Width="*"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Grid.Row="0" Text="First Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="0" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter First Name" /> |
|||
|
|||
<TextBlock Grid.Row="1" Text="Last Name:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="1" Grid.Column="1" Margin="2" VerticalAlignment="Center" Watermark="Enter Last Name" /> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Date of Birth:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:DateTimeUpDown Grid.Row="2" Grid.Column="1" Format="ShortDate" Margin="2" VerticalAlignment="Center" Watermark="Enter Date of Birth" /> |
|||
|
|||
<TextBlock Grid.Row="3" Text="Salary:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:IntegerUpDown Grid.Row="3" Grid.Column="1" FormatString="C2" Margin="2" VerticalAlignment="Center" Watermark="Enter Salary" /> |
|||
|
|||
<TextBlock Grid.Row="4" Text="Favorite Color:" Margin="2" VerticalAlignment="Center" /> |
|||
<extToolkit:ColorPicker Grid.Row="4" Grid.Column="1" Margin="2" VerticalAlignment="Center" /> |
|||
|
|||
<StackPanel Grid.Row="5" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0"> |
|||
<Button Width="65" Margin="2">OK</Button> |
|||
<Button Width="65" Margin="2">Cancel</Button> |
|||
</StackPanel> |
|||
</Grid> |
|||
</extToolkit:ChildWindow> |
|||
</Grid> |
|||
</Grid> |
|||
</extToolkit:ChildWindow> |
|||
</Grid> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.ChildWindow.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,11 +1,29 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.ChildWindow.Views.NavigationView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.ChildWindow.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.ChildWindow.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,160 +1,198 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using System.ComponentModel; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.ComponentModel; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Color.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
DataContext = new Data(); |
|||
|
|||
//List<string> colors = new List<string>();
|
|||
//colors.Add("1");
|
|||
//colors.Add("2");
|
|||
//colors.Add("3");
|
|||
//colors.Add("4");
|
|||
//colors.Add("5");
|
|||
//colors.Add("6");
|
|||
//colors.Add("7");
|
|||
//colors.Add("8");
|
|||
//colors.Add("9");
|
|||
//colors.Add("10");
|
|||
|
|||
|
|||
List<Person> colors = new List<Person>(); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Red, 0 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Purple, 1 ) |
|||
{ |
|||
IsSelected = true |
|||
} ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Coral, 2 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.MidnightBlue, 3 ) |
|||
{ |
|||
IsSelected = true |
|||
} ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Green, 4 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Red, 5 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Purple, 6 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.SaddleBrown, 7 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.MidnightBlue, 8 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Green, 9 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Red, 10 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Purple, 11 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.SaddleBrown, 12 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.MidnightBlue, 13 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Green, 14 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Red, 15 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Purple, 16 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.SaddleBrown, 17 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.MidnightBlue, 18 ) ); |
|||
colors.Add( new Person( System.Windows.Media.Colors.Green, 19 ) ); |
|||
|
|||
//_dataGrid.ItemsSource = colors;
|
|||
//_chk.ItemsSource = colors;
|
|||
_combo.ItemsSource = colors; |
|||
//_combo.SelectedValue = "1,3,5,7,9,";
|
|||
|
|||
_listBox.ItemsSource = colors; |
|||
//_listBox.SelectedValue = "1,3,5,7,9,";
|
|||
} |
|||
|
|||
private void Button_Click( object sender, System.Windows.RoutedEventArgs e ) |
|||
{ |
|||
( DataContext as Data ).SelectedValue = "1,3,5,7,9,"; |
|||
} |
|||
} |
|||
|
|||
public class Data : INotifyPropertyChanged |
|||
{ |
|||
private string _selectedValues;// = "1,3,5,7,9,";
|
|||
public string SelectedValue |
|||
{ |
|||
get |
|||
{ |
|||
return _selectedValues; |
|||
} |
|||
set |
|||
{ |
|||
_selectedValues = value; |
|||
OnPropertyChanged( "SelectedValue" ); |
|||
} |
|||
} |
|||
|
|||
private ObservableCollection<Person> _selectedItems = new ObservableCollection<Person>(); |
|||
public ObservableCollection<Person> SelectedItems |
|||
{ |
|||
get |
|||
{ |
|||
return _selectedItems; |
|||
} |
|||
set |
|||
{ |
|||
_selectedItems = value; |
|||
OnPropertyChanged( "SelectedItems" ); |
|||
} |
|||
} |
|||
|
|||
public Data() |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
DataContext = new Data(); |
|||
|
|||
//List<string> colors = new List<string>();
|
|||
//colors.Add("1");
|
|||
//colors.Add("2");
|
|||
//colors.Add("3");
|
|||
//colors.Add("4");
|
|||
//colors.Add("5");
|
|||
//colors.Add("6");
|
|||
//colors.Add("7");
|
|||
//colors.Add("8");
|
|||
//colors.Add("9");
|
|||
//colors.Add("10");
|
|||
|
|||
|
|||
List<Person> colors = new List<Person>(); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Red, 0)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Purple, 1) { IsSelected = true }); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Coral, 2)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.MidnightBlue, 3) { IsSelected = true }); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Green, 4)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Red, 5)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Purple, 6)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.SaddleBrown, 7)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.MidnightBlue, 8)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Green, 9)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Red, 10)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Purple, 11)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.SaddleBrown, 12)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.MidnightBlue, 13)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Green, 14)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Red, 15)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Purple, 16)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.SaddleBrown, 17)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.MidnightBlue, 18)); |
|||
colors.Add(new Person(System.Windows.Media.Colors.Green, 19)); |
|||
|
|||
//_dataGrid.ItemsSource = colors;
|
|||
//_chk.ItemsSource = colors;
|
|||
_combo.ItemsSource = colors; |
|||
//_combo.SelectedValue = "1,3,5,7,9,";
|
|||
|
|||
_listBox.ItemsSource = colors; |
|||
//_listBox.SelectedValue = "1,3,5,7,9,";
|
|||
} |
|||
|
|||
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) |
|||
{ |
|||
(DataContext as Data).SelectedValue = "1,3,5,7,9,"; |
|||
} |
|||
} |
|||
|
|||
public class Data: INotifyPropertyChanged |
|||
public event PropertyChangedEventHandler PropertyChanged; |
|||
protected void OnPropertyChanged( string propertyName ) |
|||
{ |
|||
private string _selectedValues;// = "1,3,5,7,9,";
|
|||
public string SelectedValue |
|||
{ |
|||
get |
|||
{ |
|||
return _selectedValues; |
|||
} |
|||
set |
|||
{ |
|||
_selectedValues = value; |
|||
OnPropertyChanged("SelectedValue"); |
|||
} |
|||
} |
|||
|
|||
private ObservableCollection<Person> _selectedItems = new ObservableCollection<Person>(); |
|||
public ObservableCollection<Person> SelectedItems |
|||
{ |
|||
get { return _selectedItems; } |
|||
set |
|||
{ |
|||
_selectedItems = value; |
|||
OnPropertyChanged("SelectedItems"); |
|||
} |
|||
} |
|||
|
|||
public Data() |
|||
{ |
|||
} |
|||
|
|||
public event PropertyChangedEventHandler PropertyChanged; |
|||
protected void OnPropertyChanged(string propertyName) |
|||
{ |
|||
if (PropertyChanged != null) |
|||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
|||
} |
|||
if( PropertyChanged != null ) |
|||
PropertyChanged( this, new PropertyChangedEventArgs( propertyName ) ); |
|||
} |
|||
} |
|||
|
|||
public class Person : INotifyPropertyChanged |
|||
public class Person : INotifyPropertyChanged |
|||
{ |
|||
private bool _isSelected; |
|||
public bool IsSelected |
|||
{ |
|||
private bool _isSelected; |
|||
public bool IsSelected |
|||
{ |
|||
get { return _isSelected; } |
|||
set |
|||
{ |
|||
_isSelected = value; |
|||
OnPropertyChanged("IsSelected"); |
|||
} |
|||
} |
|||
|
|||
System.Windows.Media.Color _color; |
|||
public System.Windows.Media.Color Color |
|||
{ |
|||
get { return _color; } |
|||
set |
|||
{ |
|||
_color = value; |
|||
OnPropertyChanged("Color"); |
|||
} |
|||
} |
|||
|
|||
int _level; |
|||
public int Level |
|||
{ |
|||
get { return _level; } |
|||
set { _level = value; OnPropertyChanged("Level"); } |
|||
} |
|||
|
|||
public Person() |
|||
{ |
|||
} |
|||
|
|||
public Person(System.Windows.Media.Color color, int level) |
|||
{ |
|||
this._color = color; |
|||
this._level = level; |
|||
} |
|||
|
|||
public event PropertyChangedEventHandler PropertyChanged; |
|||
protected void OnPropertyChanged(string propertyName) |
|||
{ |
|||
if (PropertyChanged != null) |
|||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
|||
} |
|||
get |
|||
{ |
|||
return _isSelected; |
|||
} |
|||
set |
|||
{ |
|||
_isSelected = value; |
|||
OnPropertyChanged( "IsSelected" ); |
|||
} |
|||
} |
|||
|
|||
System.Windows.Media.Color _color; |
|||
public System.Windows.Media.Color Color |
|||
{ |
|||
get |
|||
{ |
|||
return _color; |
|||
} |
|||
set |
|||
{ |
|||
_color = value; |
|||
OnPropertyChanged( "Color" ); |
|||
} |
|||
} |
|||
|
|||
int _level; |
|||
public int Level |
|||
{ |
|||
get |
|||
{ |
|||
return _level; |
|||
} |
|||
set |
|||
{ |
|||
_level = value; |
|||
OnPropertyChanged( "Level" ); |
|||
} |
|||
} |
|||
|
|||
public Person() |
|||
{ |
|||
} |
|||
|
|||
public Person( System.Windows.Media.Color color, int level ) |
|||
{ |
|||
this._color = color; |
|||
this._level = level; |
|||
} |
|||
|
|||
public event PropertyChangedEventHandler PropertyChanged; |
|||
protected void OnPropertyChanged( string propertyName ) |
|||
{ |
|||
if( PropertyChanged != null ) |
|||
PropertyChanged( this, new PropertyChangedEventArgs( propertyName ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,11 +1,29 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Color.Views.NavigationView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Color.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.Color.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,25 +1,44 @@ |
|||
using System; |
|||
using Microsoft.Practices.Unity; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.DateTime.Views; |
|||
|
|||
namespace Samples.Modules.DateTime |
|||
{ |
|||
public class DateTimeModule: ModuleBase |
|||
public class DateTimeModule : ModuleBase |
|||
{ |
|||
public DateTimeModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( NavigationView ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public DateTimeModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(HomeView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( HomeView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,10 +1,28 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.DateTime.Views.HomeView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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 IsReadOnly="False" /> |
|||
</Grid> |
|||
<Grid> |
|||
<extToolkit:DateTimePicker IsReadOnly="False" /> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.DateTime.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,11 +1,29 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.DateTime.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.DateTime.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.DateTime.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,25 +1,44 @@ |
|||
using System; |
|||
using Microsoft.Practices.Unity; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.Numeric.Views; |
|||
|
|||
namespace Samples.Modules.Numeric |
|||
{ |
|||
public class NumericModule: ModuleBase |
|||
public class NumericModule : ModuleBase |
|||
{ |
|||
public NumericModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( NavigationView ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public NumericModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(HomeView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( HomeView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,9 +1,27 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Numeric.Views.HomeView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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> |
|||
<Grid> |
|||
<TextBlock Text="Numeric View" /> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Numeric.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,11 +1,29 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Numeric.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Numeric.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.Numeric.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,31 +1,50 @@ |
|||
using System; |
|||
using Microsoft.Practices.Unity; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.PropertyGrid.Views; |
|||
|
|||
namespace Samples.Modules.PropertyGrid |
|||
{ |
|||
public class PropertyGridModule: ModuleBase |
|||
public class PropertyGridModule : ModuleBase |
|||
{ |
|||
public PropertyGridModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( NavigationView ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public PropertyGridModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(HomeView)); |
|||
Container.RegisterNavigationType(typeof(CustomEditors)); |
|||
Container.RegisterNavigationType(typeof(CustomItemsSource)); |
|||
Container.RegisterNavigationType(typeof(DefaultEditors)); |
|||
Container.RegisterNavigationType(typeof(ExpandableProperties)); |
|||
Container.RegisterNavigationType(typeof(SpecifyingProperties)); |
|||
Container.RegisterNavigationType(typeof(BindingToStructs)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( HomeView ) ); |
|||
Container.RegisterNavigationType( typeof( CustomEditors ) ); |
|||
Container.RegisterNavigationType( typeof( CustomItemsSource ) ); |
|||
Container.RegisterNavigationType( typeof( DefaultEditors ) ); |
|||
Container.RegisterNavigationType( typeof( ExpandableProperties ) ); |
|||
Container.RegisterNavigationType( typeof( SpecifyingProperties ) ); |
|||
Container.RegisterNavigationType( typeof( BindingToStructs ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,9 +1,27 @@ |
|||
<UserControl x:Class="Samples.Modules.PropertyGrid.LastNameUserControlEditor" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<UserControl x:Class="Samples.Modules.PropertyGrid.LastNameUserControlEditor" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:Name="_uc"> |
|||
<StackPanel> |
|||
<TextBox Text="{Binding Value, ElementName=_uc}" Background="YellowGreen" /> |
|||
<Button Click="Button_Click">Clear</Button> |
|||
</StackPanel> |
|||
<StackPanel> |
|||
<TextBox Text="{Binding Value, ElementName=_uc}" Background="YellowGreen" /> |
|||
<Button Click="Button_Click">Clear</Button> |
|||
</StackPanel> |
|||
</UserControl> |
|||
|
|||
@ -1,39 +1,63 @@ |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using Microsoft.Windows.Controls.PropertyGrid.Editors; |
|||
using System.Windows.Data; |
|||
using Microsoft.Windows.Controls.PropertyGrid.Editors; |
|||
|
|||
namespace Samples.Modules.PropertyGrid |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for LastNameUserControlEditor.xaml
|
|||
/// </summary>
|
|||
public partial class LastNameUserControlEditor : UserControl, ITypeEditor |
|||
/// <summary>
|
|||
/// Interaction logic for LastNameUserControlEditor.xaml
|
|||
/// </summary>
|
|||
public partial class LastNameUserControlEditor : UserControl, ITypeEditor |
|||
{ |
|||
public LastNameUserControlEditor() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( "Value", typeof( string ), typeof( LastNameUserControlEditor ), new FrameworkPropertyMetadata( null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault ) ); |
|||
public string Value |
|||
{ |
|||
get |
|||
{ |
|||
return ( string )GetValue( ValueProperty ); |
|||
} |
|||
set |
|||
{ |
|||
SetValue( ValueProperty, value ); |
|||
} |
|||
} |
|||
|
|||
private void Button_Click( object sender, RoutedEventArgs e ) |
|||
{ |
|||
Value = string.Empty; |
|||
} |
|||
|
|||
public FrameworkElement ResolveEditor( Microsoft.Windows.Controls.PropertyGrid.PropertyItem propertyItem ) |
|||
{ |
|||
public LastNameUserControlEditor() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(string), typeof(LastNameUserControlEditor), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault)); |
|||
public string Value |
|||
{ |
|||
get { return (string)GetValue(ValueProperty); } |
|||
set { SetValue(ValueProperty, value); } |
|||
} |
|||
|
|||
private void Button_Click(object sender, RoutedEventArgs e) |
|||
{ |
|||
Value = string.Empty; |
|||
} |
|||
|
|||
public FrameworkElement ResolveEditor(Microsoft.Windows.Controls.PropertyGrid.PropertyItem propertyItem) |
|||
{ |
|||
Binding binding = new Binding("Value"); |
|||
binding.Source = propertyItem; |
|||
binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; |
|||
BindingOperations.SetBinding(this, LastNameUserControlEditor.ValueProperty, binding); |
|||
return this; |
|||
} |
|||
Binding binding = new Binding( "Value" ); |
|||
binding.Source = propertyItem; |
|||
binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; |
|||
BindingOperations.SetBinding( this, LastNameUserControlEditor.ValueProperty, binding ); |
|||
return this; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,96 +1,118 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.ComponentModel; |
|||
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; |
|||
using System.ComponentModel; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for BindingToStructs.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class BindingToStructs : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for BindingToStructs.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class BindingToStructs : DemoView |
|||
{ |
|||
public BindingToStructs() |
|||
{ |
|||
public BindingToStructs() |
|||
{ |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
|
|||
public class Person |
|||
{ |
|||
[Category("Information")] |
|||
[DisplayName("First Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string FirstName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Last Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string LastName { get; set; } |
|||
|
|||
public Dimension Dimensions { get; set; } |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.Dimensions = new Dimension() { Height = 75.0, Weight = 185.76 }; |
|||
return person; |
|||
} |
|||
} |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
|
|||
public struct Dimension |
|||
public class Person |
|||
{ |
|||
public double Height; |
|||
public double Weight; |
|||
[Category( "Information" )] |
|||
[DisplayName( "First Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Last Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public Dimension(double height, double weight) |
|||
public Dimension Dimensions |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.Dimensions = new Dimension() |
|||
{ |
|||
this.Height = height; |
|||
this.Weight = weight; |
|||
} |
|||
Height = 75.0, |
|||
Weight = 185.76 |
|||
}; |
|||
return person; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public struct Dimension |
|||
{ |
|||
public double Height; |
|||
public double Weight; |
|||
|
|||
public class DimensionsConverter : IValueConverter |
|||
public Dimension( double height, double weight ) |
|||
{ |
|||
static Dimension _originalValue; // the static struct that stores original value at the start of editing
|
|||
this.Height = height; |
|||
this.Weight = weight; |
|||
} |
|||
} |
|||
|
|||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
|||
{ |
|||
_originalValue = ((Dimension)value); |
|||
public class DimensionsConverter : IValueConverter |
|||
{ |
|||
static Dimension _originalValue; // the static struct that stores original value at the start of editing
|
|||
|
|||
if (parameter.ToString() == "Height") |
|||
return ((Dimension)value).Height; |
|||
if (parameter.ToString() == "Weight") |
|||
return ((Dimension)value).Weight; |
|||
public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) |
|||
{ |
|||
_originalValue = ( ( Dimension )value ); |
|||
|
|||
return _originalValue; |
|||
} |
|||
if( parameter.ToString() == "Height" ) |
|||
return ( ( Dimension )value ).Height; |
|||
if( parameter.ToString() == "Weight" ) |
|||
return ( ( Dimension )value ).Weight; |
|||
|
|||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
|||
{ |
|||
if (parameter.ToString() == "Height") |
|||
_originalValue = new Dimension(double.Parse(value.ToString()), _originalValue.Weight); |
|||
if (parameter.ToString() == "Weight") |
|||
_originalValue = new Dimension(_originalValue.Height, double.Parse(value.ToString())); |
|||
return _originalValue; |
|||
} |
|||
|
|||
return _originalValue; |
|||
public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture ) |
|||
{ |
|||
if( parameter.ToString() == "Height" ) |
|||
_originalValue = new Dimension( double.Parse( value.ToString() ), _originalValue.Weight ); |
|||
if( parameter.ToString() == "Weight" ) |
|||
_originalValue = new Dimension( _originalValue.Height, double.Parse( value.ToString() ) ); |
|||
|
|||
} |
|||
return _originalValue; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,70 +1,89 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.CustomEditors" |
|||
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" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.CustomEditors" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
Title="Custom Editors"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates the various methods of creating and using custom editors. You can supply your own editor based on a Type, a property name, or both. To supply your own editor for a property you have to create an EditorDefinition for the PropertyGrid." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Custom Editors with a DataTemplate:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="You can override the default editors with your own custom editors with a DataTemplate. Simply define an EditorDefinition that either targets a Type, property name, or both and set the EditorDefinition.EditorTemplate to an instance of a DataTemplate. Be sure to bind your custom editor to the bound property item's Value property." TextWrapping="Wrap" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid1" Width="450" Margin="10"> |
|||
<extToolkit:PropertyGrid.EditorDefinitions> |
|||
|
|||
<!-- This EditorDefinition will provide a TextBox to any property that is of type HorizontalAlignment, replacing the default ComboBox editor. --> |
|||
<extToolkit:EditorDefinition TargetType="{x:Type HorizontalAlignment}"> |
|||
<extToolkit:EditorDefinition.EditorTemplate> |
|||
<DataTemplate> |
|||
<TextBox Background="Green" Text="{Binding Value}" /> |
|||
<!-- Always bind your editor's value to the bound property's Value --> |
|||
</DataTemplate> |
|||
</extToolkit:EditorDefinition.EditorTemplate> |
|||
</extToolkit:EditorDefinition> |
|||
|
|||
<!-- This EditorDefinition will provide a TextBlock to any property that has any of the defined property names, replacing the default editor. --> |
|||
<extToolkit:EditorDefinition> |
|||
<extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:PropertyDefinition Name="Age" /> |
|||
<extToolkit:PropertyDefinition Name="WritingFont" /> |
|||
<extToolkit:PropertyDefinition Name="Spouse" /> |
|||
</extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:EditorDefinition.EditorTemplate> |
|||
<DataTemplate> |
|||
<TextBlock Background="Yellow" Text="{Binding Value}" /> |
|||
</DataTemplate> |
|||
</extToolkit:EditorDefinition.EditorTemplate> |
|||
</extToolkit:EditorDefinition> |
|||
|
|||
<TextBlock Text="This example demonstrates the various methods of creating and using custom editors. You can supply your own editor based on a Type, a property name, or both. To supply your own editor for a property you have to create an EditorDefinition for the PropertyGrid." |
|||
TextWrapping="Wrap" /> |
|||
<!-- This EditorDefinition will provide a TextBox to any property that is of type Boolean and that has any of the defined property names, replacing the default editor. --> |
|||
<extToolkit:EditorDefinition TargetType="{x:Type sys:Boolean}"> |
|||
<extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:PropertyDefinition Name="DateOfBirth" /> |
|||
<extToolkit:PropertyDefinition Name="LastName" /> |
|||
</extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:EditorDefinition.EditorTemplate> |
|||
<DataTemplate> |
|||
<TextBox Background="Red" Text="{Binding Value}" /> |
|||
</DataTemplate> |
|||
</extToolkit:EditorDefinition.EditorTemplate> |
|||
</extToolkit:EditorDefinition> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Custom Editors with a DataTemplate:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="You can override the default editors with your own custom editors with a DataTemplate. Simply define an EditorDefinition that either targets a Type, property name, or both and set the EditorDefinition.EditorTemplate to an instance of a DataTemplate. Be sure to bind your custom editor to the bound property item's Value property." TextWrapping="Wrap"/> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid1" Width="450" Margin="10"> |
|||
<extToolkit:PropertyGrid.EditorDefinitions> |
|||
|
|||
<!-- This EditorDefinition will provide a TextBox to any property that is of type HorizontalAlignment, replacing the default ComboBox editor. --> |
|||
<extToolkit:EditorDefinition TargetType="{x:Type HorizontalAlignment}"> |
|||
<extToolkit:EditorDefinition.EditorTemplate> |
|||
<DataTemplate> |
|||
<TextBox Background="Green" Text="{Binding Value}" /> <!-- Always bind your editor's value to the bound property's Value --> |
|||
</DataTemplate> |
|||
</extToolkit:EditorDefinition.EditorTemplate> |
|||
</extToolkit:EditorDefinition> |
|||
|
|||
<!-- This EditorDefinition will provide a TextBlock to any property that has any of the defined property names, replacing the default editor. --> |
|||
<extToolkit:EditorDefinition> |
|||
<extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:PropertyDefinition Name="Age" /> |
|||
<extToolkit:PropertyDefinition Name="WritingFont" /> |
|||
<extToolkit:PropertyDefinition Name="Spouse" /> |
|||
</extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:EditorDefinition.EditorTemplate> |
|||
<DataTemplate> |
|||
<TextBlock Background="Yellow" Text="{Binding Value}" /> |
|||
</DataTemplate> |
|||
</extToolkit:EditorDefinition.EditorTemplate> |
|||
</extToolkit:EditorDefinition> |
|||
|
|||
<!-- This EditorDefinition will provide a TextBox to any property that is of type Boolean and that has any of the defined property names, replacing the default editor. --> |
|||
<extToolkit:EditorDefinition TargetType="{x:Type sys:Boolean}"> |
|||
<extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:PropertyDefinition Name="DateOfBirth" /> |
|||
<extToolkit:PropertyDefinition Name="LastName" /> |
|||
</extToolkit:EditorDefinition.PropertiesDefinitions> |
|||
<extToolkit:EditorDefinition.EditorTemplate> |
|||
<DataTemplate> |
|||
<TextBox Background="Red" Text="{Binding Value}" /> |
|||
</DataTemplate> |
|||
</extToolkit:EditorDefinition.EditorTemplate> |
|||
</extToolkit:EditorDefinition> |
|||
|
|||
</extToolkit:PropertyGrid.EditorDefinitions> |
|||
</extToolkit:PropertyGrid> |
|||
</StackPanel> |
|||
</extToolkit:PropertyGrid.EditorDefinitions> |
|||
</extToolkit:PropertyGrid> |
|||
</StackPanel> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Custom Editors with an Attribute:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="You can supply editors for a property by using the System.ComponentModel.EditorAttribute. In order to provide an editor with an attribute, the editor MUST implement the ITypeEditor interface. Your editor can be a simple class or a complex UserControl." TextWrapping="Wrap" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid2" Width="450" Margin="10"/> |
|||
</StackPanel> |
|||
</Grid> |
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Custom Editors with an Attribute:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="You can supply editors for a property by using the System.ComponentModel.EditorAttribute. In order to provide an editor with an attribute, the editor MUST implement the ITypeEditor interface. Your editor can be a simple class or a complex UserControl." TextWrapping="Wrap" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid2" Width="450" Margin="10" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,159 +1,245 @@ |
|||
using Samples.Infrastructure.Controls; |
|||
using System.ComponentModel; |
|||
using System.Collections.Generic; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Windows; |
|||
using System.Windows.Media; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Media; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for CustomEditors.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class CustomEditors : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for CustomEditors.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class CustomEditors : DemoView |
|||
{ |
|||
public CustomEditors() |
|||
{ |
|||
public CustomEditors() |
|||
{ |
|||
InitializeComponent(); |
|||
_propertyGrid1.SelectedObject = Person.CreatePerson(); |
|||
_propertyGrid2.SelectedObject = CustomAttributEditorPerson.CreateCustomAttributEditorPerson(); |
|||
} |
|||
InitializeComponent(); |
|||
_propertyGrid1.SelectedObject = Person.CreatePerson(); |
|||
_propertyGrid2.SelectedObject = CustomAttributEditorPerson.CreateCustomAttributEditorPerson(); |
|||
} |
|||
|
|||
public class Person |
|||
{ |
|||
[Category("Information")] |
|||
[DisplayName("First Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string FirstName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Last Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string LastName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Date of Birth")] |
|||
[Description("This property uses the DateTimeUpDown as the default editor.")] |
|||
public DateTime DateOfBirth { get; set; } |
|||
|
|||
[DisplayName("Grade Point Average")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double GradePointAvg { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[Description("This property uses the IntegerUpDown as the default editor.")] |
|||
public int Age { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Is Male")] |
|||
[Description("This property uses a CheckBox as the default editor.")] |
|||
public bool IsMale { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Favorite Color")] |
|||
[Description("This property uses the ColorPicker as the default editor.")] |
|||
public Color FavoriteColor { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Hand")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public HorizontalAlignment WritingHand { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public FontFamily WritingFont { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font Size")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double WritingFontSize { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[DisplayName("Pet Names")] |
|||
[Description("This property uses the PrimitiveTypeCollectionEditor as the default editor.")] |
|||
public List<String> PetNames { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[Description("This property uses the CollectionEditor as the default editor.")] |
|||
public List<Person> Friends { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[Description("This property is a complex property and has no default editor.")] |
|||
public Person Spouse { get; set; } |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime(1975, 1, 23); |
|||
person.Age = DateTime.Today.Year - person.DateOfBirth.Year; |
|||
person.GradePointAvg = 3.98; |
|||
person.IsMale = true; |
|||
person.FavoriteColor = Colors.Blue; |
|||
person.WritingHand = System.Windows.HorizontalAlignment.Right; |
|||
person.WritingFont = new FontFamily("Arial"); |
|||
person.WritingFontSize = 12.5; |
|||
person.PetNames = new List<string>() { "Pet 1", "Pet 2", "Pet 3" }; |
|||
person.Friends = new List<Person>() { new Person() { FirstName = "First", LastName = "Friend" }, new Person() { FirstName = "Second", LastName = "Friend" } }; |
|||
person.Spouse = new Person() { FirstName = "Jane", LastName = "Doe" }; |
|||
return person; |
|||
} |
|||
} |
|||
|
|||
public class CustomAttributEditorPerson |
|||
public class Person |
|||
{ |
|||
[Category( "Information" )] |
|||
[DisplayName( "First Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Last Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Date of Birth" )] |
|||
[Description( "This property uses the DateTimeUpDown as the default editor." )] |
|||
public DateTime DateOfBirth |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[DisplayName( "Grade Point Average" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double GradePointAvg |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[Description( "This property uses the IntegerUpDown as the default editor." )] |
|||
public int Age |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Is Male" )] |
|||
[Description( "This property uses a CheckBox as the default editor." )] |
|||
public bool IsMale |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Favorite Color" )] |
|||
[Description( "This property uses the ColorPicker as the default editor." )] |
|||
public Color FavoriteColor |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Hand" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public HorizontalAlignment WritingHand |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public FontFamily WritingFont |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font Size" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double WritingFontSize |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[DisplayName( "Pet Names" )] |
|||
[Description( "This property uses the PrimitiveTypeCollectionEditor as the default editor." )] |
|||
public List<String> PetNames |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property uses the CollectionEditor as the default editor." )] |
|||
public List<Person> Friends |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property is a complex property and has no default editor." )] |
|||
public Person Spouse |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime( 1975, 1, 23 ); |
|||
person.Age = DateTime.Today.Year - person.DateOfBirth.Year; |
|||
person.GradePointAvg = 3.98; |
|||
person.IsMale = true; |
|||
person.FavoriteColor = Colors.Blue; |
|||
person.WritingHand = System.Windows.HorizontalAlignment.Right; |
|||
person.WritingFont = new FontFamily( "Arial" ); |
|||
person.WritingFontSize = 12.5; |
|||
person.PetNames = new List<string>() { "Pet 1", "Pet 2", "Pet 3" }; |
|||
person.Friends = new List<Person>() { new Person() { FirstName = "First", LastName = "Friend" }, new Person() { FirstName = "Second", LastName = "Friend" } }; |
|||
person.Spouse = new Person() |
|||
{ |
|||
[Category("Information")] |
|||
[DisplayName("First Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
//This custom editor is a Class that implements the ITypeEditor interface
|
|||
[Editor(typeof(FirstNameEditor), typeof(FirstNameEditor))] |
|||
public string FirstName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Last Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
//This custom editor is a UserControl that implements the ITypeEditor interface
|
|||
[Editor(typeof(LastNameUserControlEditor), typeof(LastNameUserControlEditor))] |
|||
public string LastName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Date of Birth")] |
|||
[Description("This property uses the DateTimeUpDown as the default editor.")] |
|||
public DateTime DateOfBirth { get; set; } |
|||
|
|||
public static CustomAttributEditorPerson CreateCustomAttributEditorPerson() |
|||
{ |
|||
var person = new CustomAttributEditorPerson(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime(1975, 1, 23); |
|||
return person; |
|||
} |
|||
} |
|||
FirstName = "Jane", |
|||
LastName = "Doe" |
|||
}; |
|||
return person; |
|||
} |
|||
} |
|||
|
|||
//Custom editors that are used as attributes MUST implement the ITypeEditor interface.
|
|||
public class FirstNameEditor : Microsoft.Windows.Controls.PropertyGrid.Editors.ITypeEditor |
|||
public class CustomAttributEditorPerson |
|||
{ |
|||
public FrameworkElement ResolveEditor(Microsoft.Windows.Controls.PropertyGrid.PropertyItem propertyItem) |
|||
{ |
|||
TextBox textBox = new TextBox(); |
|||
textBox.Background = new SolidColorBrush(Colors.Red); |
|||
|
|||
//create the binding from the bound property item to the editor
|
|||
var _binding = new Binding("Value"); //bind to the Value property of the PropertyItem
|
|||
_binding.Source = propertyItem; |
|||
_binding.ValidatesOnExceptions = true; |
|||
_binding.ValidatesOnDataErrors = true; |
|||
_binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; |
|||
BindingOperations.SetBinding(textBox, TextBox.TextProperty, _binding); |
|||
return textBox; |
|||
} |
|||
[Category( "Information" )] |
|||
[DisplayName( "First Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
//This custom editor is a Class that implements the ITypeEditor interface
|
|||
[Editor( typeof( FirstNameEditor ), typeof( FirstNameEditor ) )] |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Last Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
//This custom editor is a UserControl that implements the ITypeEditor interface
|
|||
[Editor( typeof( LastNameUserControlEditor ), typeof( LastNameUserControlEditor ) )] |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Date of Birth" )] |
|||
[Description( "This property uses the DateTimeUpDown as the default editor." )] |
|||
public DateTime DateOfBirth |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public static CustomAttributEditorPerson CreateCustomAttributEditorPerson() |
|||
{ |
|||
var person = new CustomAttributEditorPerson(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime( 1975, 1, 23 ); |
|||
return person; |
|||
} |
|||
} |
|||
} |
|||
|
|||
//Custom editors that are used as attributes MUST implement the ITypeEditor interface.
|
|||
public class FirstNameEditor : Microsoft.Windows.Controls.PropertyGrid.Editors.ITypeEditor |
|||
{ |
|||
public FrameworkElement ResolveEditor( Microsoft.Windows.Controls.PropertyGrid.PropertyItem propertyItem ) |
|||
{ |
|||
TextBox textBox = new TextBox(); |
|||
textBox.Background = new SolidColorBrush( Colors.Red ); |
|||
|
|||
//create the binding from the bound property item to the editor
|
|||
var _binding = new Binding( "Value" ); //bind to the Value property of the PropertyItem
|
|||
_binding.Source = propertyItem; |
|||
_binding.ValidatesOnExceptions = true; |
|||
_binding.ValidatesOnDataErrors = true; |
|||
_binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; |
|||
BindingOperations.SetBinding( textBox, TextBox.TextProperty, _binding ); |
|||
return textBox; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,23 +1,41 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.CustomItemsSource" |
|||
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" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.CustomItemsSource" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Custom ItemsSource"> |
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="Sometimes it is desirable to want to provide a collection of values represented by a ComboBox for a given property. The PropertyGrid supports this scenario by create a class that implements IItemsSource and decorating your property with the ItemsSourceAttribute." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Providing a Custom ItemsSource:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="This example uses a collection of Doubles to represent the available options for the WritingFontSize property." TextWrapping="Wrap"/> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10"/> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="Sometimes it is desirable to want to provide a collection of values represented by a ComboBox for a given property. The PropertyGrid supports this scenario by create a class that implements IItemsSource and decorating your property with the ItemsSourceAttribute." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Providing a Custom ItemsSource:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="This example uses a collection of Doubles to represent the available options for the WritingFontSize property." TextWrapping="Wrap" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,21 +1,39 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.DefaultEditors" |
|||
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" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.DefaultEditors" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Default Editors"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates the default editors provided by the PropertyGrid." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Default Editors:" Style="{StaticResource Header}" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10"/> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="This example demonstrates the default editors provided by the PropertyGrid." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Default Editors:" Style="{StaticResource Header}" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,106 +1,180 @@ |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Windows.Media; |
|||
using System.ComponentModel; |
|||
using System.Windows; |
|||
using System.Windows.Media; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for DefaultEditors.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class DefaultEditors : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for DefaultEditors.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class DefaultEditors : DemoView |
|||
{ |
|||
public DefaultEditors() |
|||
{ |
|||
public DefaultEditors() |
|||
{ |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
|
|||
public class Person |
|||
{ |
|||
[Category( "Information" )] |
|||
[DisplayName( "First Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Last Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Date of Birth" )] |
|||
[Description( "This property uses the DateTimeUpDown as the default editor." )] |
|||
public DateTime DateOfBirth |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[DisplayName( "Grade Point Average" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double GradePointAvg |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[Description( "This property uses the IntegerUpDown as the default editor." )] |
|||
public int Age |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Is Male" )] |
|||
[Description( "This property uses a CheckBox as the default editor." )] |
|||
public bool IsMale |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Favorite Color" )] |
|||
[Description( "This property uses the ColorPicker as the default editor." )] |
|||
public Color FavoriteColor |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Hand" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public HorizontalAlignment WritingHand |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public FontFamily WritingFont |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font Size" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double WritingFontSize |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[DisplayName( "Pet Names" )] |
|||
[Description( "This property uses the PrimitiveTypeCollectionEditor as the default editor." )] |
|||
public List<String> PetNames |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property uses the CollectionEditor as the default editor." )] |
|||
public List<Person> Friends |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property is a complex property and has no default editor." )] |
|||
public Person Spouse |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public class Person |
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime( 1975, 1, 23 ); |
|||
person.Age = DateTime.Today.Year - person.DateOfBirth.Year; |
|||
person.GradePointAvg = 3.98; |
|||
person.IsMale = true; |
|||
person.FavoriteColor = Colors.Blue; |
|||
person.WritingHand = System.Windows.HorizontalAlignment.Right; |
|||
person.WritingFont = new FontFamily( "Arial" ); |
|||
person.WritingFontSize = 12.5; |
|||
person.PetNames = new List<string>() { "Pet 1", "Pet 2", "Pet 3" }; |
|||
person.Friends = new List<Person>() { new Person() { FirstName = "First", LastName = "Friend" }, new Person() { FirstName = "Second", LastName = "Friend" } }; |
|||
person.Spouse = new Person() |
|||
{ |
|||
[Category("Information")] |
|||
[DisplayName("First Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string FirstName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Last Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string LastName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Date of Birth")] |
|||
[Description("This property uses the DateTimeUpDown as the default editor.")] |
|||
public DateTime DateOfBirth { get; set; } |
|||
|
|||
[DisplayName("Grade Point Average")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double GradePointAvg { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[Description("This property uses the IntegerUpDown as the default editor.")] |
|||
public int Age { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Is Male")] |
|||
[Description("This property uses a CheckBox as the default editor.")] |
|||
public bool IsMale { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Favorite Color")] |
|||
[Description("This property uses the ColorPicker as the default editor.")] |
|||
public Color FavoriteColor { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Hand")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public HorizontalAlignment WritingHand { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public FontFamily WritingFont { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font Size")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double WritingFontSize { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[DisplayName("Pet Names")] |
|||
[Description("This property uses the PrimitiveTypeCollectionEditor as the default editor.")] |
|||
public List<String> PetNames { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[Description("This property uses the CollectionEditor as the default editor.")] |
|||
public List<Person> Friends { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[Description("This property is a complex property and has no default editor.")] |
|||
public Person Spouse { get; set; } |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime(1975, 1, 23); |
|||
person.Age = DateTime.Today.Year - person.DateOfBirth.Year; |
|||
person.GradePointAvg = 3.98; |
|||
person.IsMale = true; |
|||
person.FavoriteColor = Colors.Blue; |
|||
person.WritingHand = System.Windows.HorizontalAlignment.Right; |
|||
person.WritingFont = new FontFamily("Arial"); |
|||
person.WritingFontSize = 12.5; |
|||
person.PetNames = new List<string>() { "Pet 1", "Pet 2", "Pet 3" }; |
|||
person.Friends = new List<Person>() { new Person() { FirstName = "First", LastName = "Friend" }, new Person() { FirstName = "Second", LastName = "Friend" } }; |
|||
person.Spouse = new Person() { FirstName = "Jane", LastName = "Doe" }; |
|||
return person; |
|||
} |
|||
} |
|||
FirstName = "Jane", |
|||
LastName = "Doe" |
|||
}; |
|||
return person; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,23 +1,41 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.ExpandableProperties" |
|||
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" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.ExpandableProperties" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Exandable Properties"> |
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="Sometimes it is neccessary to show the properties of a complex object. The PropertyGrid supports this scenario and allows you to drill down into a property's heirarchy. To enable this behavior you must decorate your property with the ExpandableObject attribute." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Expandable Properties:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="In this example the Spouse property has been decorated with the ExpandableObject attribute. Notice how you can drill down into the Spouse properties." TextWrapping="Wrap" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="Sometimes it is neccessary to show the properties of a complex object. The PropertyGrid supports this scenario and allows you to drill down into a property's heirarchy. To enable this behavior you must decorate your property with the ExpandableObject attribute." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Expandable Properties:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="In this example the Spouse property has been decorated with the ExpandableObject attribute. Notice how you can drill down into the Spouse properties." TextWrapping="Wrap" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10" /> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
@ -1,62 +1,101 @@ |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.ComponentModel; |
|||
using System.Collections.Generic; |
|||
using System; |
|||
using System.Windows.Media; |
|||
using System.Windows; |
|||
using Microsoft.Windows.Controls.PropertyGrid.Attributes; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for ExpandableProperties.xaml
|
|||
/// </summary>
|
|||
public partial class ExpandableProperties : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for ExpandableProperties.xaml
|
|||
/// </summary>
|
|||
public partial class ExpandableProperties : DemoView |
|||
{ |
|||
public ExpandableProperties() |
|||
{ |
|||
public ExpandableProperties() |
|||
{ |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
|
|||
public class Person |
|||
{ |
|||
[Category( "Information" )] |
|||
[DisplayName( "First Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Last Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public FontFamily WritingFont |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font Size" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double WritingFontSize |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property is a complex property and has no default editor." )] |
|||
[ExpandableObject] |
|||
public Person Spouse |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public class Person |
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.WritingFont = new FontFamily( "Arial" ); |
|||
person.WritingFontSize = 12.5; |
|||
person.Spouse = new Person() |
|||
{ |
|||
[Category("Information")] |
|||
[DisplayName("First Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string FirstName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Last Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string LastName { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public FontFamily WritingFont { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font Size")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double WritingFontSize { get; set; } |
|||
|
|||
|
|||
[Category("Conections")] |
|||
[Description("This property is a complex property and has no default editor.")] |
|||
[ExpandableObject] |
|||
public Person Spouse { get; set; } |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.WritingFont = new FontFamily("Arial"); |
|||
person.WritingFontSize = 12.5; |
|||
person.Spouse = new Person() { FirstName = "Jane", LastName = "Doe" }; |
|||
return person; |
|||
} |
|||
} |
|||
FirstName = "Jane", |
|||
LastName = "Doe" |
|||
}; |
|||
return person; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,68 +1,87 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.HomeView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="PropertyGrid" > |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The PropertyGrid control allows you inspect and edit properties of an object. This PropertyGrid allows you do autogenerate all properties or specify the specific properties you want to display. You can use the standard editors that are provided with the PropertyGrid or you can use custom editors that target a Type, specific properties, or both. The PropertyGrid also supports complex properties, which allows you to drill down into a nested property hierarchy." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5"> |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="The PropertyGrid control allows you inspect and edit properties of an object. This PropertyGrid allows you do autogenerate all properties or specify the specific properties you want to display. You can use the standard editors that are provided with the PropertyGrid or you can use custom editors that target a Type, specific properties, or both. The PropertyGrid also supports complex properties, which allows you to drill down into a nested property hierarchy." |
|||
TextWrapping="Wrap" /> |
|||
<TextBlock Text="Display Sumary:" VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_displaySummary" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Shows/Hides the summary panel of the PropertyGrid." /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" Margin="5" > |
|||
<Grid Margin="5"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
<TextBlock Text="Filter:" VerticalAlignment="Center" Grid.Row="1" /> |
|||
<extToolkit:WatermarkTextBox x:Name="_filter" |
|||
Grid.Row="1" |
|||
Grid.Column="1" |
|||
Watermark="Search" |
|||
VerticalAlignment="Center" Margin="5" ToolTip="Filters the properties within the PropertyGrid." /> |
|||
|
|||
<TextBlock Text="Display Sumary:" VerticalAlignment="Center" /> |
|||
<CheckBox x:Name="_displaySummary" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Shows/Hides the summary panel of the PropertyGrid."/> |
|||
<TextBlock Text="Is Categorized:" VerticalAlignment="Center" Grid.Column="2" /> |
|||
<CheckBox x:Name="_isCategorized" Grid.Column="3" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the layout of the PropertyGrid." /> |
|||
|
|||
<TextBlock Text="Filter:" VerticalAlignment="Center" Grid.Row="1" /> |
|||
<extToolkit:WatermarkTextBox x:Name="_filter" Grid.Row="1" Grid.Column="1" |
|||
Watermark="Search" |
|||
VerticalAlignment="Center" Margin="5" ToolTip="Filters the properties within the PropertyGrid."/> |
|||
<TextBlock Text="Show Advanced Options:" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" /> |
|||
<CheckBox x:Name="_showAdvancedOptions" Grid.Row="1" Grid.Column="3" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Shows/Hides the advanced options menu next to a property." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<TextBlock Text="Is Categorized:" VerticalAlignment="Center" Grid.Column="2" /> |
|||
<CheckBox x:Name="_isCategorized" Grid.Column="3" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the layout of the PropertyGrid."/> |
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="To inspect an object simply set the PropertyGrid.SelectedObject property to an instance of the object you want to inspect." |
|||
TextWrapping="Wrap" /> |
|||
<Grid Height="400" Margin="10"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<TextBlock Text="Show Advanced Options:" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" /> |
|||
<CheckBox x:Name="_showAdvancedOptions" Grid.Row="1" Grid.Column="3" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Shows/Hides the advanced options menu next to a property."/> |
|||
</Grid> |
|||
</GroupBox> |
|||
<Button x:Name="_button" Height="200" Width="200" Margin="25" HorizontalAlignment="Center" VerticalAlignment="Center">Inspect Me</Button> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Usage:" Style="{StaticResource Header}" /> |
|||
<TextBlock Text="To inspect an object simply set the PropertyGrid.SelectedObject property to an instance of the object you want to inspect." |
|||
TextWrapping="Wrap"/> |
|||
<Grid Height="400" Margin="10" > |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<Button x:Name="_button" Height="200" Width="200" Margin="25" HorizontalAlignment="Center" VerticalAlignment="Center">Inspect Me</Button> |
|||
|
|||
<extToolkit:PropertyGrid Grid.Column="1" |
|||
DisplaySummary="{Binding IsChecked, ElementName=_displaySummary}" |
|||
Filter="{Binding Text, ElementName=_filter, Mode=TwoWay}" |
|||
IsCategorized="{Binding IsChecked, ElementName=_isCategorized, Mode=TwoWay}" |
|||
ShowAdvancedOptions="{Binding IsChecked, ElementName=_showAdvancedOptions}" |
|||
SelectedObject="{Binding ElementName=_button}"/> |
|||
|
|||
</Grid> |
|||
</StackPanel> |
|||
</Grid> |
|||
<extToolkit:PropertyGrid Grid.Column="1" |
|||
DisplaySummary="{Binding IsChecked, ElementName=_displaySummary}" |
|||
Filter="{Binding Text, ElementName=_filter, Mode=TwoWay}" |
|||
IsCategorized="{Binding IsChecked, ElementName=_isCategorized, Mode=TwoWay}" |
|||
ShowAdvancedOptions="{Binding IsChecked, ElementName=_showAdvancedOptions}" |
|||
SelectedObject="{Binding ElementName=_button}" /> |
|||
</Grid> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,17 +1,35 @@ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,22 +1,40 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.PropertyGrid.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.PropertyGrid.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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 Header="Editors"> |
|||
<TreeViewItem Header="Default Editors" Tag="{x:Type views:DefaultEditors}" /> |
|||
<TreeViewItem Header="Custom Editors" Tag="{x:Type views:CustomEditors}"/> |
|||
</TreeViewItem> |
|||
<TreeViewItem Header="Properties"> |
|||
<TreeViewItem Header="Binding to Structs" Tag="{x:Type views:BindingToStructs}"/> |
|||
<TreeViewItem Header="Expandable Properties" Tag="{x:Type views:ExpandableProperties}"/> |
|||
<TreeViewItem Header="Providing an ItemsSource" Tag="{x:Type views:CustomItemsSource}"/> |
|||
<TreeViewItem Header="Specifying Properties" Tag="{x:Type views:SpecifyingProperties}"/> |
|||
</TreeViewItem> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
<TreeViewItem Header="Editors"> |
|||
<TreeViewItem Header="Default Editors" Tag="{x:Type views:DefaultEditors}" /> |
|||
<TreeViewItem Header="Custom Editors" Tag="{x:Type views:CustomEditors}" /> |
|||
</TreeViewItem> |
|||
<TreeViewItem Header="Properties"> |
|||
<TreeViewItem Header="Binding to Structs" Tag="{x:Type views:BindingToStructs}" /> |
|||
<TreeViewItem Header="Expandable Properties" Tag="{x:Type views:ExpandableProperties}" /> |
|||
<TreeViewItem Header="Providing an ItemsSource" Tag="{x:Type views:CustomItemsSource}" /> |
|||
<TreeViewItem Header="Specifying Properties" Tag="{x:Type views:SpecifyingProperties}" /> |
|||
</TreeViewItem> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,30 +1,50 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.SpecifyingProperties" |
|||
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" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.PropertyGrid.Views.SpecifyingProperties" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Specifying Properties"> |
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="By default the propertyGrid will autogenerate all the properties for a given object. You can override this behavior by setting the AutoGenerateProperties property to False, and then provide a collection of PropertyDefinitions of the properties you would like to show." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Specifying Properties:" Style="{StaticResource Header}" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10" |
|||
AutoGenerateProperties="False"> |
|||
<!-- Only the following properties will be displayed in the PropertyGrid --> |
|||
<extToolkit:PropertyGrid.PropertyDefinitions> |
|||
<extToolkit:PropertyDefinition Name="FirstName" /> |
|||
<extToolkit:PropertyDefinition Name="FavoriteColor" /> |
|||
<extToolkit:PropertyDefinition Name="PetNames" /> |
|||
</extToolkit:PropertyGrid.PropertyDefinitions> |
|||
</extToolkit:PropertyGrid> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
<Grid> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="By default the propertyGrid will autogenerate all the properties for a given object. You can override this behavior by setting the AutoGenerateProperties property to False, and then provide a collection of PropertyDefinitions of the properties you would like to show." |
|||
TextWrapping="Wrap" /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Specifying Properties:" Style="{StaticResource Header}" /> |
|||
<extToolkit:PropertyGrid x:Name="_propertyGrid" |
|||
Width="450" |
|||
Margin="10" |
|||
AutoGenerateProperties="False"> |
|||
<!-- Only the following properties will be displayed in the PropertyGrid --> |
|||
<extToolkit:PropertyGrid.PropertyDefinitions> |
|||
<extToolkit:PropertyDefinition Name="FirstName" /> |
|||
<extToolkit:PropertyDefinition Name="FavoriteColor" /> |
|||
<extToolkit:PropertyDefinition Name="PetNames" /> |
|||
</extToolkit:PropertyGrid.PropertyDefinitions> |
|||
</extToolkit:PropertyGrid> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,106 +1,180 @@ |
|||
using Samples.Infrastructure.Controls; |
|||
using System.ComponentModel; |
|||
using System.Collections.Generic; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Windows.Media; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Windows; |
|||
using System.Windows.Media; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.PropertyGrid.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for SpecifyingProperties.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class SpecifyingProperties : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for SpecifyingProperties.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class SpecifyingProperties : DemoView |
|||
{ |
|||
public SpecifyingProperties() |
|||
{ |
|||
public SpecifyingProperties() |
|||
{ |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
InitializeComponent(); |
|||
_propertyGrid.SelectedObject = Person.CreatePerson(); |
|||
} |
|||
|
|||
public class Person |
|||
{ |
|||
[Category( "Information" )] |
|||
[DisplayName( "First Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Last Name" )] |
|||
[Description( "This property uses a TextBox as the default editor." )] |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Date of Birth" )] |
|||
[Description( "This property uses the DateTimeUpDown as the default editor." )] |
|||
public DateTime DateOfBirth |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[DisplayName( "Grade Point Average" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double GradePointAvg |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[Description( "This property uses the IntegerUpDown as the default editor." )] |
|||
public int Age |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Is Male" )] |
|||
[Description( "This property uses a CheckBox as the default editor." )] |
|||
public bool IsMale |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Information" )] |
|||
[DisplayName( "Favorite Color" )] |
|||
[Description( "This property uses the ColorPicker as the default editor." )] |
|||
public Color FavoriteColor |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Hand" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public HorizontalAlignment WritingHand |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font" )] |
|||
[Description( "This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values" )] |
|||
public FontFamily WritingFont |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Writing" )] |
|||
[DisplayName( "Writing Font Size" )] |
|||
[Description( "This property uses the DoubleUpDown as the default editor." )] |
|||
public double WritingFontSize |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[DisplayName( "Pet Names" )] |
|||
[Description( "This property uses the PrimitiveTypeCollectionEditor as the default editor." )] |
|||
public List<String> PetNames |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property uses the CollectionEditor as the default editor." )] |
|||
public List<Person> Friends |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
[Category( "Conections" )] |
|||
[Description( "This property is a complex property and has no default editor." )] |
|||
public Person Spouse |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public class Person |
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime( 1975, 1, 23 ); |
|||
person.Age = DateTime.Today.Year - person.DateOfBirth.Year; |
|||
person.GradePointAvg = 3.98; |
|||
person.IsMale = true; |
|||
person.FavoriteColor = Colors.Blue; |
|||
person.WritingHand = System.Windows.HorizontalAlignment.Right; |
|||
person.WritingFont = new FontFamily( "Arial" ); |
|||
person.WritingFontSize = 12.5; |
|||
person.PetNames = new List<string>() { "Pet 1", "Pet 2", "Pet 3" }; |
|||
person.Friends = new List<Person>() { new Person() { FirstName = "First", LastName = "Friend" }, new Person() { FirstName = "Second", LastName = "Friend" } }; |
|||
person.Spouse = new Person() |
|||
{ |
|||
[Category("Information")] |
|||
[DisplayName("First Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string FirstName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Last Name")] |
|||
[Description("This property uses a TextBox as the default editor.")] |
|||
public string LastName { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Date of Birth")] |
|||
[Description("This property uses the DateTimeUpDown as the default editor.")] |
|||
public DateTime DateOfBirth { get; set; } |
|||
|
|||
[DisplayName("Grade Point Average")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double GradePointAvg { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[Description("This property uses the IntegerUpDown as the default editor.")] |
|||
public int Age { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Is Male")] |
|||
[Description("This property uses a CheckBox as the default editor.")] |
|||
public bool IsMale { get; set; } |
|||
|
|||
[Category("Information")] |
|||
[DisplayName("Favorite Color")] |
|||
[Description("This property uses the ColorPicker as the default editor.")] |
|||
public Color FavoriteColor { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Hand")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public HorizontalAlignment WritingHand { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font")] |
|||
[Description("This property uses a ComboBox as the default editor. The ComboBox is auto populated with the enum values")] |
|||
public FontFamily WritingFont { get; set; } |
|||
|
|||
[Category("Writing")] |
|||
[DisplayName("Writing Font Size")] |
|||
[Description("This property uses the DoubleUpDown as the default editor.")] |
|||
public double WritingFontSize { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[DisplayName("Pet Names")] |
|||
[Description("This property uses the PrimitiveTypeCollectionEditor as the default editor.")] |
|||
public List<String> PetNames { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[Description("This property uses the CollectionEditor as the default editor.")] |
|||
public List<Person> Friends { get; set; } |
|||
|
|||
[Category("Conections")] |
|||
[Description("This property is a complex property and has no default editor.")] |
|||
public Person Spouse { get; set; } |
|||
|
|||
public static Person CreatePerson() |
|||
{ |
|||
var person = new Person(); |
|||
person.FirstName = "John"; |
|||
person.LastName = "Doe"; |
|||
person.DateOfBirth = new DateTime(1975, 1, 23); |
|||
person.Age = DateTime.Today.Year - person.DateOfBirth.Year; |
|||
person.GradePointAvg = 3.98; |
|||
person.IsMale = true; |
|||
person.FavoriteColor = Colors.Blue; |
|||
person.WritingHand = System.Windows.HorizontalAlignment.Right; |
|||
person.WritingFont = new FontFamily("Arial"); |
|||
person.WritingFontSize = 12.5; |
|||
person.PetNames = new List<string>() { "Pet 1", "Pet 2", "Pet 3" }; |
|||
person.Friends = new List<Person>() { new Person() { FirstName = "First", LastName = "Friend" }, new Person() { FirstName = "Second", LastName = "Friend" } }; |
|||
person.Spouse = new Person() { FirstName = "Jane", LastName = "Doe" }; |
|||
return person; |
|||
} |
|||
} |
|||
FirstName = "Jane", |
|||
LastName = "Doe" |
|||
}; |
|||
return person; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,26 +1,45 @@ |
|||
using System; |
|||
using Microsoft.Practices.Unity; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.Text.Views; |
|||
|
|||
namespace Samples.Modules.Text |
|||
{ |
|||
public class TextModule: ModuleBase |
|||
public class TextModule : ModuleBase |
|||
{ |
|||
public TextModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( NavigationView ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public TextModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(HomeView)); |
|||
Container.RegisterNavigationType(typeof(WatermarkTextBoxView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( HomeView ) ); |
|||
Container.RegisterNavigationType( typeof( WatermarkTextBoxView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,13 +1,34 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Text.Views.HomeView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="Text Controls"> |
|||
<Grid> |
|||
<extToolkit:TokenizedTextBox x:Name="_textBox" |
|||
DisplayMemberPath="FullName" |
|||
SearchMemberPath="FirstName" |
|||
ValueMemberPath="Id" HorizontalAlignment="Center" VerticalAlignment="Center" Width="250" /> |
|||
</Grid> |
|||
<Grid> |
|||
<extToolkit:TokenizedTextBox x:Name="_textBox" |
|||
DisplayMemberPath="FullName" |
|||
SearchMemberPath="FirstName" |
|||
ValueMemberPath="Id" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Width="250" /> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,42 +1,76 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Text.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
public HomeView() |
|||
InitializeComponent(); |
|||
|
|||
_textBox.Text = "1;2;"; //is of object ids
|
|||
_textBox.ItemsSource = new List<Email>() |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
_textBox.Text = "1;2;"; //is of object ids
|
|||
_textBox.ItemsSource = new List<Email>() |
|||
{ |
|||
new Email() { Id = 1, FirstName = "John", LastName = "Doe", EmailAddress = "john@test.com" }, |
|||
new Email() { Id = 2, FirstName = "Jane", LastName = "Doe", EmailAddress = "jane@test.com" }, |
|||
}; |
|||
} |
|||
new Email() { Id = 1, FirstName = "John", LastName = "Doe", EmailAddress = "john@test.com" }, |
|||
new Email() { Id = 2, FirstName = "Jane", LastName = "Doe", EmailAddress = "jane@test.com" }, |
|||
}; |
|||
} |
|||
|
|||
public class Email |
|||
{ |
|||
public int Id |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
public string FirstName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
public string LastName |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
public string EmailAddress |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
public class Email |
|||
public string FullName |
|||
{ |
|||
get |
|||
{ |
|||
public int Id { get; set; } |
|||
public string FirstName { get; set; } |
|||
public string LastName { get; set; } |
|||
public string EmailAddress { get; set; } |
|||
|
|||
public string FullName |
|||
{ |
|||
get |
|||
{ |
|||
return String.Format("{0}, {1}", LastName, FirstName); |
|||
} |
|||
} |
|||
return String.Format( "{0}, {1}", LastName, FirstName ); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,16 +1,34 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Text.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Text.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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 Header="WatermarkTextBox" Tag="{x:Type views:WatermarkTextBoxView}" /> |
|||
<TreeViewItem.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
<TreeViewItem Header="MaskedTextBox" /> |
|||
<TreeViewItem Header="MultiLineTextEditor" /> |
|||
<TreeViewItem Header="RichTextBox" /> |
|||
<TreeViewItem Header="WatermarkTextBox" Tag="{x:Type views:WatermarkTextBoxView}" /> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.Text.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,48 +1,66 @@ |
|||
<infControls:DemoView x:Class="Samples.Modules.Text.Views.WatermarkTextBoxView" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<infControls:DemoView x:Class="Samples.Modules.Text.Views.WatermarkTextBoxView" |
|||
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" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="WatermarkTextBox"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The WatermarkTextBox is simply a TextBox that allows you to sepcify an object, usually a String, to represent null or missing text." /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1" > |
|||
<Grid Margin="5"> |
|||
<CheckBox x:Name="_selectAll" Content="SelectAllOnGotFocus" VerticalAlignment="Center" Margin="5" ToolTip="Selects all text in the WatermarkTextBox when it receives focus." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Default:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Column="1" Margin="5" MinWidth="200" Watermark="Enter Text" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}"/> |
|||
|
|||
<TextBlock Text="Image Watermark:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Column="1" Margin="5" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}" > |
|||
<extToolkit:WatermarkTextBox.Watermark> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<Image Source="/Samples.Modules.Text;component/Images/PencilTool16.png" Stretch="None" /> |
|||
<TextBlock Text="Enter Text" Margin="4,0,0,0" /> |
|||
</StackPanel> |
|||
</extToolkit:WatermarkTextBox.Watermark> |
|||
</extToolkit:WatermarkTextBox> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Custom WatermarkTemplate:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="2" Grid.Column="1" Margin="5" Watermark="Enter Text" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}"> |
|||
<extToolkit:WatermarkTextBox.WatermarkTemplate> |
|||
<DataTemplate> |
|||
<Border BorderBrush="Green" BorderThickness="1" Padding="5" > |
|||
<ContentControl Content="{Binding}" Foreground="DarkRed" FontWeight="Bold" Focusable="False" /> |
|||
</Border> |
|||
</DataTemplate> |
|||
</extToolkit:WatermarkTextBox.WatermarkTemplate> |
|||
</extToolkit:WatermarkTextBox> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<TextBlock Text="The WatermarkTextBox is simply a TextBox that allows you to sepcify an object, usually a String, to represent null or missing text." /> |
|||
|
|||
<GroupBox Header="Features" Grid.Row="1"> |
|||
<Grid Margin="5"> |
|||
<CheckBox x:Name="_selectAll" Content="SelectAllOnGotFocus" VerticalAlignment="Center" Margin="5" ToolTip="Selects all text in the WatermarkTextBox when it receives focus." /> |
|||
</Grid> |
|||
</GroupBox> |
|||
|
|||
<StackPanel Grid.Row="2" Margin="10"> |
|||
<TextBlock Text="Default:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Column="1" Margin="5" MinWidth="200" Watermark="Enter Text" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}" /> |
|||
|
|||
<TextBlock Text="Image Watermark:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Column="1" Margin="5" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}"> |
|||
<extToolkit:WatermarkTextBox.Watermark> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<Image Source="/Samples.Modules.Text;component/Images/PencilTool16.png" Stretch="None" /> |
|||
<TextBlock Text="Enter Text" Margin="4,0,0,0" /> |
|||
</StackPanel> |
|||
</extToolkit:WatermarkTextBox.Watermark> |
|||
</extToolkit:WatermarkTextBox> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Custom WatermarkTemplate:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="2" Grid.Column="1" Margin="5" Watermark="Enter Text" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}"> |
|||
<extToolkit:WatermarkTextBox.WatermarkTemplate> |
|||
<DataTemplate> |
|||
<Border BorderBrush="Green" BorderThickness="1" Padding="5"> |
|||
<ContentControl Content="{Binding}" Foreground="DarkRed" FontWeight="Bold" Focusable="False" /> |
|||
</Border> |
|||
</DataTemplate> |
|||
</extToolkit:WatermarkTextBox.WatermarkTemplate> |
|||
</extToolkit:WatermarkTextBox> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Text.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for WatermarkTextBoxView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive=false)] |
|||
public partial class WatermarkTextBoxView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for WatermarkTextBoxView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class WatermarkTextBoxView : DemoView |
|||
{ |
|||
public WatermarkTextBoxView() |
|||
{ |
|||
public WatermarkTextBoxView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,24 +1,42 @@ |
|||
<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:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<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: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 FinishButtonClosesWindow="True"> |
|||
<extToolkit:WizardPage x:Name="IntroPage" |
|||
<Grid> |
|||
<extToolkit:Wizard FinishButtonClosesWindow="True"> |
|||
<extToolkit:WizardPage x:Name="IntroPage" |
|||
Title="Welcome to my Wizard" |
|||
Description="This Wizard will walk you though how to do something." /> |
|||
<extToolkit:WizardPage x:Name="Page1" PageType="Interior" |
|||
<extToolkit:WizardPage x:Name="Page1" PageType="Interior" |
|||
Title="Page 1" |
|||
Description="This is the first page in the process."/> |
|||
<extToolkit:WizardPage x:Name="Page2" PageType="Interior" |
|||
Description="This is the first page in the process." /> |
|||
<extToolkit:WizardPage x:Name="Page2" PageType="Interior" |
|||
Title="Page 2" |
|||
Description="This is the second page in the process"/> |
|||
<extToolkit:WizardPage x:Name="LastPage" PageType="Interior" |
|||
Description="This is the second page in the process" /> |
|||
<extToolkit:WizardPage x:Name="LastPage" PageType="Interior" |
|||
Title="Last Page" |
|||
Description="This is the last page in the process" |
|||
CanFinish="True"/> |
|||
</extToolkit:Wizard> |
|||
</Grid> |
|||
CanFinish="True" /> |
|||
</extToolkit:Wizard> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
|
|||
@ -1,18 +1,35 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Samples.Infrastructure.Controls; |
|||
|
|||
namespace Samples.Modules.Wizard.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive = false)] |
|||
public partial class HomeView : DemoView |
|||
/// <summary>
|
|||
/// Interaction logic for HomeView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime( KeepAlive = false )] |
|||
public partial class HomeView : DemoView |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
public HomeView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,11 +1,29 @@ |
|||
<TreeViewItem x:Class="Samples.Modules.Wizard.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
<!--********************************************************************* |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license |
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter. |
|||
|
|||
********************************************************************--> |
|||
<TreeViewItem x:Class="Samples.Modules.Wizard.Views.NavigationView" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
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.Resources> |
|||
<Style TargetType="views:NavigationView" BasedOn="{StaticResource {x:Type TreeViewItem}}" /> |
|||
</TreeViewItem.Resources> |
|||
|
|||
</TreeViewItem> |
|||
|
|||
@ -1,27 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
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.Wizard.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
/// <summary>
|
|||
/// Interaction logic for NavigationView.xaml
|
|||
/// </summary>
|
|||
public partial class NavigationView : TreeViewItem |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
public NavigationView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,25 +1,44 @@ |
|||
using System; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using Microsoft.Practices.Prism.Regions; |
|||
using Microsoft.Practices.Unity; |
|||
using Samples.Infrastructure; |
|||
using Samples.Infrastructure.Extensions; |
|||
using Samples.Modules.Wizard.Views; |
|||
|
|||
namespace Samples.Modules.Wizard |
|||
{ |
|||
public class WizardModule : ModuleBase |
|||
public class WizardModule : ModuleBase |
|||
{ |
|||
public WizardModule( IUnityContainer container, IRegionManager regionManager ) |
|||
: base( container, regionManager ) |
|||
{ |
|||
} |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion( RegionNames.NavigationRegion, typeof( NavigationView ) ); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
public WizardModule(IUnityContainer container, IRegionManager regionManager) |
|||
: base(container, regionManager) { } |
|||
|
|||
protected override void InitializeModule() |
|||
{ |
|||
RegionManager.RegisterViewWithRegion(RegionNames.NavigationRegion, typeof(NavigationView)); |
|||
} |
|||
|
|||
protected override void RegisterViewsAndTypes() |
|||
{ |
|||
Container.RegisterNavigationType(typeof(HomeView)); |
|||
} |
|||
Container.RegisterNavigationType( typeof( HomeView ) ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,26 +1,44 @@ |
|||
using System; |
|||
using Microsoft.Practices.Prism.Commands; |
|||
using System.Windows.Controls; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using Microsoft.Practices.Prism.Commands; |
|||
|
|||
namespace Samples.Infrastructure.Commands |
|||
{ |
|||
public class TreeViewCommandBehavior : CommandBehaviorBase<TreeView> |
|||
public class TreeViewCommandBehavior : CommandBehaviorBase<TreeView> |
|||
{ |
|||
public TreeViewCommandBehavior( TreeView treeView ) |
|||
: base( treeView ) |
|||
{ |
|||
treeView.SelectedItemChanged += SelectedItemChanged; |
|||
} |
|||
|
|||
void SelectedItemChanged( object sender, RoutedPropertyChangedEventArgs<object> e ) |
|||
{ |
|||
public TreeViewCommandBehavior(TreeView treeView) |
|||
: base(treeView) |
|||
{ |
|||
treeView.SelectedItemChanged += SelectedItemChanged; |
|||
} |
|||
|
|||
void SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) |
|||
{ |
|||
//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.
|
|||
var type = (e.NewValue as FrameworkElement).Tag as Type; |
|||
CommandParameter = type != null ? type.FullName : null; |
|||
ExecuteCommand(); |
|||
} |
|||
//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.
|
|||
var type = ( e.NewValue as FrameworkElement ).Tag as Type; |
|||
CommandParameter = type != null ? type.FullName : null; |
|||
ExecuteCommand(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,64 +1,81 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Input; |
|||
|
|||
namespace Samples.Infrastructure.Commands |
|||
{ |
|||
public class TreeViewSelected |
|||
{ |
|||
private static readonly DependencyProperty SelectedCommandBehaviorProperty = DependencyProperty.RegisterAttached("SelectedCommandBehavior", typeof(TreeViewCommandBehavior), typeof(TreeViewSelected), null); |
|||
public class TreeViewSelected |
|||
{ |
|||
private static readonly DependencyProperty SelectedCommandBehaviorProperty = DependencyProperty.RegisterAttached( "SelectedCommandBehavior", typeof( TreeViewCommandBehavior ), typeof( TreeViewSelected ), null ); |
|||
|
|||
public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached("Command", typeof(ICommand), typeof(TreeViewSelected), new PropertyMetadata(OnSetCommandCallback)); |
|||
public static void SetCommand(TreeView menuItem, ICommand command) |
|||
{ |
|||
menuItem.SetValue(CommandProperty, command); |
|||
} |
|||
public static ICommand GetCommand(TreeView menuItem) |
|||
{ |
|||
return menuItem.GetValue(CommandProperty) as ICommand; |
|||
} |
|||
public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached( "Command", typeof( ICommand ), typeof( TreeViewSelected ), new PropertyMetadata( OnSetCommandCallback ) ); |
|||
public static void SetCommand( TreeView menuItem, ICommand command ) |
|||
{ |
|||
menuItem.SetValue( CommandProperty, command ); |
|||
} |
|||
public static ICommand GetCommand( TreeView menuItem ) |
|||
{ |
|||
return menuItem.GetValue( CommandProperty ) as ICommand; |
|||
} |
|||
|
|||
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.RegisterAttached("CommandParameter", typeof(object), typeof(TreeViewSelected), new PropertyMetadata(OnSetCommandParameterCallback)); |
|||
public static void SetCommandParameter(TreeView menuItem, object parameter) |
|||
{ |
|||
menuItem.SetValue(CommandParameterProperty, parameter); |
|||
} |
|||
public static object GetCommandParameter(TreeView menuItem) |
|||
{ |
|||
return menuItem.GetValue(CommandParameterProperty); |
|||
} |
|||
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.RegisterAttached( "CommandParameter", typeof( object ), typeof( TreeViewSelected ), new PropertyMetadata( OnSetCommandParameterCallback ) ); |
|||
public static void SetCommandParameter( TreeView menuItem, object parameter ) |
|||
{ |
|||
menuItem.SetValue( CommandParameterProperty, parameter ); |
|||
} |
|||
public static object GetCommandParameter( TreeView menuItem ) |
|||
{ |
|||
return menuItem.GetValue( CommandParameterProperty ); |
|||
} |
|||
|
|||
private static void OnSetCommandCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) |
|||
{ |
|||
TreeView menuItem = dependencyObject as TreeView; |
|||
if (menuItem != null) |
|||
{ |
|||
TreeViewCommandBehavior behavior = GetOrCreateBehavior(menuItem); |
|||
behavior.Command = e.NewValue as ICommand; |
|||
} |
|||
} |
|||
private static void OnSetCommandCallback( DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e ) |
|||
{ |
|||
TreeView menuItem = dependencyObject as TreeView; |
|||
if( menuItem != null ) |
|||
{ |
|||
TreeViewCommandBehavior behavior = GetOrCreateBehavior( menuItem ); |
|||
behavior.Command = e.NewValue as ICommand; |
|||
} |
|||
} |
|||
|
|||
private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) |
|||
{ |
|||
TreeView menuItem = dependencyObject as TreeView; |
|||
if (menuItem != null) |
|||
{ |
|||
TreeViewCommandBehavior behavior = GetOrCreateBehavior(menuItem); |
|||
behavior.CommandParameter = e.NewValue; |
|||
} |
|||
} |
|||
private static void OnSetCommandParameterCallback( DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e ) |
|||
{ |
|||
TreeView menuItem = dependencyObject as TreeView; |
|||
if( menuItem != null ) |
|||
{ |
|||
TreeViewCommandBehavior behavior = GetOrCreateBehavior( menuItem ); |
|||
behavior.CommandParameter = e.NewValue; |
|||
} |
|||
} |
|||
|
|||
private static TreeViewCommandBehavior GetOrCreateBehavior(TreeView menuItem) |
|||
{ |
|||
TreeViewCommandBehavior behavior = menuItem.GetValue(SelectedCommandBehaviorProperty) as TreeViewCommandBehavior; |
|||
if (behavior == null) |
|||
{ |
|||
behavior = new TreeViewCommandBehavior(menuItem); |
|||
menuItem.SetValue(SelectedCommandBehaviorProperty, behavior); |
|||
} |
|||
private static TreeViewCommandBehavior GetOrCreateBehavior( TreeView menuItem ) |
|||
{ |
|||
TreeViewCommandBehavior behavior = menuItem.GetValue( SelectedCommandBehaviorProperty ) as TreeViewCommandBehavior; |
|||
if( behavior == null ) |
|||
{ |
|||
behavior = new TreeViewCommandBehavior( menuItem ); |
|||
menuItem.SetValue( SelectedCommandBehaviorProperty, behavior ); |
|||
} |
|||
|
|||
return behavior; |
|||
} |
|||
return behavior; |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,118 +1,154 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.IO; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.IO; |
|||
|
|||
namespace Samples.Infrastructure.Controls |
|||
{ |
|||
public class DemoView : ContentControl |
|||
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() |
|||
{ |
|||
#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
|
|||
_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
|
|||
} |
|||
} |
|||
|
|||
@ -1,43 +1,58 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows.Data; |
|||
using Samples.Infrastructure.Core.CodeFormatting; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Media; |
|||
using Samples.Infrastructure.Core.CodeFormatting; |
|||
|
|||
namespace Samples.Infrastructure.Converters |
|||
{ |
|||
public class CSharpColorConverter : IValueConverter |
|||
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 ) |
|||
{ |
|||
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(); |
|||
} |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,121 +1,139 @@ |
|||
using System; |
|||
/************************************************************************ |
|||
|
|||
Extended WPF Toolkit |
|||
|
|||
Copyright (C) 2010-2012 Xceed Software Inc. |
|||
|
|||
This program is provided to you under the terms of the Microsoft Reciprocal |
|||
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|||
|
|||
This program can be provided to you by Xceed Software Inc. under a |
|||
proprietary commercial license agreement for use in non-Open Source |
|||
projects. The commercial version of Extended WPF Toolkit also includes |
|||
priority technical support, commercial updates, and many additional |
|||
useful WPF controls if you license Xceed Business Suite for WPF. |
|||
|
|||
Visit http://xceed.com and follow @datagrid on Twitter.
|
|||
|
|||
**********************************************************************/ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Media; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Media; |
|||
using Samples.Infrastructure.Core.CodeFormatting; |
|||
|
|||
namespace Samples.Infrastructure.Converters |
|||
{ |
|||
public class XamlColorConverter : IValueConverter |
|||
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 ) |
|||
{ |
|||
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
|
|||
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
|
|||
} |
|||
} |
|||
|
|||
@ -1,351 +1,350 @@ |
|||
//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 |
|||
// 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 ) |
|||
{ |
|||
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); |
|||
} |
|||
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 |
|||
{ |
|||
XmlToken token = new XmlToken(XmlTokenKind.CommentText, tokenend - position); |
|||
position = tokenend; |
|||
return token; |
|||
} |
|||
} |
|||
return TokenizeSimple( "<", XmlTokenKind.Open, XmlTokenizerMode.AfterOpen ); |
|||
} |
|||
|
|||
// Used so you can restart the tokenizer for the next line of XML
|
|||
enum XmlTokenizerMode |
|||
private XmlToken TokenizeEntity() |
|||
{ |
|||
InsideComment, |
|||
InsideProcessingInstruction, |
|||
AfterOpen, |
|||
AfterAttributeName, |
|||
AfterAttributeEquals, |
|||
InsideElement, |
|||
// after element name, before attribute or />
|
|||
OutsideElement, |
|||
InsideCData |
|||
Debug.Assert( mode == XmlTokenizerMode.OutsideElement ); |
|||
Debug.Assert( input[ position ] == '&' ); |
|||
XmlToken token = new XmlToken( XmlTokenKind.Entity, input.IndexOf( ';', position ) - position ); |
|||
position += token.Length; |
|||
return token; |
|||
} |
|||
|
|||
struct XmlToken |
|||
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() |
|||
{ |
|||
public XmlTokenKind Kind; |
|||
public short Length; |
|||
public XmlToken(XmlTokenKind kind, int length) |
|||
{ |
|||
Kind = kind; |
|||
Length = (short)length; |
|||
} |
|||
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; |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* 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 |
|||
// 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 ) |
|||
{ |
|||
Open, |
|||
// <
|
|||
Close, |
|||
//>
|
|||
SelfClose, |
|||
// />
|
|||
OpenClose, |
|||
// </
|
|||
ElementName, |
|||
ElementWhitespace, |
|||
//whitespace between attributes
|
|||
AttributeName, |
|||
Equals, |
|||
// inside attribute
|
|||
AttributeValue, |
|||
// attribute value
|
|||
CommentBegin, |
|||
// <!--
|
|||
CommentText, |
|||
CommentEnd, |
|||
// -->
|
|||
Entity, |
|||
// >
|
|||
OpenProcessingInstruction, |
|||
// <?
|
|||
CloseProcessingInstruction, |
|||
// ?>
|
|||
CDataBegin, |
|||
// <![CDATA[
|
|||
CDataEnd, |
|||
// ]]>
|
|||
TextContent, |
|||
//WhitespaceContent, // text content that's whitespace. Space is embedded inside
|
|||
EOF, |
|||
// end of file
|
|||
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, |
|||
// >
|
|||
OpenProcessingInstruction, |
|||
// <?
|
|||
CloseProcessingInstruction, |
|||
// ?>
|
|||
CDataBegin, |
|||
// <![CDATA[
|
|||
CDataEnd, |
|||
// ]]>
|
|||
TextContent, |
|||
//WhitespaceContent, // text content that's whitespace. Space is embedded inside
|
|||
EOF, |
|||
// end of file
|
|||
} |
|||
} |
|||
|
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue