TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
person
NA
96
0
Dependency properties and bindings
Aug 5 2010 9:12 AM
Hi,
I have an object which has a property Day, which is a DayOfWeek (enum).
public Item()
{
Day = DayOfWeek.Sunday;
}
I have bound this Day property to a bool[] (essentially) dependency property of a UserControl.
var week = new WeekField();
week.SetBinding(WeekField.WeekArrayProperty, TwoWayWithConverter(Item, "Day", dwwac));
dwwac - DayOfWeekToWeekArrayConverter. - basically takes a DayOfWeek and converts it into a bool[].
Now in the xaml :
<DataTemplate DataType="{x:Type vm:WeekSelectionField}">
<GroupBox Header="Week Selection" Margin="0,8,0,0">
<userControls:ButtonsControl Value={Binding Path=WeekArray, Mode=TwoWay} />
</GroupBox>
</DataTemplate>
So i pass the dependencyproperty of WeekField to the Value DP of the ButtonsControl....the ButtonsControl simply has 7 radiobuttons, one for each day of the week.....
But now when I select a different radiobutton, none of properties are updated.
All classes implement INotifyPropertyChanged and I have written tests to confirm that this works.
I have also tried this by cutting out the WeekField and simply have the ButtonsControl, though it doesnt work either.
Thanks greatly in advance,
P.
Reply
Answers (
0
)
Wpf browser back button disable
wpf datagrid questions