Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StockListView"/> class.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        public StockListView(StockListViewModel viewModel)
        {
            InitializeComponent();
            stockGrid.SelectedItem = viewModel.StockList.ElementAt(0);
            this.DataContext       = viewModel;

            this.IsVisibleChanged += delegate(object sender, DependencyPropertyChangedEventArgs e)
            {
                viewModel.IsVisible = (bool)e.NewValue;
            };
        }
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public void Initialize()
        {
            StockListViewModel stockmodel = new StockListViewModel(eventagg);

            this.regionManager.Regions[RegionNames.DockingRegion].Add(new StockListView(stockmodel), "stocklistView");
        }