WPF usercontrol wont work.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LucasOschip
    New Member
    • Sep 2010
    • 4

    #1

    WPF usercontrol wont work.

    The problem im having is that when i try to set the property "Percentage " in a separate project it wont set the property.

    Heres the source code of both projects:

    UIProgressBar - This is the Usercontrol
    Code:
     Public Class UIProgressBar
        Public Property Percentage
            Get
                Return ReturnPercentageWork()
            End Get
            Set(ByVal value)
                SetPercentageWork(value)
            End Set
        End Property
        Private Function ReturnPercentageWork()
            Dim Percentage_Return As Boolean = FillRec.Width / 2
            Return Percentage_Return
        End Function
        Private Sub SetPercentageWork(ByVal value As Double)
            Dim Percentage_Set As Double = value * 2
            FillRec.Width = Percentage_Set
        End Sub
    End Class
    This is the other project:
    Code:
    Class MainWindow 
     Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
            Dim UIPB As New UICore.UIProgressBar
            UIPB.Percentage = 100
            Grid1.Children.Add(UIPB)
        End Sub
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
        End Sub
    End Class
    Please help if you can. :)
Working...