How to bind a new string property from project QuickStartUI_SL to project Examples ->Example.Xaml?

2 posts, 0 answers
  1. Jacky
    Jacky avatar
    1 posts
    Member since:
    Mar 2013

    Posted 01 Apr 2013 Link to this post

    I am studing Telerik Silverlight demo code (RadControls for Silverlight Q1 2013).
    I created a new TestString property in QuickStartUI_SL/ViewModels/MainViewModel.cs
            private string testString;
            public string TestString
            { get { return testString; }
                set { testString = value; this.OnPropertyChanged("TestString");}
            }

    Then I assign TestString value and bind this property in Examples/GanttView.Silverlight/FirstLook/Example.xaml
    like: <TextBlock Text="{Binding TestString}" Style="{StaticResource DemoGroupTextBlock}" />

    But it failed. The value is null.

    Anybody guide me how can I do?
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Apr 2013 Link to this post

    Hi Jacky,

    The ViewModel used in the GanttView FirstLook demos is in the same folder as Example.xaml ( .../Demos/Examples/GanttView/FirstLook ) and is called ViewModel.cs.  You should add the TestString property there in order to bind it properly.

    Greetings,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top