void ReleaseDesignerOutlets() { if (BGImage != null) { BGImage.Dispose(); BGImage = null; } if (BrushPreview != null) { BrushPreview.Dispose(); BrushPreview = null; } if (BrushSlider != null) { BrushSlider.Dispose(); BrushSlider = null; } if (Canvas != null) { Canvas.Dispose(); Canvas = null; } if (ChangeColourButton != null) { ChangeColourButton.Dispose(); ChangeColourButton = null; } if (Colour1 != null) { Colour1.Dispose(); Colour1 = null; } if (Colour2 != null) { Colour2.Dispose(); Colour2 = null; } if (TempCanvas != null) { TempCanvas.Dispose(); TempCanvas = null; } if (TouchToCanvas != null) { TouchToCanvas.Dispose(); TouchToCanvas = null; } }
public override void ViewDidLoad() { colourPickerViewController = new PopColorPickerViewController(); colourPickerViewController.CancelButton.Clicked += (object sender, EventArgs e) => { DismissViewController(true, null); }; colourPickerViewController.DoneButton.Clicked += (object sender, EventArgs e) => { DismissViewController(true, null); selectedColour.Layer.BackgroundColor = colourPickerViewController.SelectedColor.CGColor; SelectColour(selectedColour); }; ChangeColourButton.TouchUpInside += ChangeColourButtonPressed; Colour1.TouchUpInside += ColourTouched; Colour2.TouchUpInside += ColourTouched; SelectColour(Colour1); TouchToCanvas.canvasImg = Canvas; TouchToCanvas.canvasTempImg = TempCanvas; BrushSlider.SetValue(8, false); UpdateBrushPreview(); if (thisTask.TaskType.IdName == "DRAW_PHOTO") { var suppress = LoadBGImage(); } // Add save icon UIBarButtonItem saveButton = new UIBarButtonItem( UIImage.FromBundle("SaveIcon"), UIBarButtonItemStyle.Plain, (s, e) => { var suppressWarning = SaveAndReturn(); } ); NavigationItem.RightBarButtonItem = saveButton; }