this is my ChildWindow xaml code:
1 <Grid x:Name="LayoutRoot">
2 <Grid x:Name="teste">
3 <Grid.ColumnDefinitions>
4 <ColumnDefinition Width="*"/>
5 <ColumnDefinition Width="*"/>
6 </Grid.ColumnDefinitions>
7 <Grid.RowDefinitions>
8 <RowDefinition />
9 <RowDefinition Height="Auto" />
10 </Grid.RowDefinitions>
11 <local:UserControl1 Grid.Row="0" Grid.ColumnSpan="2"/>
12 </Grid>
13 </Grid>
This is my UserControl1 xaml code:
1 <Grid x:Name="LayoutRoot" Background="#FFA34444">
2 <Button Click="Child_Close" Content="Cancel">
3 </Grid>
This is my UserControl C#:
private void Child_Close(object sender, System.Windows.RoutedEventArgs e)
{
ChildWindow cw = (ChildWindow)this.Parent;
cw.Close();
}
Trying this way doesn't work. Any Idea?
Tks Josi