Exemplo n.º 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();
        }
Exemplo n.º 2
0
 public MyModel()
 {
     Entities = new MyEntityList();
 }