Exemplo n.º 1
0
        public RenderSettingsWindow(RenderSettingsWindowViewModel viewModel)
        {
            InitializeComponent();

            this.viewModel = viewModel;
            DataContext    = this.viewModel;
        }
Exemplo n.º 2
0
        private void RenderSettings_Click(object sender, RoutedEventArgs e)
        {
            var windowViewModel = new RenderSettingsWindowViewModel(RenderSettings.Instance);

            windowViewModel.PropertyChanged += (s, e) =>
            {
                windowViewModel.SetValues(RenderSettings.Instance);
                RenderFrameIfNeeded();
            };

            var window = new RenderSettingsWindow(windowViewModel);

            window.Show();
        }
Exemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = viewModel;
            viewModel   = new MainWindowViewModel(new ViewportRenderer(glViewport));
            DataContext = viewModel;

            // Link view models to models.
            renderSettingsViewModel = RenderSettings.Instance;
            renderSettingsViewModel.PropertyChanged += (s, e) => RenderSettings.Instance.SetValues(renderSettingsViewModel);

            cameraSettingsViewModel = viewModel.Renderer.Camera;
            cameraSettingsViewModel.PropertyChanged += CameraSettingsViewModel_PropertyChanged;

            viewModel.PropertyChanged += ViewModel_PropertyChanged;
        }