static NativeMenuInfo GetInfo(TopLevel target) { var rv = target.GetValue(s_nativeMenuInfoProperty); if (rv == null) { target.SetValue(s_nativeMenuInfoProperty, rv = new NativeMenuInfo(target)); SetIsNativeMenuExported(target, rv.Exporter?.IsNativeMenuExported ?? false); } return(rv); }
static void SetIsNativeMenuExported(TopLevel tl, bool value) { GetInfo(tl).ChangingIsExported = true; tl.SetValue(IsNativeMenuExportedProperty, value); }