locked
Bind to custom control partial class property implementing INotifyPropertyChanged RRS feed

  • Question

  • Hello,

    My team is developing a full bussiness application that is already in use and i'm making a new module to set the prices of the articles.

    Right now its important my enduser can select multiple artices and then manipulate all of them at once.

    I am binding directly on my lightswitch objects.

    In the screenshot you can see a list of articles with there articlesizes.

    Right now i made a partial class of my article to add IsSelected this is on the client side.

    Namespace LightSwitchApplication
        Partial Class Article
            Implements INotifyPropertyChanged
    
            Public Event PropertyChanged As PropertyChangedEventHandler
            Private Sub RaisePropertyChanged(caller As String)
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(caller))
            End Sub
    
            Private _IsSelected As Boolean = False
            Public Property IsSelected() As Boolean
                Get
                    Return _IsSelected
                End Get
                Set(ByVal value As Boolean)
                    _IsSelected = value
                    RaisePropertyChanged("IsSelected")
                End Set
            End Property
        End Class
    End Namespace

    In code behind, when i click the button i set the IsSelected property

    In the XAML of this custom control the fill's visibility is bound to this IsSelected.

    The problem is : The INotofyPropertyChanged isn't working and the only way to update the visual side is to 

    do a _screen.Articles.Refresh()   

    This offcourse is not desirable becouse it reloads everything :)

    Can someone help please ?

    -How should i go about getting extra binable property on my article without actualy adding it in my database?

    Thursday, March 20, 2014 10:28 AM

All replies

  • *Bump*
    Monday, March 24, 2014 8:01 AM
  • Moving it to general, it seems this is not about extensibility. 

    Did not find how i can delete the thread, sorry

    Monday, March 24, 2014 8:29 AM
  • Moving it to general, it seems this is not about extensibility. 

    Did not find how i can delete the thread, sorry

    Just ask a moderator to move it for you rather than recreating a new post.

    Justin Anderson, LightSwitch Development Team

    Monday, March 24, 2014 5:23 PM
    Moderator