728x90
728x170
▶ XML
<Window
x:Class="HowToNavigateBetweenViewsViaFrameNavigationService.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:local="clr-namespace:HowToNavigateBetweenViewsViaFrameNavigationService"
Title="FrameNavigationService"
Width="600"
Height="450">
<Window.DataContext>
<local:MainViewModel />
</Window.DataContext>
<dxm:Interaction.Triggers>
<dxm:EventToCommand EventName="Loaded" Command="{Binding WindowLoadedCommand}" />
</dxm:Interaction.Triggers>
...
</Window>
728x90
▶ C#
/// <summary>
/// 메인 뷰 모델
/// </summary>
public class MainViewModel : ViewModelBase
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Property
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 윈도우 로드시 명령 - WindowLoadedCommand
/// <summary>
/// 윈도우 로드시 명령
/// </summary>
public ICommand WindowLoadedCommand { get; private set; }
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainViewModel()
/// <summary>
/// 생성자
/// </summary>
public MainViewModel()
{
WindowLoadedCommand = new DelegateCommand(OnWindowLoadedCommandExecute);
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
#region 윈도우 로드시 명령 실행시 처리하기 - OnWindowLoadedCommandExecute()
/// <summary>
/// 윈도우 로드시 명령 실행시 처리하기
/// </summary>
private void OnWindowLoadedCommandExecute()
{
ServiceContainer.GetService<INavigationService>().Navigate("HomeView", null, this);
}
#endregion
}
728x90
그리드형(광고전용)
'DevExpress > WPF' 카테고리의 다른 글
[DEVEXPRESS/WPF] SpinEdit 엘리먼트 사용하기 (0) | 2014.03.13 |
---|---|
[DEVEXPRESS/WPF] DataViewBase 클래스 : MoveColumnTo 메소드를 사용해 컬럼 이동하기 (0) | 2014.03.13 |
[DEVEXPRESS/WPF] DXWindow 클래스 : 레이아웃 설정 로드하기/저장하기 (0) | 2014.03.13 |
[DEVEXPRESS/WPF] ThemeManager 클래스 : ApplicationThemeName 속성을 사용해 테마 설정하기 (0) | 2014.03.13 |
[DEVEXPRESS/WPF] ViewModelExtensions 클래스 : Parameter 첨부 속성을 사용해 뷰 모델 간 데이터 공유하기 (0) | 2014.03.13 |
[DEVEXPRESS/WPF] DXSplashScreenService 엘리먼트 사용하기 (0) | 2014.03.12 |
[DEVEXPRESS/WPF] DialogService 엘리먼트 사용하기 (0) | 2014.03.12 |
[DEVEXPRESS/WPF] DelegateCommand 클래스 사용하기 (0) | 2014.03.12 |
[DEVEXPRESS/WPF] BindableBase 클래스 사용하기 (0) | 2014.03.12 |
[DEVEXPRESS/WPF] CheckEdit 엘리먼트 사용하기 (0) | 2014.03.12 |