Beispiel #1
0
        public MainWindow(MainViewModel viewModel)
        {
            InitializeComponent();
            _viewModel  = viewModel;
            DataContext = _viewModel;

            EditorCanvas.SetBinding(ItemsControl.ItemsSourceProperty, _viewModel.EntitiesBinding);
        }
        public MainWindow()
        {
            InitializeComponent();

            EntityStore = new EntityStore();

            var demoData = new[] { new Tuple <int, string, int, int>(1, "Order", 100, 100), new Tuple <int, string, int, int>(2, "OrderLine", 200, 200) };

            EntityStore.Load(demoData);

            var entitiesBinding = new Binding {
                Source = EntityStore
            };

            EditorCanvas.SetBinding(ItemsControl.ItemsSourceProperty, entitiesBinding);
        }