This is a migrated thread and some comments may be shown as answers.

Using ParagraphImageMenuItemViewMode - How to DataBind?

1 Answer 39 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 24 Feb 2011, 02:42 PM
Hello,

We try to use the ParagraphImageMenuItemViewMode from the RadMenu sample (Customization -> Integration).

This works really fine. Just have to srt up the design.

<local:ParagraphImageMenuItemViewMode Image="../Images/Menu/Integration_2.png"
                                                Title="Zooming and Scrolling"
                                                Summary="The Example demonstrates the built-in zooming and scrolling..." />
          <local:ParagraphImageMenuItemViewMode Image="../Images/Menu/Integration_3.png"
                                                Title="Grouping and Aggregation"
                                                Summary="RadChart is now able to group and aggregate data..." />

Now the point where I need some help.

We want to databind for example the Title property (for localization purposes).
But that's not possible.
As far as I know I have to use a DependencyProperty for the desired property.

What is the best way to implement this?


I really appreciate the way you are helping us.

Thanks and best regards
Robin

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 28 Feb 2011, 07:34 AM
Hello Robin,

If you are using C# just base your class on DependencyObject, type "propdp" on the place you are about to insert the property and hit enter. Fill in the blanks and you are done. You can leave the rest of the properties that are not going to bound the same way they are at the moment.

I am not sure how you are going to bind these properties though. The view model in the example is set as DataContext. What you are going to bind the Title property to? In such cases I would make the view model's root has a language property and propagate it through its children. And the ParagraphImageMenuItemViewMode would rather implement INotifyPropertyChanged and set its own Title based on the the language.

Kind regards,
Pana
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Menu
Asked by
Robin
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or