Browse Source

NotifyPropertyChanged in DesignSurface

pull/690/head
jkuehner 10 years ago
parent
commit
93f7bc2bc5
  1. 20
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignSurface.cs

20
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignSurface.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
@ -46,7 +47,7 @@ namespace ICSharpCode.WpfDesign.Designer @@ -46,7 +47,7 @@ namespace ICSharpCode.WpfDesign.Designer
/// </summary>
[TemplatePart(Name = "PART_DesignContent", Type = typeof(ContentControl))]
[TemplatePart(Name = "PART_Zoom", Type = typeof(ZoomControl))]
public partial class DesignSurface : ContentControl
public partial class DesignSurface : ContentControl, INotifyPropertyChanged
{
private FocusNavigator _focusNav;
@ -97,6 +98,8 @@ namespace ICSharpCode.WpfDesign.Designer @@ -97,6 +98,8 @@ namespace ICSharpCode.WpfDesign.Designer
this.ZoomControl = this.Template.FindName("PART_Zoom", this) as ZoomControl;
OnPropertyChanged("ZoomControl");
base.OnApplyTemplate();
}
@ -184,6 +187,8 @@ namespace ICSharpCode.WpfDesign.Designer @@ -184,6 +187,8 @@ namespace ICSharpCode.WpfDesign.Designer
context.Services.AddService(typeof(IKeyBindingService), new DesignerKeyBindings(this));
_focusNav=new FocusNavigator(this);
_focusNav.Start();
OnPropertyChanged("DesignContext");
}
/// <summary>
@ -367,5 +372,18 @@ namespace ICSharpCode.WpfDesign.Designer @@ -367,5 +372,18 @@ namespace ICSharpCode.WpfDesign.Designer
}
#endregion
#region INotifyPropertyChanged implementation
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
var ev = PropertyChanged;
if (ev != null)
ev(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}

Loading…
Cancel
Save