static void EnsureInDesign () { if (!DesignerProperties.GetIsInDesignMode (Application.Current.RootVisual)) throw new NotImplementedException (); } }