Skip to content

Commit

Permalink
Fixed logical tree, added ContentPropertyAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
zeluisping committed Mar 4, 2014
1 parent 6348581 commit f011c3c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion MahApps.Metro/Controls/Dialogs/BaseMetroDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@

namespace MahApps.Metro.Controls.Dialogs
{
[System.Windows.Markup.ContentProperty("DialogBody")]
public abstract class BaseMetroDialog : Control
{
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(BaseMetroDialog), new PropertyMetadata(default(string)));
public static readonly DependencyProperty DialogBodyProperty = DependencyProperty.Register("DialogBody", typeof(object), typeof(BaseMetroDialog), new PropertyMetadata(null));
public static readonly DependencyProperty DialogBodyProperty = DependencyProperty.Register("DialogBody", typeof(object), typeof(BaseMetroDialog), new PropertyMetadata(null, (o, e) => {
BaseMetroDialog dialog = (o as BaseMetroDialog);
if (dialog != null) {
if (e.OldValue != null) {
dialog.RemoveLogicalChild(e.OldValue);
}
if (e.NewValue != null) {
dialog.AddLogicalChild(e.NewValue);
}
}
}));
public static readonly DependencyProperty DialogTopProperty = DependencyProperty.Register("DialogTop", typeof(object), typeof(BaseMetroDialog), new PropertyMetadata(null));
public static readonly DependencyProperty DialogBottomProperty = DependencyProperty.Register("DialogBottom", typeof(object), typeof(BaseMetroDialog), new PropertyMetadata(null));

Expand Down

0 comments on commit f011c3c

Please sign in to comment.