void ReleaseDesignerOutlets() { if (Font1Outlet != null) { Font1Outlet.Dispose(); Font1Outlet = null; } if (Font2Outlet != null) { Font2Outlet.Dispose(); Font2Outlet = null; } if (Font3Outlet != null) { Font3Outlet.Dispose(); Font3Outlet = null; } if (FileDirectoryField != null) { FileDirectoryField.Dispose(); FileDirectoryField = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); // Remove all items in the dropdown Font1Outlet.RemoveAllItems(); Font2Outlet.RemoveAllItems(); Font3Outlet.RemoveAllItems(); // Get all available fonts in the system by family var fontFamilies = NSFontManager.SharedFontManager.AvailableFontFamilies.Where(f => AllowedFonts.Contains(f)).ToArray(); Font1Outlet.AddItems(fontFamilies); Font2Outlet.AddItems(fontFamilies); Font3Outlet.AddItems(fontFamilies); }