Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how to use an object in other page wpf

$
0
0

How can I use an object from a WPF page to an other WPF page?

ProductBactlog Page

  public partial class ProductBacklog : Page
  {
    ProductLogCollection productLogCollection = new ProductLogCollection();
    public ProductBacklog()
    {
      InitializeComponent();
    }

    public string getCounts()
    {
      return productLogCollection.Count().ToString();
    }
  }

SprintBacklog page

  public partial class SprintBackLog : Page
  {
    private ProductBacklog parent;


    public SprintBackLog(ProductBacklog parent)
    {
      InitializeComponent();
      this.parent = parent;

      textBlockError.Text = "Counts: " + parent.getCounts();
    }

I get this Error: XamlParseExeption occurred

No matching constructor found on type 'Projektstyring.SprintBackLog'. You can use the Arguments or FactoryMethod directives to construct this type.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>