PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, May 18, 2022

[FIXED] Why I have a (error does not implement interface member) silverlight

 May 18, 2022     c#, interface, partial, silverlight, wpf     No comments   

Issue

PagesCollection.ViewModel.PagePictureCommands.cs

namespace PagesCollection.ViewModel
{
    public partial class PagePicturesViewModel : IPropertieCommands
    {
        private ICommand deleteAlbum;
        public ICommand _CreateAlbum
        {
            get
            {
                if (createAlbum == null)
                    createAlbum = new Model.DelegateCommand(CreateAlbum, CanAdd);
                return createAlbum;
            }
        }
    }
}

PagesCollection.ViewModel.PagePicturesViewModel.cs

namespace PagesCollection.ViewModel
{
    public partial class PagePicturesViewModel : IPictureMethods
    {
        public void CreateAlbum(object param)
        {...}
    }
}

I have one 2 interfaces and one class which divided on 2.Each one half of class has implemented some of those interfaces.But I have a very strange error. ('PagesCollection.ViewModel.PagePicturesViewModel' does not implement interface member 'PagesCollection.Model.IPropertieCommands._CreateAlbum.set') Can u help me please?


Solution

What is it you don't understand, because the error message seems pretty descriptive:

PagesCollection.ViewModel.PagePicturesViewModel' does not implement interface member 'PagesCollection.Model.IPropertieCommands._CreateAlbum.set

I suspect that the interface looks like:

public interface IPropertieCommands
{
   ICommand _CreateAlbum { get; set; }
}

Which defines that you must have a setter on that property!

So just add a setter in your implementation:

public ICommand _CreateAlbum
{
    get
    {
        if (createAlbum == null)
            createAlbum = new Model.DelegateCommand(CreateAlbum, CanAdd);
        return createAlbum;
    }
    set
    {
        createdAlbum = value; // or something else sensible!
    }
}


Answered By - Jamiec
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing