Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

TextCellView don't raise ButtonReleased method #644

Open
RodrigoPereyraDiaz opened this issue Feb 14, 2017 · 1 comment
Open

TextCellView don't raise ButtonReleased method #644

RodrigoPereyraDiaz opened this issue Feb 14, 2017 · 1 comment
Labels

Comments

@RodrigoPereyraDiaz
Copy link
Contributor

I have a ListView that need raise action when clicked on a Cell.
I subscript a method like this:

var textCell = new TextCellView { Editable = false, TextField = someFild };
textCell += delegate { MessageDialog.ShowMessage ("Some message"); };

If I press click on the cell, the method isn't raises. Instead a CellView implementation has a null value for the event.

I fix this by to strategies.

one is add a empty method to TextCellView like this

public void OnButtonPressed(ButtonEventArgs args) {}

another one is add this method on the class to map the events

		static TextCellView ()
		{
			EventHost.MapEvent (WidgetEvent.KeyPressed, typeof(TextCellView), "OnKeyPressed");
			EventHost.MapEvent (WidgetEvent.KeyReleased, typeof(TextCellView), "OnKeyReleased");
			EventHost.MapEvent (WidgetEvent.MouseEntered, typeof(TextCellView), "OnMouseEntered");
			EventHost.MapEvent (WidgetEvent.MouseExited, typeof(TextCellView), "OnMouseExited");
			EventHost.MapEvent (WidgetEvent.ButtonPressed, typeof(TextCellView), "OnButtonPressed");
			EventHost.MapEvent (WidgetEvent.ButtonReleased, typeof(TextCellView), "OnButtonReleased");
			EventHost.MapEvent (WidgetEvent.MouseMoved, typeof(TextCellView), "OnMouseMoved");
		}

This happens with CheckCellView too, and probably with other derived classes from CellView.

@sevoku sevoku added the bug label Feb 16, 2017
@sevoku
Copy link
Member

sevoku commented Feb 16, 2017

Related: #531

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants