Beispiel #1
0
        public MyViewModel()
        {
            // Initializes the Coordinate System Icon for the data binding.
            MyCoordinateSystemIcon = new CoordinateSystemIcon();

            // Initializes the Origin Symbol for the data binding.
            MyOriginSymbol = OriginSymbol.GetDefaultOriginSymbol();
            OsStyleType    = originSymbolStyleType.Ball;

            // Initializes the Grids collection for the data binding.
            Grid grid = new Grid()
            {
                Step = 10, MajorLinesEvery = 4
            };

            MyGrids = new ObservableCollection <Grid> {
                grid
            };

            // Initializes the ToolBar for the data binding.
            MyToolBars = new ObservableCollection <ToolBar>(new List <ToolBar>()
            {
                ToolBar.GetDefaultToolBar()
            });
            MyToolBar.Position = ToolBar.positionType.HorizontalTopCenter;
            // Uses toolbar buttons count info to enable/disable the Add/Remove buttons
            _buttonsCount = MyToolBar.Buttons.Count;
            // Creates the command for the the Add/Remove buttons
            CreateAddToolbarButtonCommand();
            CreateRemoveToolbarButtonCommand();

            // Initializes the BackgroundSettings for the the data binding.
            MyBackgroundSettings = new BackgroundSettings(backgroundStyleType.Solid, Helper.ConvertColor("#FF434752"), System.Drawing.Color.White, Helper.ConvertColor("#FFEDEDED"), .75, null);

            // Sets the ViewModel's BackgroundStyle: in this way the "Background" comboboxes will be updated too.
            BackgroundStyle = MyBackgroundSettings.StyleMode;


            // Initializes the Background images.
            MyBackgroundSettings.Image = Image1 = RenderContextUtility.ConvertImage(new Bitmap(Pictures + "background1.jpg"));
            Image2 = RenderContextUtility.ConvertImage(new Bitmap(Pictures + "background2.jpg"));
            Image3 = RenderContextUtility.ConvertImage(new Bitmap(Pictures + "background3.jpg"));

            // Initializes the Images for the ViewCube buttons.
            VcResetImages = ViewCubeIcon.GetDefaultViewCubeIcon().FrontImage;
            VcImage1      = RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Front.jpg"));
            VcImage2      = RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Noel_Front.jpg"));

            // Initializes the EntitiList collection for the the data binding.
            _entityList = new MyEntityList();
        }
Beispiel #2
0
 private void BtnVcImage1_OnChecked(object sender, RoutedEventArgs e)
 {
     if (_myViewModel != null)
     {
         _myViewModel.VcFaceImages = new ImageSource[] {
             RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Front.jpg")),
             RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Back.jpg")),
             RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Top.jpg")),
             RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Bottom.jpg")),
             RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Left.jpg")),
             RenderContextUtility.ConvertImage(new Bitmap(Pictures + "Spongebob_Right.jpg"))
         }
     }
     ;
 }