示例#1
0
        private void CreateDetailView(ContentControl viewContent)
        {
            EditView editView  = new EditView();
            Binding  myBinding = new Binding();

            myBinding.Path = new PropertyPath("InEditItem");
            BindingOperations.SetBinding(editView, EditView.BindingItemProperty, myBinding);
            editView.Content    = new StoreDetailContent();
            viewContent.Content = editView;
        }
        private void CreateDetailView(ContentControl viewContent)
        {
            EditView editView = new EditView();

            Binding myBinding = new Binding();

            myBinding.Path = new PropertyPath("InEditItem");
            BindingOperations.SetBinding(editView, EditView.BindingItemProperty, myBinding);

            Binding myBinding2 = new Binding();

            myBinding2.ElementName = "DtGrid";
            myBinding2.Path        = new PropertyPath("SelectedItem");
            myBinding2.Converter   = NullToBooleanConverter.Instance;
            BindingOperations.SetBinding(editView, EditView.IsAdditionalDataVisibleProperty, myBinding2);

            editView.Content = new ProductDetailContent();

            viewContent.Content = editView;
        }