Browse Source

Starting to work on the styling of the Wizard control and WizardPages

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
a211507f8d
  1. 1
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj
  2. 7
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/WizardPage.cs
  3. 11
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/WizardPageType.cs
  4. 49
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Themes/Generic.xaml

1
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/WPFToolkit.Extended.csproj

@ -289,6 +289,7 @@
<Compile Include="Wizard\Implementation\WizardPage.cs" /> <Compile Include="Wizard\Implementation\WizardPage.cs" />
<Compile Include="Wizard\Implementation\Wizard.cs" /> <Compile Include="Wizard\Implementation\Wizard.cs" />
<Compile Include="Wizard\Implementation\WizardPageButtonVisibility.cs" /> <Compile Include="Wizard\Implementation\WizardPageButtonVisibility.cs" />
<Compile Include="Wizard\Implementation\WizardPageType.cs" />
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>

7
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/WizardPage.cs

@ -92,6 +92,13 @@ namespace Microsoft.Windows.Controls
set { SetValue(NextPageProperty, value); } set { SetValue(NextPageProperty, value); }
} }
public static readonly DependencyProperty PageTypeProperty = DependencyProperty.Register("PageType", typeof(WizardPageType), typeof(WizardPage), new UIPropertyMetadata(WizardPageType.Interior));
public WizardPageType PageType
{
get { return (WizardPageType)GetValue(PageTypeProperty); }
set { SetValue(PageTypeProperty, value); }
}
public static readonly DependencyProperty PreviousPageProperty = DependencyProperty.Register("PreviousPage", typeof(WizardPage), typeof(WizardPage), new UIPropertyMetadata(null)); public static readonly DependencyProperty PreviousPageProperty = DependencyProperty.Register("PreviousPage", typeof(WizardPage), typeof(WizardPage), new UIPropertyMetadata(null));
public WizardPage PreviousPage public WizardPage PreviousPage
{ {

11
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/WizardPageType.cs

@ -0,0 +1,11 @@
using System;
namespace Microsoft.Windows.Controls
{
public enum WizardPageType
{
Blank,
Exterior,
Interior
}
}

49
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Themes/Generic.xaml

@ -6,6 +6,9 @@
<coreConverters:WizardPageButtonVisibilityConverter x:Key="WizardPageButtonVisibilityConverter" /> <coreConverters:WizardPageButtonVisibilityConverter x:Key="WizardPageButtonVisibilityConverter" />
<Style TargetType="{x:Type local:Wizard}"> <Style TargetType="{x:Type local:Wizard}">
<Setter Property="Background" Value="#F0F0F0" />
<Setter Property="BorderBrush" Value="#A0A0A0" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="ItemsPanel"> <Setter Property="ItemsPanel">
<Setter.Value> <Setter.Value>
<ItemsPanelTemplate> <ItemsPanelTemplate>
@ -25,7 +28,8 @@
<ContentPresenter Content="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}}" /> <ContentPresenter Content="{Binding CurrentPage, RelativeSource={RelativeSource TemplatedParent}}" />
<StackPanel Background="{TemplateBinding Background}" Grid.Row="1" Margin="7"> <Border Grid.Row="1" Background="#F0F0F0" BorderBrush="#A0A0A0" BorderThickness="0,1,0,0" Padding="7" >
<StackPanel Background="{TemplateBinding Background}">
<Grid Margin="{TemplateBinding Padding}"> <Grid Margin="{TemplateBinding Padding}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@ -85,6 +89,7 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
</StackPanel> </StackPanel>
</Border>
</Grid> </Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
@ -92,30 +97,58 @@
</Setter> </Setter>
</Style> </Style>
<Style TargetType="{x:Type local:WizardPage}"> <ControlTemplate x:Key="BlankWizardPageTemplate" TargetType="{x:Type local:WizardPage}">
<Setter Property="Template"> <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Setter.Value> <Grid Background="{TemplateBinding Background}">
<ControlTemplate TargetType="{x:Type local:WizardPage}"> <ContentPresenter Margin="14" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
</Grid>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="ExteriorWizardPageTemplate" TargetType="{x:Type local:WizardPage}">
<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter Margin="14" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
</Grid>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="InteriorWizardPageTemplate" TargetType="{x:Type local:WizardPage}">
<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Name="PART_Header" >
<Grid Name="PART_Header">
<StackPanel Grid.Column="0"> <StackPanel Grid.Column="0">
<TextBlock Margin="16,9,0,1" TextWrapping="Wrap" FontWeight="Bold" Text="{TemplateBinding Title}" /> <TextBlock Margin="16,9,0,1" TextWrapping="Wrap" FontWeight="Bold" Text="{TemplateBinding Title}" />
<TextBlock Margin="32,0,0,3" TextWrapping="Wrap" Text="{TemplateBinding Description}" /> <TextBlock Margin="32,0,0,3" TextWrapping="Wrap" Text="{TemplateBinding Description}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
<Border Grid.Row="1" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> <Border Grid.Row="1" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<Grid Background="{TemplateBinding Background}"> <Grid Background="{TemplateBinding Background}">
<ContentPresenter Margin="14" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" /> <ContentPresenter Margin="14" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter.Value>
</Setter> <Style TargetType="{x:Type local:WizardPage}">
<Style.Triggers>
<Trigger Property="PageType" Value="Blank">
<Setter Property="Template" Value="{StaticResource BlankWizardPageTemplate}" />
</Trigger>
<Trigger Property="PageType" Value="Exterior">
<Setter Property="Template" Value="{StaticResource ExteriorWizardPageTemplate}" />
</Trigger>
<Trigger Property="PageType" Value="Interior">
<Setter Property="Template" Value="{StaticResource InteriorWizardPageTemplate}" />
</Trigger>
</Style.Triggers>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>
Loading…
Cancel
Save