protected void OnClearPatternButtonClicked(object o, EventArgs e) { if (ControlsActive) { Pattern.ClearCustomPixbuf(); if (CustomPattern.Pixbuf != null) { CustomPattern.Pixbuf.Dispose(); } // Generate Custom Pattern Preview CustomPattern.Pixbuf = Pattern.CustomPixbuf.ScaleSimple(CustomPattern.WidthRequest, CustomPattern.HeightRequest, InterpType.Bilinear); } }