ho Window
e tre UserControl
nel mio progetto, ho un controllo che mostrano UserControl in séaccesso al controllo della finestra principale in UserControl
<Window x:Class="Hesabdar.winMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pageTransitions="clr-namespace:WpfPageTransitions;assembly=WpfPageTransitions"
Title="winMain" Height="500" Width="600" Loaded="Window_Loaded_1">
<Grid>
<pageTransitions:PageTransition Name="pageTransitionControl" TransitionType="SlideAndFade" />
</Grid>
</Window>
e UserControl
ho Button
:
<UserControl x:Class="Hesabdar.ucMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Height="500" Width="600">
<Grid>
<Button Content="Manege" HorizontalAlignment="Left" Margin="391,163,0,0" Click="Button_Click_1"/>
</Grid>
</UserControl>
Com'è possibile controllareda UserControl
per navigare pageTransitionControl
per altro userControl
Edit:
Codice Dietro di MainWindow:
ucMain objUC = new ucMain(); //Declare Instance Of user Control
pageTransitionControl.ShowPage(objUC); // Show Instance of usercontrol in PageTransitionControl
Proprio voglio correre il metodo ShowPage
di pageTransitionControl
in MainWindow dal click del tasto che è in UserControl
.
Dai uno sguardo alla risposta che ho dato alla mia domanda in questa discussione: http://stackoverflow.com/questions/17059120/change-wpf-usercontrol-depending-on-a-property-of-a-treeviewitem –
sembra che il mio obiettivo è diverso da tu, Maggiori informazioni Aggiunto @Romano Zumbé – Moslem7026