Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: Wizard Go To Custom Page With Command [20826]

$
0
0
hi

i am using wizard control with any button in intro page

how to click on button and go to custom page in mvvm and command binding ?

example:Customer Button Go To customer Page




```
<xceedtoolkit:Wizard FinishButtonClosesWindow="True">
<xceedtoolkit:WizardPage x:Name="IntroPage" Title="please select Icons Or Select Next Button To Custom Page "
>

<xceedtoolkit:WizardPage.ExteriorPanelContent>
<Grid>
<Grid.RowDefinitions>
<RowDefinition>

</RowDefinition>
<RowDefinition>

</RowDefinition>
</Grid.RowDefinitions>
<!--<Image Source="../Images/Wizard/Wizard_Title.png"></Image>
<Image Grid.Row="1" Source="../Images/Wizard/Wizard_Start.png"></Image>-->
</Grid>
</xceedtoolkit:WizardPage.ExteriorPanelContent>

<xceedtoolkit:WizardPage.ContentTemplate>
<ItemContainerTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>


</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200*"/>
<ColumnDefinition Width="200*"/>
<ColumnDefinition Width="200*"/>
<ColumnDefinition Width="200*"/>
<ColumnDefinition Width="200*"/>
<ColumnDefinition Width="200*"/>


</Grid.ColumnDefinitions>

<Button >
<Button.ContentTemplate>
<ItemContainerTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="../Images/Wizard/Person.png"></Image>
<TextBlock Grid.Row="1" Text="Customers"></TextBlock>
</Grid>
</ItemContainerTemplate>
</Button.ContentTemplate>
</Button>
<Button Grid.Column="1">
<Button.ContentTemplate>
<ItemContainerTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="../Images/Wizard/Check.png"></Image>
<TextBlock Grid.Row="1" Text="Check"></TextBlock>
</Grid>
</ItemContainerTemplate>
</Button.ContentTemplate>
</Button>
<Button Grid.Column="2">
<Button.ContentTemplate>
<ItemContainerTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="../Images/Wizard/Store.png"></Image>
<TextBlock Grid.Row="1" Text="Store"></TextBlock>
</Grid>
</ItemContainerTemplate>
</Button.ContentTemplate>
</Button>
<Button Grid.Column="3">
<Button.ContentTemplate>
<ItemContainerTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="../Images/Wizard/Product.png"></Image>
<TextBlock Grid.Row="1" Text="Product"></TextBlock>
</Grid>
</ItemContainerTemplate>
</Button.ContentTemplate>
</Button>
</Grid>
</ItemContainerTemplate>
</xceedtoolkit:WizardPage.ContentTemplate>
<xceedtoolkit:WizardPage.ExteriorPanelBackground>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF8193FC" Offset="0" />
<GradientStop Color="White" Offset="1" />
</LinearGradientBrush>
</xceedtoolkit:WizardPage.ExteriorPanelBackground>
</xceedtoolkit:WizardPage>
<xceedtoolkit:WizardPage x:Name="CustomerPage" PageType="Exterior"
Title="Customers"
Description="This is the customer page in the process." />
<xceedtoolkit:WizardPage x:Name="CheckPage" PageType="Exterior"
Title="Checks"
Description="This is the second page in the process" />
<xceedtoolkit:WizardPage x:Name="StorePage" PageType="Exterior"
Title="Store"
Description="This is the store page in the process"
/>

<xceedtoolkit:WizardPage x:Name="ProductPage" PageType="Exterior"
Title="Products"
Description="This is the product page in the process"
CanFinish="True" />

</xceedtoolkit:Wizard>
```
Comments: ** Comment from web user: BoucherS **

Hi,
Here's an idea for the Store Button:

In XAML, set the button's command :
```
Command="local:MainWindow.StoreCommand"
```

In Code-Behind :
```
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.CreateStoreCommand();
}

private static RoutedCommand _storeCommand = new RoutedCommand();
public static RoutedCommand StoreCommand
{
get{ return _storeCommand; }
}

private void CreateStoreCommand()
{
CommandBindings.Add( new CommandBinding( MainWindow.StoreCommand, this.StoreExecute, this.CanExecuteStoreCommand ) );
}

private void CanExecuteStoreCommand( object sender, CanExecuteRoutedEventArgs e )
{
e.CanExecute = true;
}

public void StoreExecute( object sender, ExecutedRoutedEventArgs e )
{
WizardPage sourcePage = e.Source as WizardPage;
if( sourcePage != null )
{
Wizard wizard = sourcePage.Parent as Wizard;
if( wizard != null )
{
wizard.CurrentPage = wizard.Items[ 3 ] as WizardPage;
}
}
}
}
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>