Error in binding usercontrol to Mainwindow

Wizard for WPF Forum

Posted 11 years ago by bhanu
Avatar
Hi,
Iam New to WPFControls.Iam using WizardControl in my application.In my application First iam using BlankPage for that Iam using UserControl and written code Like:
<UserControl
x:Class="SampleAuditioner.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="namespace:SampleAuditioner;assembly=mscorlib"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:wizard="http://schemas.actiprosoftware.com/winfx/xaml/wizard"
>
<UserControl.Resources >

</UserControl.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Border Width="600" Height="450" BorderBrush="Gray" BorderThickness="1">
<wizard:Wizard x:Name="wizard" BackButtonText="Back" BackButtonEnabled ="False" NextButtonText="Next" NextButtonVisible="True" NextButtonEnabled="True" CancelButtonText="Cancel" CancelButtonVisible="True" CancelButtonEnabled="True" FinishButtonVisible="False" HelpButtonVisible="False" PageSequenceType="Stack" ForceCursor="False">
<wizard:WizardPage x:Name="customPage" PageType="Blank" NextPage="finishPage"
Caption="Welcome To">
<Grid ClipToBounds="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="532.169*" />
<ColumnDefinition Width="65.831*" />
</Grid.ColumnDefinitions>
<Rectangle Grid.ColumnSpan="2">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#B3CDED" />
<GradientStop Offset="0.75" Color="#6A8EBD" />
<GradientStop Offset="1" Color="#79A1D9" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Ellipse Fill="#6A8EBD" Opacity="0.15" Grid.ColumnSpan="2">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X="-100" Y="-10" />
<ScaleTransform ScaleX="3" ScaleY="3" />
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
<Ellipse Fill="#6A8EBD" Opacity="0.15" Grid.ColumnSpan="2">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X="-100" Y="-10" />
<ScaleTransform ScaleX="3" ScaleY="2.2" />
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
<shared:DropShadowChrome Margin="70,40,4.169,40" Color="#71000000">
<Border x:Name="customPageBorder" BorderBrush="Black" BorderThickness="1">
<StackPanel Background="White">
<TextBlock Margin="14" FontFamily="Cambria" FontSize="14pt" FontWeight="Bold" Foreground="#365F91" TextWrapping="Wrap" Text="{Binding ElementName=customPage, Path=Caption}" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
<TextBlock Margin="14,0,14,0" FontFamily="Calibri" FontSize="12pt" TextWrapping="Wrap">
The Auditioner
<LineBreak />
<LineBreak />
The Auditioner is the first interactive software progrm spcifically
Designed to help film.
<LineBreak />
<LineBreak />
</TextBlock >
<TextBlock Margin="10,0,10,0" FontFamily="Calibri" FontSize="12" TextWrapping="Wrap" Width="332.189" HorizontalAlignment="Center" TextDecorations="None">
The Actor's ToolBox Software series.
<LineBreak />
</TextBlock>
</StackPanel>
</Border>
</shared:DropShadowChrome>
</Grid>
</wizard:WizardPage>
</wizard:Wizard>
</Border>
</ScrollViewer>
</UserControl>

Iam using same Namespace .and i wrote code in MainWindow like :

<Window x:Class="SampleAuditioner.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:wizard="http://schemas.actiprosoftware.com/winfx/xaml/wizard"
xmlns:SampleAuditioner="clr-namespace:SampleAuditioner"
Title="SampleAuditionerWindow" Height="800" Width="800" SizeToContent="Height" ResizeMode="CanResize" >
<SampleAuditioner:UserControl1 ></SampleAuditioner:UserControl1>

</Window>
But it is not woking.how to bind UserControl to Mainwindow.Please give Reply to me

[Modified at 08/26/2008 06:41 AM]

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It's hard to say without having a sample project to look at. The XAML looks ok at a glance.

Still the core question of how to put a UserControl in a Window is one that would better asked in the Microsoft WPF forums. The content of the UserControl, in this case Wizard, could be something simpler like a WPF Button and it sounds like you would still have the issue based on your description if I understand correctly.

The Microsoft WPF forums are here:
http://forums.msdn.microsoft.com/en-US/wpf/threads/

[Modified at 08/26/2008 03:08 PM]


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.