내 프로젝트에 Window
세 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>
에 UserControl을을 표시하고 UserControl
에 내가 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>
제어 방법은 무엇입니까 pageTransitionControl
에서 UserControl
로 이동하려면 pageTransitionControl
을 userControl
편집 : MainWindow를의 뒤에
코드 :
ucMain objUC = new ucMain(); //Declare Instance Of user Control
pageTransitionControl.ShowPage(objUC); // Show Instance of usercontrol in PageTransitionControl
그냥 내가
UserControl
에있는 버튼을 클릭에서 MainWindow를에 방법을
pageTransitionControl
의
ShowPage
를 실행하려면.
이 스레드에서 내 질문에 준 대답을보십시오 : http://stackoverflow.com/questions/17059120/change-wpf-usercontrol-depending-on-a-property-of-a-treeviewitem –
것 같습니다 내 목표가 너, More Info Added @Romano Zumbé – Moslem7026