示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PortfolioGridView"/> class.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        public PortfolioGridView(PortfolioGridViewModel viewModel)
        {
            InitializeComponent();
            this.DataContext = viewModel;

            this.IsVisibleChanged += delegate(object sender, DependencyPropertyChangedEventArgs e)
            {
                viewModel.IsVisible = (bool)e.NewValue;
            };
        }
示例#2
0
        /// <summary>
        /// Initializes this instance and adds the view to the region.
        /// </summary>
        public void Initialize()
        {
            PortfolioGridViewModel gridmodel = new PortfolioGridViewModel(eventagg);

            this.regionManager.Regions[RegionNames.DockingRegion].Add(new PortfolioGridView(gridmodel), "portfoliogridView");
        }