I am trying to Wrap RadOutlookBar and make MYOUTLOOKBAR so that i can expose only few properties in MYOUTLOOKBAR.
In this senario i need to add radoutlookbarItems to MYOUTLOOKBAR.
Even if i add MYoutlookbarItem to MYOUTLOOKBAR ..In xaml i was able to look at the change.
But in design i dont see any Item getting added to the Outlookbar.
if add content to this Newly added MYOutlookBarItem from properties tab, i get an error message saying that
"Property Value is not Valid"
(in detail: Property "content" does not support string to value conversation)
How to add items to outlookbar so that the items of the outlookbar should support exposed properties of radoutlookbar control?
Here is an example code...for Items property of MyOutlookbar.cs
#region
Property: Items
private MYOutlookBarItemCollection _items;
public MYOutlookBarItemCollection Items
{
get
{
if (_items == null)
{
_items =
new MYOutlookBarItemCollection ();
}
return _items;
}
}
#endregion
The above code exposes the items property in MYoutlookbar
MYOutlookBarItemCollection.cs will be a separate will which contains
public class MYOutlookBarItemCollection: ObservableCollection<MYOutlookBarItem>
{
}
Here is an example code...for content property of MyOutlookbarItem.cs
#region
Property: Content
public object Content
{
get { return (object)GetValue(ContentProperty); }
set { SetValue(ContentProperty, value); }
}
public static readonly DependencyProperty ContentProperty =
DependencyProperty.Register(
"Content", typeof(object), typeof(MyOutlookBarItem),
new FrameworkPropertyMetadata
{
PropertyChangedCallback = (obj, e) =>
{
(obj
as MyOutlookBarItem).UpdateContent((object)e.NewValue);
}
});
private void UpdateContent(object sel)
{
OutlookBarItem.Content = sel;
}
#endregion
Can you guys help me..
Thanks,
Deepz