public MainViewModel()
 {            // titles
     this.Title = "DynamicTexture Demo";
     this.SubTitle = "WPF & SharpDX";
     EffectsManager = new DefaultEffectsManager();
     RenderTechnique = EffectsManager[DefaultRenderTechniqueNames.Blinn];
     this.Camera = new HelixToolkit.Wpf.SharpDX.PerspectiveCamera
     {
         Position = new Point3D(30, 30, 30),
         LookDirection = new Vector3D(-30, -30, -30),
         UpDirection = new Vector3D(0, 1, 0)
     };
     this.Light1Color = Colors.White;
     this.Light1Direction = new Vector3D(-10, -10, -10);
     this.AmbientLightColor = Colors.DimGray;
     SetupCameraBindings(this.Camera);
     LineColor = Colors.Blue;
     Items = new ObservableCollection<DataModel>();
     var sw = Stopwatch.StartNew();
     CreateDefaultModels();
     sw.Stop();
     Console.WriteLine("Create Models total time =" + sw.ElapsedMilliseconds + " ms");
     timer = new DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(50);
     timer.Tick += Timer_Tick;
     AddModelCommand = new RelayCommand(AddModel);
     RemoveModelCommand = new RelayCommand(RemoveModel);
     ClearModelCommand = new RelayCommand(ClearModel);
     AutoTestCommand = new RelayCommand(AutoTestAddRemove);
     MultiViewportCommand = new RelayCommand((o) => 
     {
         var win = new MultiviewportWin() { DataContext = this };
         win.Show();
     });
 }
Example #2
0
        public MainViewModel()
        {            // titles
            this.Title              = "DynamicTexture Demo";
            this.SubTitle           = "WPF & SharpDX";
            RenderTechniquesManager = new DefaultRenderTechniquesManager();
            RenderTechnique         = RenderTechniquesManager.RenderTechniques[DefaultRenderTechniqueNames.Blinn];
            EffectsManager          = new DefaultEffectsManager(RenderTechniquesManager);
            this.Camera             = new HelixToolkit.Wpf.SharpDX.PerspectiveCamera
            {
                Position      = new Media3D.Point3D(30, 30, 30),
                LookDirection = new Media3D.Vector3D(-30, -30, -30),
                UpDirection   = new Media3D.Vector3D(0, 1, 0)
            };
            this.Light1Color       = (Color4)Color.White;
            this.Light1Direction   = new Vector3(-10, -10, -10);
            this.AmbientLightColor = new Color4(0.2f, 0.2f, 0.2f, 1.0f);
            SetupCameraBindings(this.Camera);
            this.PropertyChanged += MainViewModel_PropertyChanged;

            LineColor = Color.Blue;
            Items     = new ObservableCollection <DataModel>();
            var sw = Stopwatch.StartNew();

            CreateDefaultModels();
            sw.Stop();
            Console.WriteLine("Create Models total time =" + sw.ElapsedMilliseconds + " ms");

            AddModelCommand      = new RelayCommand(AddModel);
            RemoveModelCommand   = new RelayCommand(RemoveModel);
            ClearModelCommand    = new RelayCommand(ClearModel);
            AutoTestCommand      = new RelayCommand(AutoTestAddRemove);
            MultiViewportCommand = new RelayCommand((o) =>
            {
                var win = new MultiviewportWin()
                {
                    DataContext = this
                };
                win.Show();
            });
        }